Top Sellers
GET
https://rebuyengine.com/api/v1/products/top_sellersReturns a list of the top selling products based on sales data.
Use Cases
Use this endpoint to list top sellers (e.g. on the homepage).
Query Parameters¶
key· string · required- Your Rebuy public API key. Find this in your Rebuy admin under Settings → API Keys.
shopify_product_ids· string- Comma separated list of Shopify Product IDs to filter from the result set.
metafields· string- Valid values: yes. Returns product objects enriched with a metafields property.
variant_metafields· string- Valid values: yes. Returns product objects with enriched variant metafields property.
bust_cache· string- Valid values: yes. Deletes cached response and generates a new one.
limit· string · Default:5- Used to limit the number of returned results.
format· string- Valid values: pretty. Use pretty to make the response easy to read.
any_variant_price_less_than· number- Returns products that have any variant prices less than or equal to the provided value. Example value: 14.99
any_variant_price_less_than_or_equal_to· number- Returns products that have any variant prices less than or equal to the provided value. Example value: 14.00
any_variant_price_equal_to· number- Returns products that have any variant prices equal to the provided value. Example value: 99.99
variant_price_greater_than· string- Returns products that have any variant prices greater than the provided value. Example value: 10.00
variant_price_greater_than_or_equal_to· number- Returns products that have any variant prices greater than or equal to the provided value. Example value: 14.00
unset_variants· string- Valid values: yes, no. Unset all product variants that don't pass variant price conditions.
filter_oos· string · Default:yes- Excludes products that are out of stock (OOS) from the response. To include OOS products, set the parameter to equal no.
country_code· string-
The ISO 3166-1 alpha-2 country code (e.g.,
US,CA,GB) corresponding to a Market region. Retrieves variant pricing from the Market's catalog. The prices returned reflect the shop's first active Market that matches the providedcountry_code. Only products included in that Market's catalog will be returned in the response — products excluded from the catalog will not appear.Required Shopify Scope:
read_marketsReplaces the deprecated
presentment_pricesquery parameter.
Code Example¶
// GET https://rebuyengine.com/api/v1/products/top_sellers
const API_KEY = "YOUR_PUBLIC_API_KEY";
const params = new URLSearchParams({
key: API_KEY,
shopify_product_ids: "YOUR_VALUE",
metafields: "YOUR_VALUE"
});
fetch(`https://rebuyengine.com/api/v1/products/top_sellers?${params}`)
.then(response => response.json())
.then(data => console.log(data));
Response Examples¶
200 OK¶
{
"data": [
{
"id": 562361892900,
"title": "Flex Fleece Zip Hoodie",
"body_html": "Flex Fleece Zip Hoodie",
"vendor": "Example Brand",
"product_type": "",
"handle": "american-apparel-flex-fleece-zip-hoodie",
"status": "active",
"tags": "clothing",
"variants": [
{
"id": 7162327597092,
"product_id": 562361892900,
"title": "Black",
"price": "36.00",
"sku": "AAFFZH-1",
"compare_at_price": "45.00",
"inventory_quantity": 10,
"option1": "Black"
}
],
"options": [
{
"id": 833001914404,
"name": "Color",
"values": ["Black", "Gray", "Lapis"]
}
],
"images": [
{
"id": 2155862786084,
"src": "https://cdn.shopify.com/s/files/1/example/hoodie.png",
"width": 1528,
"height": 1528
}
],
"image": {
"id": 2155862786084,
"src": "https://cdn.shopify.com/s/files/1/example/hoodie.png"
}
}
// ... additional products based on limit parameter
]
}
400 Bad Request¶
--- title: Top Sellers excerpt: Fetch top selling products based on sales data api: file: rebuy-products.json operationId: top-sellers deprecated: false hidden: false metadata: title: '' description: '' robots: index next: description: '' --- ## GET /api/v1/products/top_sellers Returns a list of the top selling products based on sales data. !!! note "Use Cases" Use this endpoint to list top sellers (e.g. on the homepage). ## Query Parameters `key` · string · required : Your Rebuy public API key. Find this in your Rebuy admin under [**Settings → API Keys**](https://rebuyengine.com/account/keys). `shopify_product_ids` · string : Comma separated list of Shopify Product IDs to filter from the result set. `metafields` · string : Valid values: yes. Returns product objects enriched with a metafields property. `variant_metafields` · string : Valid values: yes. Returns product objects with enriched variant metafields property. `bust_cache` · string : Valid values: yes. Deletes cached response and generates a new one. `limit` · string · Default: `5` : Used to limit the number of returned results. `format` · string : Valid values: pretty. Use pretty to make the response easy to read. `any_variant_price_less_than` · number : Returns products that have any variant prices less than or equal to the provided value. Example value: 14.99 `any_variant_price_less_than_or_equal_to` · number : Returns products that have any variant prices less than or equal to the provided value. Example value: 14.00 `any_variant_price_equal_to` · number : Returns products that have any variant prices equal to the provided value. Example value: 99.99 `variant_price_greater_than` · string : Returns products that have any variant prices greater than the provided value. Example value: 10.00 `variant_price_greater_than_or_equal_to` · number : Returns products that have any variant prices greater than or equal to the provided value. Example value: 14.00 `unset_variants` · string : Valid values: yes, no. Unset all product variants that don't pass variant price conditions. `filter_oos` · string · Default: `yes` : Excludes products that are out of stock (OOS) from the response. To include OOS products, set the parameter to equal no. `country_code` · string : The ISO 3166-1 alpha-2 country code (e.g., `US`, `CA`, `GB`) corresponding to a Market region. Retrieves variant pricing from the Market's catalog. The prices returned reflect the shop's first active Market that matches the provided `country_code`. Only products included in that Market's catalog will be returned in the response — products excluded from the catalog will not appear. **Required Shopify Scope:** `read_markets` Replaces the deprecated `presentment_prices` query parameter. ## Code Example ```javascript // GET https://rebuyengine.com/api/v1/products/top_sellers const API_KEY = "YOUR_PUBLIC_API_KEY"; const params = new URLSearchParams({ key: API_KEY, shopify_product_ids: "YOUR_VALUE", metafields: "YOUR_VALUE" }); fetch(`https://rebuyengine.com/api/v1/products/top_sellers?${params}`) .then(response => response.json()) .then(data => console.log(data)); ``` ## Response Examples ### 200 OK ```json { "data": [ { "id": 562361892900, "title": "Flex Fleece Zip Hoodie", "body_html": "Flex Fleece Zip Hoodie", "vendor": "Example Brand", "product_type": "", "handle": "american-apparel-flex-fleece-zip-hoodie", "status": "active", "tags": "clothing", "variants": [ { "id": 7162327597092, "product_id": 562361892900, "title": "Black", "price": "36.00", "sku": "AAFFZH-1", "compare_at_price": "45.00", "inventory_quantity": 10, "option1": "Black" } ], "options": [ { "id": 833001914404, "name": "Color", "values": ["Black", "Gray", "Lapis"] } ], "images": [ { "id": 2155862786084, "src": "https://cdn.shopify.com/s/files/1/example/hoodie.png", "width": 1528, "height": 1528 } ], "image": { "id": 2155862786084, "src": "https://cdn.shopify.com/s/files/1/example/hoodie.png" } } // ... additional products based on limit parameter ] } ``` ### 400 Bad Request ```json {} ```
See something that needs updating?
Suggest an edit