[Amazon APIs](/docs/api.md#amazon) 

# Amazon Deals API

Fetch public deals, or search for products with active deal badges. Query pages can be empty after filtering; continue while next_cursor is present. No Amazon sign-in required. Prices and availability reflect the marketplace and delivery location; unavailable fields are null.

 POST `/v1/amazon/deals`

[Parameters](#parameters) [Response](#response) [Errors](#errors) [More examples](#more-examples) 

**Authenticate every request**

Send `Authorization: Bearer YOUR_API_KEY`. [Get an API key →](/docs/guides/authentication.md) 

## Parameters

Send these fields in a flat JSON body. Add `_run` to choose execution options.

- **`query` string Optional**
  Search text. Minimum length: 1. Maximum length: 500.

- **`limit` integer Optional**
  Maximum results in this response. Default: 25. Minimum: 1. Maximum: 100.

- **`brand` string Optional**
  Single brand name. Minimum length: 1. Maximum length: 100. Pattern: ^[^:,]+$.

- **`category` string Optional**
  Department such as electronics, kitchen, books, beauty or pet supplies. Unsupported departments fail explicitly. Minimum length: 1. Maximum length: 100.

- **`cursor` string Optional**
  next_cursor from a prior response using the same filters and marketplace. Maximum length: 131072.

- **`marketplace` string Optional**
  Amazon marketplace. Defaults to the product URL's marketplace, or amazon.com. Allowed: "amazon.com", "amazon.co.uk", "amazon.ca", "amazon.de", "amazon.fr", "amazon.it", "amazon.es", "amazon.co.jp", "amazon.in", "amazon.com.au".

- **`max_price` number Optional**
  Maximum item price in the marketplace currency. Minimum: 0.

- **`min_price` number Optional**
  Minimum item price in the marketplace currency. Minimum: 0.

- **`min_rating` integer Optional**
  Minimum product star rating. Allowed: 1, 2, 3, 4.

- **`page` integer Optional**
  Starting upstream page. Prefer cursor to retain unused results and avoid duplicates. Minimum: 1. Maximum: 1000.

- **`postal_code` string Optional**
  Delivery postal code. The request fails if Amazon cannot apply it; responses include the displayed delivery location. Minimum length: 2. Maximum length: 16. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9 -]+$.

- **`sort` string Optional**
  Sort order. Choose an allowed value below. Default: "relevance". Allowed: "relevance", "price_asc", "price_desc", "rating", "newest".

### Advanced & compatibility inputs 1

- **`category_id` string Optional**
  Amazon browse node ID for a more specific category. Pattern: ^[0-9]{1,20}$.

## Response

Every response describes a run. Read `result` once `run_status` is `succeeded`.

- **`run_id`**
  The run to track. Keep it when contacting support.

- **`run_status`**
  Queued, running, waiting for sign-in, succeeded, or failed. Check this even after an HTTP 200.

- **`status_url`**
  Poll this URL while the run is pending. Keep the same run instead of starting another request.

- **`result`**
  The endpoint’s returned data. The example is illustrative; actual fields may be empty or unavailable.

- **`error`**
  On failure, inspect its code, message, retryable and action fields.

### View the complete output schema

```json
{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "required": [
    "success",
    "source",
    "query",
    "url",
    "results",
    "count",
    "data",
    "max_results_requested",
    "pagination"
  ],
  "properties": {
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "data": {
      "type": "object",
      "required": [
        "marketplace",
        "delivery_location"
      ],
      "properties": {
        "notice": {
          "type": "string"
        },
        "marketplace": {
          "enum": [
            "amazon.com",
            "amazon.co.uk",
            "amazon.ca",
            "amazon.de",
            "amazon.fr",
            "amazon.it",
            "amazon.es",
            "amazon.co.jp",
            "amazon.in",
            "amazon.com.au"
          ],
          "type": "string"
        },
        "delivery_location": {
          "type": "object",
          "required": [
            "postal_code",
            "applied",
            "displayed"
          ],
          "properties": {
            "applied": {
              "type": "boolean"
            },
            "displayed": {
              "type": [
                "string",
                "null"
              ]
            },
            "postal_code": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "query": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "const": "amazon-deals"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "asin",
          "title",
          "url",
          "price",
          "price_amount",
          "price_currency",
          "list_price",
          "rating",
          "image_url",
          "deal_badge",
          "rank",
          "sales_rank",
          "previous_sales_rank",
          "rank_change_percent",
          "is_sponsored",
          "name",
          "link",
          "images",
          "tags",
          "numberOfReviews"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "asin": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rank": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "price": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rating": {
            "type": [
              "number",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "deal_badge": {
            "type": [
              "string",
              "null"
            ]
          },
          "list_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "sales_rank": {
            "type": [
              "integer",
              "null"
            ]
          },
          "is_sponsored": {
            "type": "boolean"
          },
          "price_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal amount in the marketplace currency, without grouping separators; null when unavailable."
          },
          "price_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "numberOfReviews": {
            "type": [
              "integer",
              "null"
            ]
          },
          "previous_sales_rank": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rank_change_percent": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "success": {
      "const": true
    },
    "pagination": {
      "type": "object",
      "required": [
        "cursor",
        "next_cursor",
        "has_next_page",
        "count",
        "strategy"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "strategy": {
          "enum": [
            "none",
            "cursor"
          ],
          "type": "string"
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "has_next_page": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "max_results_requested": {
      "type": "integer",
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

### View a polled run response

```json
{
  "run_id": "00000000-0000-4000-8000-000000000001",
  "task_key": "amazon-deals",
  "task_name": "Amazon Deals API",
  "run_status": "succeeded",
  "status_url": "/v1/runs/00000000-0000-4000-8000-000000000001",
  "result": {
    "url": "https://example.com/item-1",
    "data": {
      "notice": "sample",
      "marketplace": "amazon.com",
      "delivery_location": {
        "applied": true,
        "displayed": "sample",
        "postal_code": "sample"
      }
    },
    "count": 1,
    "query": "London",
    "source": "amazon-deals",
    "results": [
      {
        "id": "id-1",
        "url": "https://example.com/item-1",
        "asin": "sample",
        "link": "https://example.com/item-1",
        "name": "Stylish Shoreditch Loft with Balcony",
        "rank": 1,
        "tags": [
          "Featured"
        ],
        "price": "180",
        "title": "Stylish Shoreditch Loft with Balcony",
        "images": [
          "https://images.example.com/images-1.jpg"
        ],
        "rating": 4.91,
        "image_url": "https://example.com/item-1",
        "deal_badge": "sample",
        "list_price": "180",
        "sales_rank": 1,
        "is_sponsored": true,
        "price_amount": "180",
        "price_currency": "GBP",
        "numberOfReviews": 1,
        "previous_sales_rank": 1,
        "rank_change_percent": 1.5
      }
    ],
    "success": true,
    "pagination": {
      "count": 1,
      "cursor": "cursor-page-1",
      "strategy": "none",
      "next_cursor": "cursor-page-1",
      "has_next_page": true
    },
    "max_results_requested": 1
  },
  "error": null
}
```

## Errors & retries

- `400` Fix the fields listed in `errors` before retrying.

- `428` Connect the requested website account using the returned sign-in link.

- `429` Wait for the duration in `Retry-After`.

- `5xx` Retry transient failures with backoff. Keep the request ID.

A failed run has its own error inside the response. Retry it only when `error.retryable` is true.

[Validation, pagination and recovery →](/docs/api/request-guide.md) 

## More examples

### Async request with polling

```bash
RUN=$(curl -s -X POST "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}')

RUN_ID=$(echo "$RUN" | jq -er '.run_id // empty') || { echo "$RUN" >&2; exit 1; }
POLL_DELAY=3

while true; do
  RESULT=$(curl -s -H "Authorization: Bearer YOUR_API_KEY" "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/runs/$RUN_ID")
  STATUS=$(echo "$RESULT" | jq -r '.run_status')
  if [[ "$STATUS" =~ ^(succeeded|failed|errored|cancelled|canceled|expired)$ ]]; then
    echo "$RESULT"
    break
  fi
  sleep "$(awk "BEGIN { print $POLL_DELAY * (0.9 + ($RANDOM % 21) / 100) }")"
  POLL_DELAY=$((POLL_DELAY < 30 ? POLL_DELAY * 2 : 30))
  [ "$POLL_DELAY" -gt 30 ] && POLL_DELAY=30
done
```

```javascript
const runResponse = await fetch("https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});

const runPayload = await runResponse.json();
if (!runResponse.ok) throw new Error(JSON.stringify(runPayload));
const runId = runPayload.run_id;
if (!runId) throw new Error("Run ID not found in response");
let pollDelayMs = 3000;

while (true) {
  const resultResponse = await fetch("https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/runs/" + runId, {
    headers: { Authorization: "Bearer YOUR_API_KEY" },
  });
  const result = await resultResponse.json().catch(() => ({}));
  if (resultResponse.status === 429 || [502, 503, 504].includes(resultResponse.status)) {
    const retryAfter = resultResponse.headers.get("retry-after");
    await new Promise((resolve) => setTimeout(resolve, retryAfter ? Number(retryAfter) * 1000 : pollDelayMs));
    continue;
  }
  if (!resultResponse.ok) throw new Error(`Status request failed: ${resultResponse.status}`);
  const status = result.run_status;
  if (["succeeded", "failed", "errored", "cancelled", "canceled", "expired"].includes(status)) {
    console.log(result);
    break;
  }
  await new Promise((resolve) => setTimeout(resolve, pollDelayMs * (0.9 + Math.random() * 0.2)));
  pollDelayMs = Math.min(pollDelayMs * 2, 30000);
}
```

```python
import random
import time
import requests

run_response = requests.post(
    "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={},
)
run_payload = run_response.json()
if not run_response.ok:
    raise RuntimeError(run_payload)
run_id = run_payload.get("run_id")
if not run_id:
    raise ValueError("Run ID not found in response")
poll_delay = 3.0

while True:
    result_response = requests.get(
        "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/runs/" + run_id,
        headers={"Authorization": "Bearer YOUR_API_KEY"},
    )
    if result_response.status_code == 429 or result_response.status_code in (502, 503, 504):
        retry_after = result_response.headers.get("Retry-After")
        time.sleep(float(retry_after) if retry_after else poll_delay)
        continue
    result_response.raise_for_status()
    result = result_response.json()
    status = result.get("run_status")
    if status in ("succeeded", "failed", "errored", "cancelled", "canceled", "expired"):
        print(result)
        break
    time.sleep(poll_delay * random.uniform(0.9, 1.1))
    poll_delay = min(poll_delay * 2, 30.0)
```

### Wait-for-results request

```bash
curl -X POST "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"_run":{"async":false}}'
```

```javascript
const response = await fetch("https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "_run": {
    "async": false
  }
}),
});

const result = await response.json();
console.log(result);
```

```python
import requests

response = requests.post(
    "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
    "_run": {
        "async": False
    }
},
)
result = response.json()
print(result)
```

### Canonical & compatibility routes

You can also send the same JSON body to `/v1/tasks/amazon-deals/runs`.

 Example request  Request mode Wait for resultsAsync + polling

```bash
curl -X POST "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"_run":{"async":false}}'
```

```javascript
const response = await fetch("https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "_run": {
    "async": false
  }
}),
});

const result = await response.json();
console.log(result);
```

```python
import requests

response = requests.post(
    "https://api-ingress-worker-staging.browsable-staging.workers.dev/v1/amazon/deals",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
    "_run": {
        "async": False
    }
},
)
result = response.json()
print(result)
```

Requests can return before a run finishes. Check run_status and poll status_url when needed.

### View example response

 Example response  Illustrative 

```json
{
  "run_id": "00000000-0000-4000-8000-000000000001",
  "task_key": "amazon-deals",
  "task_name": "Amazon Deals API",
  "run_status": "succeeded",
  "status_url": "/v1/runs/00000000-0000-4000-8000-000000000001",
  "result": {
    "url": "https://example.com/item-1",
    "data": {
      "notice": "sample",
      "marketplace": "amazon.com",
      "delivery_location": {
        "applied": true,
        "displayed": "sample",
        "postal_code": "sample"
      }
    },
    "count": 1,
    "query": "London",
    "source": "amazon-deals",
    "results": [
      {
        "id": "id-1",
        "url": "https://example.com/item-1",
        "asin": "sample",
        "link": "https://example.com/item-1",
        "name": "Stylish Shoreditch Loft with Balcony",
        "rank": 1,
        "tags": [
          "Featured"
        ],
        "price": "180",
        "title": "Stylish Shoreditch Loft with Balcony",
        "images": [
          "https://images.example.com/images-1.jpg"
        ],
        "rating": 4.91,
        "image_url": "https://example.com/item-1",
        "deal_badge": "sample",
        "list_price": "180",
        "sales_rank": 1,
        "is_sponsored": true,
        "price_amount": "180",
        "price_currency": "GBP",
        "numberOfReviews": 1,
        "previous_sales_rank": 1,
        "rank_change_percent": 1.5
      }
    ],
    "success": true,
    "pagination": {
      "count": 1,
      "cursor": "cursor-page-1",
      "strategy": "none",
      "next_cursor": "cursor-page-1",
      "has_next_page": true
    },
    "max_results_requested": 1
  },
  "error": null
}
```

[Understand the response →](#response)

---
Source: https://browsable-api-ux-staging.pages.dev/docs/api/endpoints/post-amazon-deals
