amazon-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAmazon Data Skill
亚马逊数据技能
Use this skill to retrieve Amazon product data via the Canopy API REST endpoints using Python.
Canopy API provides real-time access to 350M+ Amazon products across 25K+ categories. With this skill you can fetch:
- Product details — titles, descriptions, pricing, images, feature bullets, and brand info
- Sales and stock estimates — weekly, monthly, and annual unit sales alongside current stock levels
- Reviews — ratings, review text, verified purchase status, and helpful vote counts
- Search — find products by keyword with filters for price, condition, category, and sort order
- Offers — compare pricing and fulfillment details across multiple sellers
- Deals — browse current Amazon deals and discounts across 12 international domains
- Categories — navigate the full Amazon category taxonomy
- Sellers and authors — look up seller profiles, ratings, and author bibliographies
- Best sellers — top-ranked products across Amazon's category taxonomy
- Identifier conversion — translate between ASINs and GTINs (ISBN/UPC/EAN)
使用此技能通过Canopy API REST端点,借助Python获取亚马逊产品数据。
Canopy API可实时访问超过3.5亿个亚马逊产品,覆盖25000+个品类。通过此技能你可以获取:
- 产品详情 — 标题、描述、价格、图片、特性要点及品牌信息
- 销量与库存预估 — 周、月、年度销量预估以及当前库存水平
- 评论 — 评分、评论内容、已验证购买状态及有用投票数
- 搜索 — 通过关键词查找产品,可按价格、品相、品类筛选并排序
- 报价 — 对比多个卖家的价格及配送详情
- 优惠活动 — 浏览12个国际站点的当前亚马逊优惠及折扣
- 品类 — 查看完整的亚马逊品类分类体系
- 卖家与作者 — 查询卖家资料、评分及作者书目
- 畅销品 — 亚马逊品类分类体系中的顶级排名产品
- 标识符转换 — 在ASIN与GTIN(ISBN/UPC/EAN)之间转换
Setup
设置步骤
- Sign up and create an account at canopyapi.co
- Get an API key from your dashboard
- Set the API key in your environment:
bash
export API_KEY="your_api_key_here"- 在canopyapi.co注册并创建账户
- 从你的控制台获取API密钥
- 在环境变量中设置API密钥:
bash
export API_KEY="your_api_key_here"Base URL
基础URL
https://rest.canopyapi.cohttps://rest.canopyapi.coAuthentication
身份验证
All requests require the header:
API-KEYpython
import os
import requests
API_KEY = os.environ["API_KEY"]
BASE_URL = "https://rest.canopyapi.co"
HEADERS = {"API-KEY": API_KEY}所有请求都需要携带请求头:
API-KEYpython
import os
import requests
API_KEY = os.environ["API_KEY"]
BASE_URL = "https://rest.canopyapi.co"
HEADERS = {"API-KEY": API_KEY}Endpoints
端点
Get Product Information
获取产品信息
python
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"
})Returns product title, brand, price, rating, images, feature bullets, categories, and seller info.
python
response = requests.get(f"{BASE_URL}/api/amazon/product", headers=HEADERS, params={
"asin": "B01HY0JA3G", # 或使用 "url" 或 "gtin"
"domain": "US", # 可选,默认值为 "US"
})返回产品标题、品牌、价格、评分、图片、特性要点、品类及卖家信息。
Convert ASIN to GTIN
将ASIN转换为GTIN
python
response = requests.get(f"{BASE_URL}/api/amazon/product/gtin-from-asin", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"domain": "US", # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/gtin-from-asin", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"domain": "US", # 可选
})Convert GTIN to ASIN
将GTIN转换为ASIN
python
response = requests.get(f"{BASE_URL}/api/amazon/product/asin-from-gtin", headers=HEADERS, params={
"gtin": "9780141036144",
"domain": "US", # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/asin-from-gtin", headers=HEADERS, params={
"gtin": "9780141036144",
"domain": "US", # 可选
})Get Product Variants
获取产品变体
python
response = requests.get(f"{BASE_URL}/api/amazon/product/variants", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/variants", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})Get Stock Estimates
获取库存预估
python
response = requests.get(f"{BASE_URL}/api/amazon/product/stock", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/stock", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})Get Sales Estimates
获取销量预估
python
response = requests.get(f"{BASE_URL}/api/amazon/product/sales", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})Returns weekly, monthly, and annual unit sales estimates.
python
response = requests.get(f"{BASE_URL}/api/amazon/product/sales", headers=HEADERS, params={
"asin": "B01HY0JA3G",
})返回周、月、年度销量预估。
Get Product Reviews
获取产品评论
python
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
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/reviews", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"page": 1, # 可选
"onlyVerifiedReviews": True, # 可选
"rating": "5", # 可选,按星级筛选
"search": "battery life", # 可选,按搜索词筛选
})Get Product Offers
获取产品报价
python
response = requests.get(f"{BASE_URL}/api/amazon/product/offers", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"page": 1, # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/product/offers", headers=HEADERS, params={
"asin": "B01HY0JA3G",
"page": 1, # 可选
})Search Products
搜索产品
python
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
})python
response = requests.get(f"{BASE_URL}/api/amazon/search", headers=HEADERS, params={
"searchTerm": "wireless headphones",
"domain": "US", # 可选
"categoryId": "172282", # 可选,按品类筛选
"page": 1, # 可选
"limit": 20, # 可选,20-40
"minPrice": 10, # 可选
"maxPrice": 100, # 可选
"conditions": "NEW", # 可选:NEW, USED, RENEWED(逗号分隔)
"sort": "FEATURED", # 可选:FEATURED, MOST_RECENT, PRICE_ASCENDING, PRICE_DESCENDING, AVERAGE_CUSTOMER_REVIEW
})Get Autocomplete Suggestions
获取自动补全建议
python
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")
})python
response = requests.get(f"{BASE_URL}/api/amazon/autocomplete", headers=HEADERS, params={
"searchTerm": "wireless",
"domain": "US", # 可选
"category": "aps", # 可选,亚马逊autocomplete_alias(例如 "electronics")
})Get Category Taxonomy
获取品类分类体系
python
response = requests.get(f"{BASE_URL}/api/amazon/categories", headers=HEADERS, params={
"domain": "US", # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/categories", headers=HEADERS, params={
"domain": "US", # 可选
})Get Category Information
获取品类信息
python
response = requests.get(f"{BASE_URL}/api/amazon/category", headers=HEADERS, params={
"categoryId": "1234567890",
"domain": "US", # optional
"page": 1, # optional
"sort": "FEATURED", # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/category", headers=HEADERS, params={
"categoryId": "1234567890",
"domain": "US", # 可选
"page": 1, # 可选
"sort": "FEATURED", # 可选
})Get Seller Information
获取卖家信息
python
response = requests.get(f"{BASE_URL}/api/amazon/seller", headers=HEADERS, params={
"sellerId": "A2R2RITDJNW1Q6",
"domain": "US", # optional
"page": 1, # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/seller", headers=HEADERS, params={
"sellerId": "A2R2RITDJNW1Q6",
"domain": "US", # 可选
"page": 1, # 可选
})Get Author Information
获取作者信息
python
response = requests.get(f"{BASE_URL}/api/amazon/author", headers=HEADERS, params={
"asin": "B000AQ5RM0",
"domain": "US", # optional
"page": 1, # optional
})python
response = requests.get(f"{BASE_URL}/api/amazon/author", headers=HEADERS, params={
"asin": "B000AQ5RM0",
"domain": "US", # 可选
"page": 1, # 可选
})Get Deals
获取优惠活动
python
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
})python
response = requests.get(f"{BASE_URL}/api/amazon/deals", headers=HEADERS, params={
"domain": "US", # 可选
"page": 1, # 可选
"limit": 20, # 可选
"categoryIds": "3760911,172282", # 可选,逗号分隔的品类ID
})Get Best Sellers
获取畅销品
python
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
})Returns ranked products with rank position, ratings, and category navigation info.
python
response = requests.get(f"{BASE_URL}/api/amazon/bestsellers", headers=HEADERS, params={
"categoryId": "bestsellers_amazon_devices", # 若未提供url则必填
# "url": "https://www.amazon.com/Best-Sellers/zgbs", # 若未提供categoryId则必填
"domain": "US", # 可选
"page": 1, # 可选
"limit": 50, # 可选,通常每页20-50个
})返回带有排名位置、评分及品类导航信息的排名产品。
Get Best Seller Categories
获取畅销品类
python
response = requests.get(f"{BASE_URL}/api/amazon/bestseller-categories", headers=HEADERS, params={
"domain": "US", # optional
})Returns top-level best seller category IDs (e.g. ) to feed into .
bestsellers_amazon_devices/api/amazon/bestsellerspython
response = requests.get(f"{BASE_URL}/api/amazon/bestseller-categories", headers=HEADERS, params={
"domain": "US", # 可选
})返回顶级畅销品类ID(例如 ),可传入接口使用。
bestsellers_amazon_devices/api/amazon/bestsellersProduct Lookup Options
产品查询选项
Product endpoints accept one of these identifiers:
| Parameter | Description | Example |
|---|---|---|
| Amazon product ASIN | |
| Full Amazon product URL | |
| ISBN, UPC, or EAN code | |
产品端点接受以下标识符之一:
| 参数 | 描述 | 示例 |
|---|---|---|
| 亚马逊产品ASIN | |
| 完整亚马逊产品URL | |
| ISBN、UPC或EAN编码 | |
Supported Domains
支持的站点
US (default), UK, CA, DE, FR, IT, ES, AU, IN, MX, BR, JP, PL
US(默认)、UK、CA、DE、FR、IT、ES、AU、IN、MX、BR、JP、PL
Error Handling
错误处理
| Status | Meaning |
|---|---|
| 400 | Invalid parameters |
| 401 | Invalid or missing API key |
| 402 | Payment required |
| 500 | Server error |
python
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}")| 状态码 | 含义 |
|---|---|
| 400 | 参数无效 |
| 401 | API密钥无效或缺失 |
| 402 | 需要付费 |
| 500 | 服务器错误 |
python
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}")