Search Products

Searches for products by name across one or more merchants. Optionally prioritize results to a specific merchant. Returns a ranked list of matching products with pricing, imagery, and direct purchase links.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Search for products by name across CartAI's merchant network — including Shopify stores and major retailers. Optionally prioritize a specific merchant — other retailers are still included.

When to Use This Endpoint

Use /product/search to let users discover products before initiating a checkout. It is a lightweight lookup — no cart is created, no session is started.

Use caseRecommended approach
Search bar / product discovery UICall /product/search on user input, display returned products
Narrowing results to a specific retailerPass merchant to prioritize a specific merchant — targetMatchCount tells you how many matched
Pre-filling a checkout with a found itemUse directUrl from a search result as the url in POST /checkout
Cross-merchant price comparisonOmit merchant to get results from multiple retailers in one response

Authentication

Every request must include your API key in the request header.

x-api-key: YOUR_API_KEY_HERE
  • Never embed your API key in client-side code. Always call this endpoint from your backend.

Request Body

FieldTypeRequiredDescription
namestring✅ YesThe product name or search query (e.g. "jeans", "blue denim jacket").
merchantstring❌ NoPrioritize results to a specific merchant name (e.g. "Macy's"). Case-insensitive.

Example Request

curl --location 'https://api.cartai.ai/product/search' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{
  "name": "jeans",
  "merchant": "Macy'\''s"
}'

Response Schema

A successful 200 response returns a JSON object with the following structure.

Top-level fields

FieldTypeDescription
statusstring"success" on a successful search.
messagestringHuman-readable result summary (e.g. "Search complete").
dataobjectContains the search results. See data below.

data

FieldTypeDescription
productsarray of objectsRanked list of matching products. See products[] below.
targetMerchantstringThe merchant value from your request, echoed back. Empty string if no merchant filter was applied.
targetMatchCountintegerNumber of products in products[] that belong to the target merchant. 0 if no merchant was specified.

products[]

Each item in the products array represents a single matching product.

FieldTypeDescription
namestringProduct name as listed by the merchant.
brandstringBrand name. May be omitted if the merchant does not provide it.
merchantstringName of the retailer selling this product.
imagestring (URI)URL of the primary product image.
priceFromnumberLowest available price for this product, in the specified currency.
currencystringISO 4217 currency code (e.g. "USD").
directUrlstring (URI)Direct link to the product page on the merchant's site. Use this as the url in POST /checkout.

Example Response

{
  "status": "success",
  "message": "Search complete",
  "data": {
    "products": [
      {
        "name": "Dkny Jeans Women's High-Rise Jeans - Clifton",
        "brand": "Dkny Jeans",
        "merchant": "Macy's",
        "image": "https://slimages.macysassets.com/is/image/MCY/products/0/optimized/35661058_fpx.tif?wid=1200&fmt=jpeg&qlt=100",
        "priceFrom": 26.63,
        "currency": "USD",
        "directUrl": "https://www.macys.com/shop/product/dkny-jeans-womens-high-rise-jeans?ID=24996759"
      },
      {
        "name": "Nautica Jeans Women's Demi Bootcut Jeans - Sailor",
        "brand": "Nautica Jeans",
        "merchant": "Macy's",
        "image": "https://slimages.macysassets.com/is/image/MCY/products/6/optimized/33148130_fpx.tif?wid=1200&fmt=jpeg&qlt=100",
        "priceFrom": 44.52,
        "currency": "USD",
        "directUrl": "https://www.macys.com/shop/product/nautica-jeans-womens-demi-bootcut-jeans?ID=22497871"
      }
    ],
    "targetMerchant": "Macy's",
    "targetMatchCount": 2
  }
}

Notes

  • priceFrom reflects the lowest-priced variant. The actual checkout price may vary depending on the variant selected.
  • The directUrl from a search result can be passed directly as the url field in POST /checkout to initiate a purchase if the product does not have any variants.
Body Params
string
required

Product name or search query

string

Optional merchant name to prioritize results for specific merchant (other retailers are still returned)

Headers
string
required
Responses

400

Bad Request

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json