参数 | 类型 | 必选 | 值 | 示例 |
Authorization | string | 是 | 授权 access_token | Bearer 1798c6aadec33d1bc2f5b707f1049aefexxxx |
参数 | 类型 | 必选 | 示例 |
keyword | string | 否 | 关键词 |
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "http://xxxxxxxxxxxxx.com/tool/accounts/tao-suggest", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => array('keyword' => '电脑'), CURLOPT_HTTPHEADER => array( "Authorization: Bearer 16e51c92d77f9392feb9b26f4c2ab0fdxxxxxxxx", "Cookie: PHPSESSID=udfe5o5uce3s4s2j40b0b78q69; _csrf=9d6072f1c1bdc0e30386cc584dfa576d3988ac03a285db630e07b09602cd1ad2a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%227qVFB46V97kJJxVEow6vlEB_CWvyxMwH%22%3B%7D" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM) .addFormDataPart("keyword", "电脑") .build(); Request request = new Request.Builder() .url("http://xxxxxxxxxx.com/tool/accounts/tao-suggest") .method("POST", body) .addHeader("Authorization", "Bearer 16e51c92d77f9392feb9b26f4c2ab0fdxxxxxxxx") .addHeader("Cookie", "PHPSESSID=udfe5o5uce3s4s2j40b0b78q69; _csrf=9d6072f1c1bdc0e30386cc584dfa576d3988ac03a285db630e07b09602cd1ad2a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%227qVFB46V97kJJxVEow6vlEB_CWvyxMwH%22%3B%7D") .build(); Response response = client.newCall(request).execute();
data | 类型 | 描述 |
code | int | 返回状态码 |
msg | string | 返回码描述 |
msec | int | 接口执行时间 |
time | int | 接口返回时间 |
data | object | 查询结果 |
{ "code": 0, "msg": "成功", "msec": 2425, "time": 1596597706, "data": "\r\n{\"result\":[[\"电脑包\",\"183555.58179935653\"],[\"电脑椅\",\"176959.22811389607\"],[\"电脑台式桌\",\"196186.98406737676\"],[\"电脑主机\",\"35254.18182517254\"],[\"电脑音响\",\"21856.24304420923\"],[\"电脑笔记本\",\"156057.90195018973\"],[\"电脑支架\",\"43277.13590609871\"],[\"电脑台式 全套\",\"48673.34610331972\"],[\"电脑耳机\",\"22982.731907620477\"],[\"电脑显示器\",\"52615.562941284064\"]]}" }
返回码 | 返回码描述 | 解决方案 |
0 | 成功 | |
100 | 请求参数错误 | 检查您的请求参数是否正确 |
101 | 请求超时,请重试 | 检查您的网络情况或者联系客服解决 |
200 | 系统错误,请联系客服 | 检查您的接口地址填写是否正确,其他问题联系客服解决 |
203 | 暂不支持当前接口 | |
204 | 请求异常:无该接口权限,请前往官网开通正式接口。 | 前往官网开通该接口权限 |
204 | 请求异常:API 调用次数不足,请前往网站兑换次数。 | 前往官网充值该接口调用次数 |
401 | 身份凭证无效 | 在请求头中添加 access_token |
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!