Amazon Data API 使用文档
阅读导航
最后一次更新:2024年8月27日
一、产品简介
本产品主要通过API的方式,接收客户所需数据类型和参数,提供亚马逊网页的最新数据(24小时以内)。提供的数据类型包括:商品分类数据,商户数据、商品详细信息数据。
支持站点:美国站、英国站、德国站、法国站等。
二、开始使用
由于本产品以API的方式提供,包含数据任务创建和数据接收两步,并提供包括Shell、Python、Golang等语言的请求示例。
从数据任务创建到数据接收的时间一般在3分钟以内。
我们还可以根据客户需求增加数据字段,和加快数据刷新频率。
三、产品功能
本产品共提供三类亚马逊网页的数据。
(一) 商品分类数据
根据商品类别,获取同类商品的信息,包括但不限于价格、评分等。
![](https://www.pangolinfo.com/wp-content/uploads/2024/08/Amazon商品分类数据.png)
(一) 商户数据
根据商户ID,获取商户商品信息,包括但不限于价格、评分等。
(二) 商品详情数据
根据商品ASIN,获取商品信息,包括但不限于标题、价格、评分、评论、图片链接、商品尺寸、商品重量、商户ID、首次发行日期、商品种类等。
![](https://www.pangolinfo.com/wp-content/uploads/2024/08/Amazon商品详情数据.png)
![](https://www.pangolinfo.com/wp-content/uploads/2024/08/Amazon商品详情数据.png)
四、使用指南
(一)根据商品种类创建数据任务
简要描述
- 根据商品种类创建数据任务
请求URL
- http://scrape.pangolinfo.com/api/custom/task/category/receive?token=xxx
请求方法
- POST
表头
- Content-Type: application/json
参数
参数名 | 必选 | 类型 | 说明 | 示例 |
url | 是 | string | 采集页面URL | |
site | 是 | string | 采集站点(US、UK、DE) | “UK” |
callbackUrl | 是 | string | 接收数据URL | https://xxx.xxx.xxx.xxx:xx/callback |
输入示例
{
"url": "https://www.amazon.co.uk/b?node=4224879031&language=en_GB",
"site": "UK",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
返回示例
{
"code": 0,
"message": "ok",
"data": {
"data": "e5b5952c20cc499cb7939613e440bd7b",
"bizCode": 0,
"bizMsg": "ok"
}
}
Shell示例
#! /bin/bash
curl --location 'http://scrape.pangolinfo.com/api/custom/task/category/receive?token=xxxx' \
--header 'Content-Type: application/json' \
--data '{"url":"https://www.amazon.co.uk/b?node=4224879031&language=en_GB","site":"UK","callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"}'
Python示例
import requests
import json
url = "http://scrape.pangolinfo.com/api/custom/task/category/receive"
headers = {
"Content-Type": "application/json",
}
params = {
"token": "xxxx",
}
data = {
"url": "https://www.amazon.co.uk/b?node=4224879031&language=en_GB"
"site": "UK",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
response = requests.request(
method="POST",
url=url,
headers=headers,
params=params,
data=json.dumps(data)
)
print(response.text)
Golang示例
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
type Request struct {
URL string `json:"url"`
Site string `json:"site"`
CallbackUrl string `json:"callbackUrl"`
}
func main() {
url := "http://scrape.pangolinfo.com/api/custom/task/category/receive?token=xxxx"
request := Request{
URL: "https://www.amazon.co.uk/b?node=4224879031&language=en_GB",
Site: "UK",
CallbackUrl: https://xxx.xxx.xxx.xxx:xx/callback",
}
reqBody, err := json.Marshal(request)
if err != nil {
log.Fatal(err)
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
if err != nil {
log.Fatal(err)
}
req.Header.Add("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
respBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(respBody))
}
(二)根据商户创建数据任务
简要描述
- 根据商户创建数据任务
请求URL
- http://scrape.pangolinfo.com/api/custom/task/seller/receive?token=xxxx
请求方法
- POST
表头
- Content-Type: application/json
参数
参数名 | 必选 | 类型 | 说明 | 示例 |
url | 是 | string | 采集页面URL | https://www.amazon.co.uk/s?me=AM4IB6PKMNCWD&marketplaceID=A1F83G8C2ARO7P |
site | 是 | string | 采集站点(US、UK、DE) | “UK” |
callbackUrl | 是 | string | 接收数据URL | https://xxx.xxx.xxx.xxx:xx/callback |
输入示例
{
"url": "https://www.amazon.co.uk/s?me=AM4IB6PKMNCWD&marketplaceID=A1F83G8C2ARO7P",
"site": "UK",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
返回示例
{
"code": 0,
"message": "ok",
"data": {
"data": "e5b5952c20cc499cb7939613e440bd7b",
"bizCode": 0,
"bizMsg": "ok"
}
}
Shell示例
#! /bin/bash
curl --location 'http://scrape.pangolinfo.com/api/custom/task/seller/receive?token=xxxx' \
--header 'Content-Type: application/json' \
--data '{"url": "https://www.amazon.co.uk/s?me=AM4IB6PKMNCWD&marketplaceID=A1F83G8C2ARO7P","site":"UK","callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"}'
Python示例
import requests
import json
url = "http://scrape.pangolinfo.com/api/custom/task/seller/receive"
headers = {
"Content-Type": "application/json",
}
params = {
"token": "xxxx",
}
data = {
"url": "https://www.amazon.co.uk/s?me=AM4IB6PKMNCWD&marketplaceID=A1F83G8C2ARO7P",
"site": "UK",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
response = requests.request(
method="POST",
url=url,
headers=headers,
params=params,
data=json.dumps(data)
)
print(response.text)
Golang示例
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
type Request struct {
URL string `json:"url"`
Site string `json:"site"`
CallbackUrl string `json:"callbackUrl"`
}
func main() {
url := "http://scrape.pangolinfo.com/api/custom/task/seller/receive?token=xxxx"
request := Request{
URL: "https://www.amazon.co.uk/s?me=AM4IB6PKMNCWD&marketplaceID=A1F83G8C2ARO7P",
Site: "UK",
CallbackUrl: https://xxx.xxx.xxx.xxx:xx/callback",
}
reqBody, err := json.Marshal(request)
if err != nil {
log.Fatal(err)
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
if err != nil {
log.Fatal(err)
}
req.Header.Add("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
respBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(respBody))
}
(三)创建商品详情数据任务
简要描述
- 创建商品详情数据任务
请求URL
- http://scrape.pangolinfo.com/api/custom/task/product/receive?token=xxxx
请求方法
- POST
表头
- Content-Type: application/json
参数
参数名 | 必选 | 类型 | 说明 | 示例 |
site | 是 | string | 采集站点(US、UK、DE) | “UK” |
url | 是 | string | 网页链接 | https://www.amazon.co.uk/dp/B0D8KPRWFV |
callbackUrl | 是 | string | 接收数据URL | https://xxx.xxx.xxx.xxx:xx/callback |
输入示例
{
"site": "UK",
"url": "https://www.amazon.co.uk/dp/B0D8KPRWFV",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
返回示例
{
"code": 0,
"message": "ok",
"data": {
"data": "e5b5952c20cc499cb7939613e440bd7b",
"bizCode": 0,
"bizMsg": "ok"
}
}
Shell示例
#! /bin/bash
curl --location 'http://scrape.pangolinfo.com/api/custom/task/product/receive?token=xxxx' \
--header 'Content-Type: application/json' \
--data '{"site":"UK","url": "https://www.amazon.co.uk/dp/B0D8KPRWFV","callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"}'
Python示例
import requests
import json
url = "http://scrape.pangolinfo.com/api/custom/task/product/receive"
headers = {
"Content-Type": "application/json",
}
params = {
"token": "xxxx",
}
data = {
"site": "UK",
"url": "https://www.amazon.co.uk/dp/B0D8KPRWFV",
"callbackUrl": "https://xxx.xxx.xxx.xxx:xx/callback"
}
response = requests.request(
method="POST",
url=url,
headers=headers,
params=params,
data=json.dumps(data)
)
print(response.text)
Golang示例
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
type Request struct {
Site string `json:"site"`
URL string `json:"url"`
CallbackUrl string `json:"callbackUrl"`
}
func main() {
url := "http://scrape.pangolinfo.com/api/custom/task/product/receive?token=xxxx"
request := Request{
Site: "UK",
URL: "https://www.amazon.co.uk/dp/B0D8KPRWFV",
CallbackUrl: "https://xxx.xxx.xxx.xxx:xx/callback",
}
reqBody, err := json.Marshal(request)
if err != nil {
log.Fatal(err)
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
if err != nil {
log.Fatal(err)
}
req.Header.Add("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
respBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(respBody))
}
需要帮助吗?
我们致力于您的成功,如果有任何问题,请随时联系我们!
我们的专家团队致力于帮助您解决和修复可能在使用我们的产品时遇到的任何问题。
如果您想提交错误报告或需要技术支持,请通过发送电子邮件联系我们的支持团队。或者参阅技术文档。[Data API用户指南] | [Scrape API用户指南]