> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapebadger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask Amazon Rufus

> Ask Alexa for Shopping (Rufus) and get the complete answer and recommended product cards as structured JSON, with optional ASIN product context.

Ask a shopping question and receive the real Rufus answer after its streamed response finishes. `GET` accepts query parameters; `POST` accepts the same fields in a JSON body.

**Credits:** 50 per successful answer

> [!WARNING]
>
> Allow up to **100 seconds**. Empty answers, `softlanding_error`, truncated streams, authentication failures, and upstream errors return non-2xx responses and are not billed.

## Authorization

**X-API-Key** `string` *required*

Your ScrapeBadger API key.

## Parameters

**prompt** `string` *required*

The shopping question to ask. Maximum **4,000 characters**. Include all context needed because every request starts an independent conversation.

**asin** `string`

Optional 10-character product ASIN, matching `^[A-Z0-9]{10}$`. Rufus opens that product page before answering, making the question product-aware.

## Response

**answer** `string`

The complete answer text after all JSON Patch events have been applied.

**products** `RufusProduct[]`

Ordered product recommendations. Empty when the answer contains no product cards.

**thread\_id** `string | null`

Amazon's server-side conversation identifier, returned for tracing. Not a multi-turn input.

**model** `string`

Always `rufus`.

**domain** `string`

Always `com`.

**asin** `string | null`

The product context you supplied, or `null` for a general shopping question.

**stream\_terminated** `boolean`

Whether Amazon closed the response stream cleanly.

**elapsed\_ms** `integer`

End-to-end request time in milliseconds.

**RufusProduct**

**asin** `string`

Product ASIN.

**title** `string | null`

Product title or image alt text.

**url** `string`

Canonical `https://www.amazon.com/dp/{asin}` URL.

**price** `string | null`

Displayed price, including currency symbol.

**rating** `number | null`

Rating out of five.

**rating\_count** `integer | null`

Number of ratings.

**badge** `string | null`

Merchandising badge, such as `Best Seller` or `Amazon's Choice`.

**image\_url** `string | null`

Product image URL.

**rank** `integer`

One-based position in the answer.

## Example

```bash cURL theme={null}
curl "https://scrapebadger.com/v1/rufus/ask?asin=B09M7WWTFP&prompt=What%20are%20the%20main%20tradeoffs%20of%20this%20product%3F" \
  -H "X-API-Key: YOUR_API_KEY" \
  --max-time 100
```

```javascript Node.js theme={null}
const res = await fetch("https://scrapebadger.com/v1/rufus/ask", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.SCRAPEBADGER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "What are the main tradeoffs of this product?",
    asin: "B09M7WWTFP",
  }),
  signal: AbortSignal.timeout(100_000),
});
const data = await res.json();
console.log(data.answer);
console.log(data.products);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://scrapebadger.com/v1/rufus/ask",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={
        "prompt": "What are the main tradeoffs of this product?",
        "asin": "B09M7WWTFP",
    },
    timeout=100,
)
data = res.json()
print(data["answer"])
print(data["products"])
```

```json Response theme={null}
{
  "answer": "The main tradeoffs are reliability and subscription cost...",
  "products": [
    {
      "asin": "B09M7WWTFP",
      "title": "Example product",
      "url": "https://www.amazon.com/dp/B09M7WWTFP",
      "price": "$39.99",
      "rating": 4.7,
      "rating_count": 8769,
      "badge": "Best Seller",
      "image_url": "https://example.com/product.jpg",
      "rank": 1
    }
  ],
  "thread_id": "thread-abc123",
  "model": "rufus",
  "domain": "com",
  "asin": "B09M7WWTFP",
  "stream_terminated": true,
  "elapsed_ms": 14362
}
```

## Errors

Errors use `{"detail":{"code":"...","message":"..."}}`.

| Code | HTTP | Meaning |
| - | - | - |
| `pool_disabled`, `pool_exhausted` | 503 | No authenticated account is currently available. Retry later. |
| `authentication_required` | 503 | Amazon requested fresh authentication and the affected session was rotated. |
| `blocked` | 422 | Amazon served an anti-bot page. Not billed. |
| `answer_timeout`, `stream_truncated`, `softlanding_error` | 502 | The response did not complete successfully. Not billed. |
| `empty_answer` | 502 | The stream ended without usable answer text. Not billed. |
| `composer_not_found`, `new_chat_unavailable`, `upstream_error` | 502 | The upstream page or answer failed. Not billed. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.