Skip to content

Get and set product metadata

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 2 commands: Get product meta (GET /v2/files/meta/product) and Set product meta (POST /v2/files/meta/product). This can be used by retailers for organizing images into product groups for an ecommerce store. Each call needs a bearer token and counts towards your hourly API limit.

After reading this you will know

  • How to get and set product metadata
  • Which parameters each of the 2 commands takes
  • Sample code in 9 languages and a sample answer

Every command on this page needs a bearer token and counts towards your hourly limit.

GEThttps://api.sirv.com/v2/files/meta/product

Use this API method to get the product meta fields for an image.

This can be used by retailers for organizing images into product groups for an ecommerce store.

Query parameters

NameTypeRequiredExampleDescription
filenamestringYes/REST API Examples/blue-lake.jpgPath of the file in your account, starting with /.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/meta/product?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"id": "LLBB77",
"name": "Blue Lake Card",
"brand": "BLUE LAKE LLC",
"category1": "Cards",
"category2": "Lakes"
}
POSThttps://api.sirv.com/v2/files/meta/product

Use this API method to set product meta fields for an image.

This can be used by retailers for organizing images into product groups for an ecommerce store.

Query parameters

NameTypeRequiredExampleDescription
filenamestringYes/REST API Examples/blue-lake.jpgPath of the file in your account, starting with /.

Request body (JSON)

FieldTypeRequiredExampleDescription
idstringNoLLBB77Product ID or SKU.
namestringNoBlue Lake CardProduct name.
brandstringNoBLUE LAKE LLCBrand of the product.
category1stringNoCardsMain product category.
category2stringNoLakesSecond product category.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/meta/product?filename=%2FREST%20API%20Examples%2Fblue-lake.jpg', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"id": "LLBB77",
"name": "Blue Lake Card",
"brand": "BLUE LAKE LLC",
"category1": "Cards",
"category2": "Lakes"
}),
});
console.log(res.status, await res.text());

Response

HTTP 200 with an empty body when the command succeeds.

Back to top