POST

API health

24h health
Normal
  • Healthy / normal
  • Available
Normal

Last 24 hours

Last 30 days

Read how many units the default seller of the cart (the Buy Box seller) has left for one Amazon product, from a product link on any of 14 Amazon stores (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) or an ASIN with domain. One object per call: stock_count is the exact number, 0 when sold out; when only a lower bound is known stock_at_least gives it and stock_count is null, because the seller sets a per-customer purchase limit (is_purchase_limited, purchase_limit) or the stock is at least 999. Only the Buy Box seller is counted, not other sellers. amazon.sg is not open yet and is rejected before you are charged. When this read cannot be made the call returns 503, is not charged, and can be retried.

Send POST https://api.everyinfra.com/api/v1/social with platform set to amazon and action set to product_stock. Price $5.6 per 1,000 requests ($0.005597 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.

AI prompt

#
Please help me write a data collection script with the EveryInfra Amazon Product stock endpoint (amazon/product_stock).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to amazon and action to product_stock, and put the parameters inside params.
- Required parameters:
  - url: A product link from any of 14 Amazon stores (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.
- Optional parameters:
  - domain: The Amazon store to use when url is only an ASIN, written as in url, such as amazon.co.uk. Defaults to amazon.com.
- Returns one object. Main fields: asin (Amazon Standard Identification Number,…), stock_count (Exact number of units left with the def…), stock_at_least (Lower bound on the units left, given on…), is_purchase_limited (Whether the seller sets a per-customer…), purchase_limit (The most units one customer can buy (pr…), region (Store code in capitals, such as GB), collected_at (Time this record was collected (ISO 860…).
- Example request body:
{
  "platform": "amazon",
  "action": "product_stock",
  "params": {
    "url": "https://www.amazon.com/dp/B0HDB173YV"
  }
}
- Price: $5.6 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesamazonPlatform identifier, fixed value.
actionbodystringYesproduct_stockCapability identifier, fixed value.
urlbody.paramsstringYes-A product link from any of 14 Amazon stores (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. is optional), or a 10-character ASIN on its own, in which case domain picks the store. A link from amazon.sg, which is not open yet, is rejected with 422 before you are charged.
domainbody.paramsstringNo-The Amazon store to use when url is only an ASIN, written as in url, such as amazon.co.uk. Defaults to amazon.com.

Code samples

#
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"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "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": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.

FieldMeaning
asinAmazon Standard Identification Number, the product's unique ID within a store.
stock_countExact number of units left with the default seller of the cart, the Buy Box seller (product_stock); 0 when sold out. null when only a lower bound is known (see stock_at_least), and also when the product page has no Add to Cart button.
stock_at_leastLower bound on the units left, given only when the exact number is not known (product_stock); stock_count is null then. Either the seller sets a per-customer purchase limit, or the stock is at least 999.
is_purchase_limitedWhether the seller sets a per-customer purchase limit (product_stock).
purchase_limitThe most units one customer can buy (product_stock); present when the purchase is limited.
regionStore code in capitals, such as GB; the US store does not carry it, and search and profile results may also leave it out (product_stock, search, profile).
collected_atTime this record was collected (ISO 8601, UTC).
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

Google Analytics needs consent. Privacy