All endpoints require an API key passed in the X-API-KEY header.
Check the remaining credits for the authenticated user.
X-API-KEY: your_api_key
curl -X GET "https://amzapi.tagxdata.com/credits" -H "x-api-key: your_api_key_here"
import requests
url = "https://amzapi.tagxdata.com/credits"
headers = {
"x-api-key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
credits = response.json()
print(f"Credits: {credits['credits']}")
{
"credits": 10
}
Submit an Amazon URL to be scraped for reviews.
X-API-KEY: your_api_key Content-Type: application/json
{
"url": "httpss://example.com/dp/B123456789", // Required: example product URL
"all_reviews": true, // Optional: true (all star ratings) or false (mixed), default: true
"reviewer_type": "all_reviews", // Optional: "all_reviews" or "avp_only_reviews" (verified only), default: "all_reviews"
"sort_by": "recent", // Optional: "recent" or "" (top reviews), default: "recent"
"pages": 3 // Optional: Number of pages to scrape (1-9), overrides all_reviews
}
pages is specified (1-9), it automatically sets all_reviews to false and limits scraping to the specified number of pages.
curl -X POST "https://amzapi.tagxdata.com/scrape" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "www.example.com"
}'
curl -X POST "https://amzapi.tagxdata.com/scrape" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "www.example.com",
"all_reviews": false,
"reviewer_type": "avp_only_reviews",
"sort_by": ""
}'
curl -X POST "https://amzapi.tagxdata.com/scrape" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "www.example.com",
"all_reviews": true,
"reviewer_type": "avp_only_reviews",
"sort_by": "recent"
}'
curl -X POST "https://amzapi.tagxdata.com/scrape" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "www.example.com",
"pages": 3,
"reviewer_type": "all_reviews",
"sort_by": "recent"
}'
Note: This will scrape exactly 3 pages of reviews
import requests
# Basic request (default parameters)
url = "https://amzapi.tagxdata.com/scrape"
headers = {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json"
}
data = {
"url": "www.example.com"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(f"Request ID: {result['request_id']}")
# Advanced request with custom parameters
data_advanced = {
"url": "www.example.com",
"all_reviews": False,
"reviewer_type": "avp_only_reviews", # Verified purchases only
"sort_by": "" # Top reviews instead of recent
}
response = requests.post(url, headers=headers, json=data_advanced)
result = response.json()
print(f"Advanced Request ID: {result['request_id']}")
# Pages-based request
data_pages = {
"url": "www.example.com",
"pages": 5, # Will scrape exactly 5 pages
"reviewer_type": "all_reviews",
"sort_by": "recent"
}
response = requests.post(url, headers=headers, json=data_pages)
result = response.json()
print(f"Pages Request ID: {result['request_id']}")
{
"message": "Request accepted",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
Retrieve the result of a scrape request.
X-API-KEY: your_api_key
curl -X GET "https://amzapi.tagxdata.com/result/550e8400-e29b-41d4-a716-446655440000" -H "x-api-key: your_api_key_here"
import requests
request_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://amzapi.tagxdata.com/result/{request_id}"
headers = {
"x-api-key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
content = response.json()
print(f"Content: {content}")
{
"content": "<html>...</html>"
}
The API uses standard https response codes and includes error messages in the response body:
{
"detail": "Error message description"
}
Common Error Codes:
200 - OK (successful request with data) 202 - Accepted (request is still being processed, try again later) 400 - Bad Request (invalid parameters, e.g., pages must be between 1-9) 401 - Unauthorized (invalid API key) 402 - Payment Required (not enough credits) 403 - Forbidden (request failed during processing, credits have been refunded) 404 - Not Found (request not found) 500 - Internal Server Error (unexpected error occurred)