Shopify API endpoint
Returns predictive search suggestions from any Shopify storefront for a query: matching products, collections and suggested queries. Choose which with `types` (default all three) and cap results per type with `limit` (default 10, max 20). Products carry price, availability, images and options; collections carry title, handle, description and product count.
/shopify/search/suggestReturns commerce search suggestions from Shopify.
url: required. Full Shopify storefront URL, using http or https. Localhost, private network, link-local, and credentialed URLs are rejected.q: required. Search query text.types: optional comma-separated suggestion types. Allowed values: product, collection, query. Defaults to product,collection,query.limit: optional. Defaults to 10, maximum 20.200 with empty arrays.| Field | Filled in, of 3 checked | Values in the sample |
|---|---|---|
| id | 3 | |
| handle | 3 | |
| title | 3 | “Women's Wool Cruiser - Natural Grey (Natural White Sole)” and 2 other values |
| url | 3 | allbirds.com |
| description | 3 | median 319 characters |
| vendor | 3 | “Allbirds” |
| product_type | 3 | “Shoes” |
| price | 3 | 105 to 110, median 110 |
| featured_image | 3 | cdn.shopify.com |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| url | string | Yes | Shopify storefront URL | https://www.allbirds.com | |
| q | string | Yes | Search query | wool | |
| types | string | No | Comma-separated suggestion types. Allowed values: product, collection, query | product,collection,query | |
| limit | integer | No | 10 and supports up to 20 | Maximum results per type, defaults to 10 and supports up to 20 | 10 |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/shopify/search/suggest?url=https%3A%2F%2Fwww.allbirds.com&q=wool&limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"store_url": "https://www.allbirds.com",
"source_url": "https://www.allbirds.com",
"query": "wool",
"types": [
"product",
"collection",
"query"
],
"limit": 10,
"products": [
{
"handle": "mens-wool-runners",
"title": "Men's Wool Runners"
}
],
"collections": [
{
"handle": "mens",
"title": "Men"
}
],
"queries": [
{
"text": "wool",
"url": "https://www.allbirds.com/search?q=wool"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/shopify.searchSuggestResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | shopify.SearchSuggestResponse | No | ||||
| data.collections | array | No | Collections suggested for the query. | |||
| data.collections[].created_at | string | No | Time the record was created, as Shopify returns it. | |||
| data.collections[].description | string | No | Collection description as plain text. | |||
| data.collections[].handle | string | No | mens | URL slug of the collection, for example `mens`. | ||
| data.collections[].id | string | No | 278435758160 | Shopify collection id. | ||
| data.collections[].products_count | integer | No | 24 | Number of products in the collection. Omitted for headless storefronts. | ||
| data.collections[].published_at | string | No | Time the record was published, as Shopify returns it. | |||
| data.collections[].title | string | No | Men | Collection name as shown on the storefront. | ||
| data.collections[].updated_at | string | No | Time the record was last updated, as Shopify returns it. | |||
| data.collections[].url | string | No | https://www.allbirds.com/collections/mens | Storefront page URL of the collection. | ||
| data.limit | integer | No | 10 | Maximum number of suggestions requested. | ||
| data.products | array | No | Products suggested for the query. | |||
| data.products[].available | boolean | No | Whether at least one variant is available to buy. | |||
| data.products[].canonical_colour | string | No | black | Main colour name the storefront groups the product under, for example `black`. | ||
| data.products[].collection_tags | array | No | Collections the product is listed in, as the storefront labels them. | |||
| data.products[].colour | string | No | black | The fields below are only populated when the product was resolved via the embedded-SSR-JSON fallback transport (see ssr_fallback.go) and the source page exposed this data; they are additive and never populated for classic-store responses. | ||
| data.products[].compare_at_price | number | No | 120 | Original price before discount, in the store's currency. The highest compare-at price across variants. | ||
| data.products[].condition | string | No | Excellent | Condition is only populated for resale-marketplace search results (Fashionphile's AlgoliaSearch, Rebag's StorefrontSearch -- see search.go) whose catalog data exposes a condition grade. Never populated for any other brand or endpoint in this family. | ||
| data.products[].created_at | string | No | Time the record was created, as Shopify returns it. | |||
| data.products[].description | string | No | Product description as plain text. | |||
| data.products[].discount_percentage | number | No | 20 | Discount currently applied to the product, as a percentage. | ||
| data.products[].featured_image | string | No | URL of the product's main image. | |||
| data.products[].handle | string | No | mens-wool-runners | URL slug of the product, for example `mens-wool-runners`. | ||
| data.products[].id | string | No | 6616124981328 | Shopify product id. | ||
| data.products[].images | array | No | Images of the product, in the storefront's order. | |||
| data.products[].images[].alt | string | No | Product image | Alternative text of the image. | ||
| data.products[].images[].created_at | string | No | Time the record was created, as Shopify returns it. | |||
| data.products[].images[].height | integer | No | 1600 | Image height in pixels. | ||
| data.products[].images[].id | string | No | 36411373027408 | Shopify image id. | ||
| data.products[].images[].position | integer | No | 1 | Position of the image in the product's image list, starting at 1. | ||
| data.products[].images[].updated_at | string | No | Time the record was last updated, as Shopify returns it. | |||
| data.products[].images[].url | string | No | https://cdn.shopify.com/s/files/1/example.jpg | URL of the image file. | ||
| data.products[].images[].variant_ids | array | No | Ids of the variants this image is attached to. | |||
| data.products[].images[].width | integer | No | 1600 | Image width in pixels. | ||
| data.products[].labels | array | No | new | Badges the storefront shows on the product, for example `new`. | ||
| data.products[].options | array | No | Options the product varies by, such as size or colour. | |||
| data.products[].options[].name | string | No | Size | Option name, for example `Size`. | ||
| data.products[].options[].position | integer | No | 1 | Position of the option on the product, starting at 1. | ||
| data.products[].options[].values | array | No | Values the option can take, for example `S` or `M`. | |||
| data.products[].price | number | No | 98 | Current price in the store's currency. The lowest variant price when variants are listed. | ||
| data.products[].product_type | string | No | Shoes | Product type set by the merchant, for example `Shoes`. | ||
| data.products[].published_at | string | No | Time the record was published, as Shopify returns it. | |||
| data.products[].rating | number | No | 4.2 | Average customer rating shown by the storefront. | ||
| data.products[].rating_count | integer | No | 1549 | Number of customer ratings behind `rating`. | ||
| data.products[].tags | array | No | Tags the merchant attached to the product. | |||
| data.products[].title | string | No | Men's Wool Runners | Product name as shown on the storefront. | ||
| data.products[].updated_at | string | No | Time the record was last updated, as Shopify returns it. | |||
| data.products[].url | string | No | https://www.allbirds.com/products/mens-wool-runners | Storefront page URL of the product. | ||
| data.products[].variants | array | No | Purchasable variants of the product, such as each size and colour. | |||
| data.products[].variants[].available | boolean | No | Whether this variant is currently available to buy. | |||
| data.products[].variants[].barcode | string | No | Barcode of the variant, such as a UPC or EAN. | |||
| data.products[].variants[].compare_at_price | number | No | 120 | Original price before discount, in the store's currency. | ||
| data.products[].variants[].created_at | string | No | Time the record was created, as Shopify returns it. | |||
| data.products[].variants[].featured_image | string | No | URL of the image shown for this variant. | |||
| data.products[].variants[].grams | integer | No | 400 | Weight of the variant in grams. | ||
| data.products[].variants[].id | string | No | 34761278160941 | Shopify variant id. | ||
| data.products[].variants[].inventory_quantity | integer | No | 24 | InventoryQuantity is only populated via the embedded-SSR-JSON fallback transport (see ssr_fallback.go); classic-store responses never set it. | ||
| data.products[].variants[].option1 | string | No | Value of the product's first option for this variant, for example a size. | |||
| data.products[].variants[].option2 | string | No | Value of the product's second option for this variant. | |||
| data.products[].variants[].option3 | string | No | Value of the product's third option for this variant. | |||
| data.products[].variants[].position | integer | No | 1 | Position of the variant in the product's variant list, starting at 1. | ||
| data.products[].variants[].price | number | No | 98 | Current price of the variant in the store's currency. | ||
| data.products[].variants[].product_id | string | No | 6616124981328 | Shopify id of the product the variant belongs to. | ||
| data.products[].variants[].requires_shipping | boolean | No | Whether the variant is a physical item that needs shipping. | |||
| data.products[].variants[].sku | string | No | A123 | Merchant stock keeping unit code of the variant. | ||
| data.products[].variants[].taxable | boolean | No | Whether tax is charged on the variant. | |||
| data.products[].variants[].title | string | No | Natural Black / 10 | Variant name, for example `Natural Black / 10`. | ||
| data.products[].variants[].updated_at | string | No | Time the record was last updated, as Shopify returns it. | |||
| data.products[].vendor | string | No | Allbirds | Brand or vendor name set by the merchant. | ||
| data.queries | array | No | Search phrases suggested for the query. | |||
| data.queries[].text | string | No | wool | Suggested search phrase. | ||
| data.queries[].url | string | No | https://www.allbirds.com/search?q=wool | Storefront search results URL for the phrase. | ||
| data.query | string | No | wool | Search text that was run. | ||
| data.source_url | string | No | https://www.allbirds.com | URL the data was read from. | ||
| data.store_url | string | No | https://www.allbirds.com | Base URL of the Shopify storefront that was queried. | ||
| data.types | array | No | product,collection,query | Suggestion types returned: `product`, `collection` and `query`. | ||
| 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/shopify/search/suggest?url=https%3A%2F%2Fwww.allbirds.com&q=wool&limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"