Loading...
Loading...
Retrieve Amazon product data including pricing, reviews, sales estimates, stock levels, search results, deals, best sellers, and more via the Canopy API REST endpoints using Python.
npx skill4agent add canopy-api/skills amazon-dataexport API_KEY="your_api_key_here"https://rest.canopyapi.coAPI-KEYimport os
import requests
API_KEY = os.environ["API_KEY"]
BASE_URL = "https://rest.canopyapi.co"
HEADERS = {"API-KEY": API_KEY}response = requests.get(f"{BASE_URL}/api/amazon/product", headers=HEADERS, params={
"asin": "B01HY0JA3G", # or use "url" or "gtin"
"domain": "US", # optional, defaults to "US"
})response = requests.get(f"{BASE_URL}/api/amazon/product/gtin-from-asin", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"domain": "US", # optional
})response = requests.get(f"{BASE_URL}/api/amazon/product/asin-from-gtin", headers=HEADERS, params={
"gtin": "9780141036144",
"domain": "US", # optional
})response = requests.get(f"{BASE_URL}/api/amazon/product/variants", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})response = requests.get(f"{BASE_URL}/api/amazon/product/stock", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})response = requests.get(f"{BASE_URL}/api/amazon/product/sales", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})response = requests.get(f"{BASE_URL}/api/amazon/product/reviews", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"page": 1, # optional
"onlyVerifiedReviews": True, # optional
"rating": "5", # optional, filter by star rating
"search": "battery life", # optional, filter by search term
})response = requests.get(f"{BASE_URL}/api/amazon/product/offers", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"page": 1, # optional
})response = requests.get(f"{BASE_URL}/api/amazon/search", headers=HEADERS, params={
"searchTerm": "wireless headphones",
"domain": "US", # optional
"categoryId": "172282", # optional, filter to a category
"page": 1, # optional
"limit": 20, # optional, 20-40
"minPrice": 10, # optional
"maxPrice": 100, # optional
"conditions": "NEW", # optional: NEW, USED, RENEWED (comma-separated)
"sort": "FEATURED", # optional: FEATURED, MOST_RECENT, PRICE_ASCENDING, PRICE_DESCENDING, AVERAGE_CUSTOMER_REVIEW
})response = requests.get(f"{BASE_URL}/api/amazon/autocomplete", headers=HEADERS, params={
"searchTerm": "wireless",
"domain": "US", # optional
"category": "aps", # optional, Amazon autocomplete_alias (e.g. "electronics")
})response = requests.get(f"{BASE_URL}/api/amazon/categories", headers=HEADERS, params={
"domain": "US", # optional
})response = requests.get(f"{BASE_URL}/api/amazon/category", headers=HEADERS, params={
"categoryId": "1234567890",
"domain": "US", # optional
"page": 1, # optional
"sort": "FEATURED", # optional
})response = requests.get(f"{BASE_URL}/api/amazon/seller", headers=HEADERS, params={
"sellerId": "A2R2RITDJNW1Q6",
"domain": "US", # optional
"page": 1, # optional
})response = requests.get(f"{BASE_URL}/api/amazon/author", headers=HEADERS, params={
"asin": "B000AQ5RM0",
"domain": "US", # optional
"page": 1, # optional
})response = requests.get(f"{BASE_URL}/api/amazon/deals", headers=HEADERS, params={
"domain": "US", # optional
"page": 1, # optional
"limit": 20, # optional
"categoryIds": "3760911,172282", # optional, comma-separated category IDs
})response = requests.get(f"{BASE_URL}/api/amazon/bestsellers", headers=HEADERS, params={
"categoryId": "bestsellers_amazon_devices", # required if url not provided
# "url": "https://www.amazon.com/Best-Sellers/zgbs", # required if categoryId not provided
"domain": "US", # optional
"page": 1, # optional
"limit": 50, # optional, typically 20-50 per page
})response = requests.get(f"{BASE_URL}/api/amazon/bestseller-categories", headers=HEADERS, params={
"domain": "US", # optional
})bestsellers_amazon_devices/api/amazon/bestsellers| Parameter | Description | Example |
|---|---|---|
| Amazon product ASIN | |
| Full Amazon product URL | |
| ISBN, UPC, or EAN code | |
| Status | Meaning |
|---|---|
| 400 | Invalid parameters |
| 401 | Invalid or missing API key |
| 402 | Payment required |
| 500 | Server error |
response = requests.get(f"{BASE_URL}/api/amazon/product", headers=HEADERS, params={"asin": "B01HY0JA3G"})
if response.ok:
data = response.json()
else:
print(f"Error {response.status_code}: {response.text}")