Skip to main content
Context.dev’s Product API takes any product page URL (Amazon, TikTok Shop, or any SaaS/D2C website) and gives you a structured product record:
  • Name, description, category of the product
  • Pricing models, listed price and ISO currency code
  • List of features, the product’s target audience, and more

Integrate Context.dev's Product API in your app

Open in Cursor

Prerequisites

  • A Context.dev API key. Sign up at context.dev/signup, copy the key from the dashboard (prefix ctxt_secret_), and export it:
    export CONTEXT_DEV_API_KEY="ctxt_secret_..."
    
  • An SDK (optional). Install for your language, or skip the install and call directly with curl:
    npm install context.dev
    

Extract a single product

POST /brand/ai/product takes a single product URL and returns whether the page is a product page, the detected ecommerce platform, and the extracted product record.
curl -X POST https://api.context.dev/v1/brand/ai/product \
  -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.allbirds.com/products/mens-wool-runners"}'
10 credits per successful call

Request Parameters

ParameterTypeDescription
urlstring (URI)Required. The product page URL.
maxAgeMsinteger (0-2592000000)Return a cached result if one exists younger than this many milliseconds. Set to 0 to always scrape fresh. Max 30 days. Defaults to 604800000 (7d).
timeoutMSinteger (1000-300000)Abort with a 408 if the request exceeds this many milliseconds. Max 300000 (5 min).

Response

{
  "is_product_page": true,
  "platform": "generic",
  "product": {
    "name": "Men's Wool Runner - Natural Grey (Light Grey Sole)",
    "description": "The Allbirds Men's Wool Runner is a classic casual sneaker made from soft, responsibly-sourced Merino wool that is breathable, lightweight, and machine washable…",
    "price": 110,
    "currency": "USD",
    "billing_frequency": "one_time",
    "pricing_model": "flat",
    "url": "https://www.allbirds.com/products/mens-wool-runners",
    "category": "Footwear",
    "features": [
      "Soft Merino wool upper",
      "Machine washable (remove insoles and laces)",
      "Sugarcane-based SweetFoam® midsole for support and cushioning",
      "Breathable and lightweight",
      "Responsibly sourced materials"
    ],
    "target_audience": ["Men"],
    "tags": ["wool", "sneaker", "men's shoes", "casual", "sustainable"],
    "image_url": "https://media.brand.dev/34f4b265-7198-4eaa-a4a3-e0b87f40de29.png",
    "images": [
      "https://media.brand.dev/2177175e-aae3-4179-b59d-0df12fb1b59d.png",
      "https://media.brand.dev/04027441-7ec6-4928-94e5-5b74c21347b8.png",
      "https://media.brand.dev/f47cbb41-7c3b-4fa1-92c5-4764560dda3e.png"
    ],
    "sku": "MENS_WOOL_RUNNERS"
  }
}
FieldTypeDescription
is_product_pagebooleanWhether the URL was recognized as a product detail page.
platformstring | nullOne of amazon, tiktok_shop, etsy, generic. null when not a product page.
productobject | nullThe extracted product record. null when not a product page or when extraction failed (e.g. bot protection).
product.namestringProduct name.
product.descriptionstringProduct description.
product.pricenumber | nullNumeric price for the listed currency. null when no price is shown.
product.currencystring | nullISO currency code (e.g. USD, EUR).
product.billing_frequencystring | nullOne of monthly, yearly, one_time, usage_based.
product.pricing_modelstring | nullOne of per_seat, flat, tiered, freemium, custom.
product.urlstring | nullCanonical product page URL.
product.categorystring | nullSingle category label.
product.featuresstring[]Bulleted feature claims, one sentence each.
product.target_audiencestring[]Audience tags (e.g. Men, Small teams).
product.tagsstring[]Free-form tags.
product.image_urlstring | nullPrimary image URL (CDN-hosted).
product.imagesstring[]Up to 7 product image URLs (CDN-hosted).
product.skustring | nullStock keeping unit. null for SaaS, services, and other non-inventoried offerings.

Handle errors

A non-2xx response returns an { message, error_code } envelope:
Statuserror_codeMeaningWhat to do
400INPUT_VALIDATION_ERRORMissing or malformed urlValidate input before the call.
401UNAUTHORIZEDAPI key missing, invalid, or deletedRe-check the env var and the dashboard.
408REQUEST_TIMEOUTPage didn’t finish extracting before timeoutMS (or 5 min default)Retry once with backoff.
500INTERNAL_ERRORTransient server errorRetry once with backoff; if it persists, contact support.
A 400 from omitting url:
{
  "error_code": "INPUT_VALIDATION_ERROR",
  "message": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "undefined",
      "path": ["url"],
      "message": "Required"
    }
  ]
}
For the full catalog of error codes, see Troubleshooting.

Use cases

  • Build a printable product catalog: Use a website’s sitemap to find all products, run extract_product on each page
  • Procurement / ERP auto-fill: when a buyer pastes a product URL into a procurement form, populate sku, name, description, currency, price and features automatically.

Next steps

Prefetch for Faster Response

Hide cold-hit latency from your users.

Handle Rate Limits

Backoff strategies, client cache, and prefetch fallbacks.

Best Practices

Caching, error handling, and key hygiene.

Troubleshooting

Status codes, retry patterns, and common errors.