Trending Products
https://rebuyengine.com/api/v1/products/trending_productsReturns a list of trending products based on sales data.
Use Cases
Use this endpoint to list trending products (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.
metafield_ns_key· string- Comma-separated list of product metafield
namespace.keypairs to include in the response. Example value:custom.color,loox.avg_rating variant_metafield_ns_key· string- Comma-separated list of variant metafield
namespace.keypairs to include in the response. Example value:custom.size_guide,inventory.available metafield_ns· string- Comma-separated list of product metafield namespaces to include in the response. Returns all metafields matching the given namespaces. Example value:
custom,loox variant_metafield_ns· string- Comma-separated list of variant metafield namespaces to include in the response. Returns all variant metafields matching the given namespaces. Example value:
custom,inventory 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. fields· string-
Comma-separated list of product fields to include in the response. When omitted, the full product object is returned. Supports dot notation for variant sub-fields.
Example:
?fields=id,handle,title,variants.id,variants.priceAvailable top-level fields:
id,title,handle,body_html,vendor,product_type,status,tags,created_at,updated_at,published_at,template_suffix,published_scope,admin_graphql_api_id,variants,options,images,imageAvailable variant sub-fields (via
variants.*):id,product_id,title,price,sku,compare_at_price,inventory_quantity,inventory_policy,inventory_management,option1,option2,option3,position,created_at,updated_at,taxable,barcode,image_id,weight,weight_unit,inventory_item_id,requires_shipping,fulfillment_service,admin_graphql_api_id
Code Example¶
// GET https://rebuyengine.com/api/v1/products/trending_products
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/trending_products?${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": 832991428644,
"name": "Color",
"values": ["Black", "Gray", "Lapis", "Navy", "White"]
}
],
"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
]
}