Documentation
Everything you need to make your first call.
Quick start
New accounts get 15 free credits — enough to validate the whole flow. Create a key in the console, then swap out the sk_live_… placeholder below.
- 1Create an account and sign in to the console
- 2Create an API key under “API keys” (shown only once)
- 3Make your first call with the sample below
curl --location 'https://api.xdatafly.com/v1/amazon/reviews?asin=B0DXK317FN&page_count=1&sort=recent&star=all_stars&site=amz_us' \
--header 'Accept: application/json' \
--max-time 120 \
--header 'secret-key: sk_live_xxxxxxxxxxxxxxxx'Authentication
Send your key in the secret-key header. Keys look like sk_live_… and are shown only once when created.
secret-key: sk_live_xxxxxxxxxxxxxxxxhttps://api.xdatafly.comEndpoints
| Endpoint | Price | |
|---|---|---|
| GET /v1/amazon/reviews Amazon Reviews API | 1/ per page | Details → |
| GET /v1/google/search Google Search APIComing soon | 2/ per call | Coming soon |
curl --location 'https://api.xdatafly.com/v1/amazon/reviews?asin=B0DXK317FN&page_count=1&sort=recent&star=all_stars&site=amz_us' \
--header 'Accept: application/json' \
--max-time 120 \
--header 'secret-key: sk_live_xxxxxxxxxxxxxxxx'Advanced operators such as site:, inurl:, intitle: and filetype: return 40003. Those queries are significantly more expensive, so we keep them closed for now.
Response envelope
Every response — success or failure — uses the same envelope.
{
"code": 0,
"message": "ok",
"request_id": "req_7f3a9c21",
"data": {},
"usage": {
"credits": 1,
"balance": 999
},
"duration_ms": 2140
}code— business code, 0 means successusage.credits— credits actually charged (0 on failure)usage.balance— available balance after settlement
Billing rules
Only calls that return status SUCCESS are charged. The response envelope always reports the credits used and your remaining balance, so you can reconcile spend without guessing.
Latency & timeouts
Amazon reviews are scraped from Amazon in real time; a single page typically takes 5–40 seconds and can be slower at peak. Set your client timeout to ≥60 seconds (curl --max-time, Python timeout). The common 30-second default will time out spuriously; note that timeouts and upstream failures release the reserved credits — they are not charged.
Error codes
| Code | HTTP | Meaning | Charged |
|---|---|---|---|
| 0 | 200 | Success | Yes |
| 40001 | 400 | Missing or malformed parameter | No |
| 40002 | 400 | Parameter out of range (num 1-20, page_count 1-10) | No |
| 40003 | 400 | Query contains a forbidden operator such as site: / inurl: / filetype: | No |
| 40100 | 401 | Missing or invalid secret-key | No |
| 40101 | 401 | API key disabled or expired | No |
| 40301 | 403 | Endpoint not available yet | No |
| 40201 | 402 | Available credits cannot cover the reservation | No |
| 42900 | 429 | Per-minute request limit exceeded | No |
| 50001 | 502 | Upstream unavailable; credits released | No |
| 50002 | 500 | Upstream response unparsable; credits released | No |
| 50000 | 500 | Internal server error | No |
Rate limits
Each key has a per-minute request limit (default 60). Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Exceeding the limit returns HTTP 429 with a Retry-After header.
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetRetry-AfterIdempotency
Send your own X-Request-Id header. Repeating the same id within 24 hours returns the cached response instead of charging again.
Ready to integrate?
15 free credits on signup, no card required.