SurfSense/surfsense_web/content/docs/connectors/native/amazon.mdx

68 lines
3.5 KiB
Text
Raw Normal View History

---
title: Amazon
description: Scrape public Amazon product data as structured JSON
---
The Amazon scraper returns public product data as structured JSON: price and list price, rating and review breakdown, availability, marketplace offers, sellers, best-seller ranks, product variants, and on-page reviews. It only uses public, anonymous data — no login or seller account. Give it search terms or Amazon product, search, category, or best-seller URLs.
Marketplace support is inferred from the Amazon URL or `domain` you provide. Supported public marketplaces include US (`amazon.com`), UK (`amazon.co.uk`), Germany (`amazon.de`), Italy (`amazon.it`), and Spain (`amazon.es`). France (`amazon.fr`) is supported in the scraper but remains best-effort because Amazon France is more sensitive to proxy-pool WAF challenges.
## Endpoint
```bash
POST /api/v1/workspaces/{workspace_id}/scrapers/amazon/scrape
```
## Inputs
| Field | Default | Description |
|-------|---------|-------------|
| `urls` | — | Amazon product, search, category, best-seller, or short (`a.co` / `amzn.to`) URLs. Marketplace is inferred from the URL, e.g. `amazon.co.uk`, `amazon.de`, `amazon.it`, or `amazon.es`. Provide `urls` or `search_terms` |
| `search_terms` | — | Search phrases run on the selected `domain`, e.g. `wireless earbuds`. Provide `search_terms` or `urls` |
| `max_items` | `10` | Max products per search term or category/best-seller URL (1100) |
| `domain` | `www.amazon.com` | Amazon marketplace domain for `search_terms`, e.g. `www.amazon.co.uk`, `www.amazon.de`, `www.amazon.it`, or `www.amazon.es`. `www.amazon.fr` is best-effort due to Amazon WAF sensitivity |
| `include_details` | `true` | Fetch full product detail pages; `false` returns faster card-only results |
| `max_offers` | `0` | Extra marketplace offers per product (0100); `0` = featured offer only |
| `include_sellers` | `false` | Enrich the product and each offer with the seller's public profile |
| `max_variants` | `0` | Product variants to return as separate results (0100) |
| `include_variant_prices` | `false` | Attach per-variant prices (one extra request per variant) |
| `country_code` | — | Two-letter delivery country for localized pricing, e.g. `us` |
| `zip_code` | — | Delivery ZIP/postal code for localized availability, e.g. `10001` |
| `language` | — | Content language for the domain, e.g. `en` |
At least one of `urls` or `search_terms` is required, with up to 20 combined sources per call.
## Example
```bash
curl -X POST "$BASE_URL/api/v1/workspaces/1/scrapers/amazon/scrape" \
-H "Authorization: Bearer $SURFSENSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search_terms": ["mechanical keyboard"],
"max_items": 5,
"max_offers": 3
}'
```
## Marketplace examples
```json
{
"urls": [
"https://www.amazon.co.uk/s?k=usb+c+cable",
"https://www.amazon.de/s?k=mechanische+tastatur",
"https://www.amazon.it/s?k=cavo+usb+c",
"https://www.amazon.es/s?k=cable+usb+c"
],
"max_items": 5,
"include_details": false
}
```
For `search_terms`, set `domain` to the marketplace you want to search. For direct URLs, the scraper infers the marketplace from each URL.
The response is `{ "items": [...] }` — one item per product, plus structured error items for any input that could not be resolved. Billing is per returned product; error items are never billed.
For the full input and output JSON schemas and generated code snippets in your language, open **API Playground → Amazon → Scrape** in your workspace.