步骤一:批量提交查询请求,并获得提取任务ID
接口地址:http://apidata.chinaz.com/BatchAPI/AllKeyword
返回格式:JSON
请求方式:POST(form-data类型)
请求参数:
名称 |
类型 |
必填 |
说明 |
key |
string |
是 |
申请接口时获取的key |
keywords |
string |
是 |
获取的关键词,多个用“|”隔开 如:站长|站长之家 (每个关键词算一次查询,最高支持50个) |
返回参数说明:
名称 |
类型 |
说明 |
StateCode |
int |
状态 |
Reason |
string |
状态说明 |
TaskID |
string |
成功返回的任务ID |
Total |
int |
成功提交总条数 |
JSON返回示例:
{
"StateCode": 1,
"Reason": "提交成功",
"TaskID": "2825cf318ca541cf82af0eb7",
"Total": 2
}
步骤二:根据提取任务ID查询数据是否采集完成,如果完成则得到Json格式结果
接口地址:http://apidata.chinaz.com/batchapi/GetApiData
返回格式:JSON
请求方式:POST(form-data类型)
请求参数:
名称 |
类型 |
必填 |
说明 |
taskid |
string |
是 |
步骤一返回的任务ID |
名称 |
类型 |
说明 |
StateCode | int | 状态码 |
Reason | string | 状态说明 |
TaskID | string | 任务ID |
SubmitTime | string | 提交时间 |
FinishedTime | string | 成功时间 |
SubmitCount | int | 成功提交条数 |
SuccessCount | int | 成功抓取条数 |
Keyword | string | 抓取的关键词 |
SiteCount | long | 关键词收录量 |
JSON返回示例:
{
"StateCode": 1,
"Reason": "成功",
"Result": {
"TaskID": "2825cf318ca541cf82af0eb7",
"SubmitTime": "20190123170426",
"FinishedTime": "20190123170736",
"SubmitCount": 2,
"SuccessCount": 2,
"Data": [
{
"Baidu": {
"Keyword": "站长",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 28900000
}
},
"Haosou": {
"Keyword": "站长",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 100000000
}
},
"Sogou": {
"Keyword": "站长",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 3518084
}
},
"Google": {
"Keyword": "站长",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 1230000000
}
}
},
{
"Baidu": {
"Keyword": "站长之家",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 11000000
}
},
"Haosou": {
"Keyword": "站长之家",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 7670000
}
},
"Sogou": {
"Keyword": "站长之家",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 743761
}
},
"Google": {
"Keyword": "站长之家",
"StateCode": 1,
"Reason": "成功",
"Result": {
"SiteCount": 466000000
}
}
}
]
}
}
接口地址:http://apidata.chinaz.com/CallAPI/AllKeyword
返回格式:JSON
请求方式:GET/POST(POST请求用form-data类型)
请求示例:http://apidata.chinaz.com/CallAPI/AllKeyword?key=申请的key&keyword=站长
请求参数:
名称 |
类型 |
必填 |
说明 |
key |
string |
是 |
申请接口时获取的key |
keyword |
string |
是 |
获取的关键词,如:站长 |
返回参数说明:
名称 |
类型 |
说明 |
StateCode | int | 状态码 |
Reason | string | 状态说明 |
BaiduCollectCount | long | BD关键词收录量 |
SoCollectCount | long | 360关键词收录量 |
SogouCollectCount | long | 搜狗关键词收录量 |
GoogleCollectCount | long | 谷歌关键词收录量 |
JSON返回示例:
{
"StateCode": 1,
"Reason": "成功",
"Result": {
"BaiduCollectCount": 2310000,
"SoCollectCount": 100000000,
"SogouCollectCount": 3407022,
"GoogleCollectCount": 1040000000
}
}