# Amazon 商品库存件数 API (amazon.product_stock)

- Canonical page: [https://everyinfra.com/amazon-api/product_stock](https://everyinfra.com/amazon-api/product_stock?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "amazon", "action": "product_stock", "params": {...}}
- Price: $0.005597 per call ($5.6 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=amazon&action=product_stock

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Amazon 商品链接，14 个站都收：amazon.com、amazon.ca、amazon.com.mx、amazon.com.br、amazon.in、amazon.co.jp、amazon.com.au、amazon.de、amazon.es、amazon.co.uk、amazon.fr、amazon.it、amazon.nl、amazon.ae（带不带 www. 都行）；也可以只传 10 位 ASIN，站点由 domain 定。新加坡站（amazon.sg）还没开，这类输入扣费前回 422。 |
| domain | not declared | no | not declared | 只传 ASIN 时用哪个站，写法同 url 里列的 14 个站，默认 amazon.com。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| asin | Amazon 标准识别号，站内唯一商品标识。 |
| stock_count | 这个商品购物车默认卖家（Buy Box）还剩的确切件数（product_stock）；没货时是 0；只知道下限时是 null，这时看 stock_at_least；商品页没有「加入购物车」按钮时也是 null。 |
| stock_at_least | 只知道下限时给的剩余件数下限（product_stock），这时 stock_count 是 null。两种情况：卖家设了每人限购，或库存不少于 999。 |
| is_purchase_limited | 卖家有没有设每人限购（product_stock）。 |
| purchase_limit | 每位顾客最多买几件（product_stock）；限购时才有。 |
| region | 站点代码，大写（如 GB）；美国站不带这个字段，search、profile 的结果里也可能没有（product_stock、search、profile）。 |
| collected_at | 这条数据的抓取时刻（ISO 8601，UTC）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "amazon",
  "action": "product_stock",
  "params": {
    "url": "https://www.amazon.com/dp/B0HDB173YV"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "amazon",
        "action": "product_stock",
        "params": {
            "url": "https://www.amazon.com/dp/B0HDB173YV",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "amazon",
  "action": "product_stock",
  "results": {
    "asin": …,
    "stock_count": …,
    "stock_at_least": …,
    "is_purchase_limited": …,
    "purchase_limit": …,
    "region": …,
    "collected_at": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=amazon
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
