Docs

API reference

A short reference for the product search endpoint. The portal hosts the full docs.

Authentication

Send the API key on every call, as a bearer token or in X-API-Key. Create the key in the portal.

Authorization: Bearer YOUR_API_KEY
X-API-Key: YOUR_API_KEY

POST /api/products/search

Looks up retail product data for each term and returns JSON.

terms Required. 1 to 10 non-empty strings.
limit Optional integer from 1 to 5. Defaults to 1. Products returned per term.

Example

bash
curl -s -X POST https://api.productendpoint.tech/api/products/search \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "{\"terms\":[\"yoga mat\"],\"limit\":1}"

The same call accepts X-API-Key: $API_KEY in place of the bearer header. URLs in the sample response are placeholders.

{
  "results": [
    {
      "term": "yoga mat",
      "products": [
        {
          "name": "Studio Yoga Mat",
          "price": 24.99,
          "currency": "USD",
          "description": "Extra thick mat for home workouts.",
          "images": ["https://example.com/images/yoga-mat.jpg"],
          "url": "https://example.com/products/studio-yoga-mat"
        }
      ]
    }
  ]
}

Cache

A successful lookup can be reused for about 24 hours. Matching ignores extra space and letter case. A failed lookup is not stored. A later call with a higher limit still returns the products saved with that lookup until the cache expires.

Errors

  • A missing or invalid API key returns 401.
  • An invalid body returns 400. That includes an empty terms list, more than 10 terms, a blank term, a limit outside 1 to 5, and malformed JSON.
  • An unexpected failure returns 500.
  • One term can fail while the HTTP status stays 200. That term has an empty product list and an error message. Other terms in the same request can still include products.