Shop.app API endpoint
Returns adjacent variants for a Shop.app product. selected_options must be a JSON object when provided. Repeated option filters may also be sent as option.Name=value or option[Name]=value.
/shop-app/products/{id}/variantsPath parameters:
id: required. Shop.app product id. Example: 4596217053229.Query parameters:
selected_options: optional JSON object. Example: {"Size":"7"}.option.<name> or option[<name>]: optional repeated option form. Example: option.Size=7 or option[Size]=7.limit: optional integer. Maximum variants to return. Default: 50; maximum: 100.Notable response behavior:
selected_options JSON returns an invalid-param error before upstream IO.| Field | Filled in, of 20 checked | Values in the sample |
|---|---|---|
| id | 20 | |
| gid | 20 | |
| title | 20 | “Black / 7 / 6E” and 19 other values |
| options | 20 | |
| price | 20 | 120.95 to 169.95, median 132.95 |
| currency | 20 | EUR in all 20 |
| available_for_sale | 20 | true in 12 of 20 |
| requires_shipping | 20 | true in 20 of 20 |
| image | 20 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id (path) | string | Yes | Product id | 4596217053229 | |
| selected_options | string | No | Selected options JSON object | {"Size":"7"} | |
| limit | integer | No | 50 and supports up to 100 | Maximum variants, defaults to 50 and supports up to 100 | 50 |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/shop-app/products/4596217053229/variants?limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"product_id": "4596217053229",
"variants": [
{
"id": "34761278160941",
"title": "Black / 7 / 6E",
"available_for_sale": true
}
]
}
}Request schema
No body schema
Response schema
#/definitions/shopapp.variantsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | shopapp.VariantsResponse | No | ||||
| data.limit | integer | No | 50 | Maximum number of variants requested. | ||
| data.product_id | string | No | 4596217053229 | Shop.app ID of the product. | ||
| data.variants | array | No | Variants of the product. | |||
| data.variants[].available_for_sale | boolean | No | `true` when the variant can be bought. | |||
| data.variants[].currency | string | No | Currency code of `price` and `original_price`. | |||
| data.variants[].gid | string | No | gid://shopify/ProductVariant/34761278160941 | Shopify global ID of the variant. | ||
| data.variants[].id | string | No | 34761278160941 | Shop.app variant ID. | ||
| data.variants[].image | object | No | Image of the variant. | |||
| data.variants[].image.alt | string | No | Product image | Alt text of the image. | ||
| data.variants[].image.url | string | No | https://cdn.shopify.com/example.jpg | URL of the image. | ||
| data.variants[].options | object | No | Option values of the variant keyed by option name, for example `Size`. | |||
| data.variants[].original_price | number | No | Price before the discount, in `currency`. | |||
| data.variants[].price | number | No | Current price of the variant, in `currency`. | |||
| data.variants[].requires_shipping | boolean | No | `true` when the variant has to be shipped. | |||
| data.variants[].title | string | No | Black / 7 / 6E | Variant title, for example `Black / 7 / 6E`. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/shop-app/products/4596217053229/variants?limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"