Skip to content

Recommended

GEThttps://rebuyengine.com/api/v1/products/recommended

Use Cases

Use this endpoint to build automated AI-based product recommendation workflows. For example, if a customer is buying A, use this endpoint to automatically surface and suggest they buy complimentary product B too.

Excluding Products

Add exclude_rebuy as a Shopify Product Tag to exclude products from being recommended.

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. Also used if only passing up single product ID.
shopify_collection_id · string
Shopify Collection ID. If provided, products belonging to this collection will be returned. Also used if only passing up single variant ID.
shopify_variant_ids · string
Comma separated list of Shopify Variant 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.
format · string
Valid values: pretty. Use pretty to make the response easy to read.
limit · string · Default: 5
Used to limit the number of returned results.
any_variant_price_less_than · string
Returns products that have any variant prices less than or equal to. Example value: 14.00
any_variant_price_less_than_or_equal_to · string
Returns products that have any variant prices less than or equal to. Example value: 14.00
any_variant_price_equal_to · string
Returns products that have any variant prices equal to. Example value: 99.00
variant_price_greater_than · string
Returns products that have any variant prices greater than. Example value: 10.00
variant_price_greater_than_or_equal_to · string
Returns products that have any variant prices greater than or equal to. Example value: 14.00
unset_variants · string
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.
context · string · Default: default
Toggles the recommended products to use the similar products AI
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

// GET https://rebuyengine.com/api/v1/products/recommended
const API_KEY = "YOUR_PUBLIC_API_KEY";

const params = new URLSearchParams({
  key: API_KEY,
  shopify_product_ids: "YOUR_VALUE",
  shopify_collection_id: "YOUR_VALUE"
});

fetch(`https://rebuyengine.com/api/v1/products/recommended?${params}`)
  .then(response => response.json())
  .then(data => console.log(data));

Response Examples

200 OK

{
  "data": [
    {
      "id": 562415992868,
      "title": "Performance Half Zip Pullover",
      "body_html": "Performance Half Zip Pullover",
      "vendor": "Example Brand",
      "product_type": "",
      "handle": "sport-tek-performance-half-zip-pullover",
      "status": "active",
      "tags": "clothing",
      "variants": [
        {
          "id": 7162596589604,
          "product_id": 562415992868,
          "title": "Royal Blue",
          "price": "50.00",
          "sku": "SPHZP-1",
          "compare_at_price": null,
          "inventory_quantity": 0,
          "option1": "Royal Blue"
        }
      ],
      "options": [
        {
          "id": 833063026724,
          "name": "Color",
          "values": ["Royal Blue", "White"]
        }
      ],
      "images": [
        {
          "id": 2155988090916,
          "src": "https://cdn.shopify.com/s/files/1/example/product.png",
          "width": 1528,
          "height": 1528
        }
      ],
      "image": {
        "id": 2155988090916,
        "src": "https://cdn.shopify.com/s/files/1/example/product.png"
      }
    }
    // ... additional products based on limit parameter
  ],
  "metadata": {
    "cache_info": {
      "cache_key": "re_c#025410d22345210e82e2e44d8826df9e",
      "cached_at_time": "never"
    }
  }
}

400 Bad Request

{
  "error": "Invalid key"
}
See something that needs updating? Suggest an edit