查询网站标题、关键词、描述等
http://api.xuewutheme.com[
{
"name": "code",
"type": "integer",
"description": "返回的状态码"
},
{
"name": "data",
"type": "object",
"description": "返回的数据/数据对象"
},
{
"name": "msg",
"type": "string",
"description": "返回的消息"
},
{
"name": "time",
"type": "string",
"description": "请求时间"
},
{
"name": "data.type",
"type": "string",
"description": "类型"
},
{
"name": "data.author",
"type": "string",
"description": "作者"
},
{
"name": "data.author_id",
"type": "string",
"description": "作者ID"
},
{
"name": "data.title",
"type": "string",
"description": "作品标题"
},
{
"name": "data.desc",
"type": "string",
"description": "作品介绍"
},
{
"name": "data.avatar",
"type": "string",
"description": "作者头像"
},
{
"name": "data.cover",
"type": "string",
"description": "缩略图"
},
{
"name": "data.url",
"type": "string",
"description": "无水印链接"
}
]
查询网站标题、关键词、描述等
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| apikey string | 整数 | string |
用户开通的apikey |
| url string | 整数 | string |
查询的域名 |
| 参数名 | 类型 | 描述 |
|---|
{
"code": 200,
"data": {
"description": "全球领先的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。",
"favicon": "https://www.baidu.com/favicon.ico",
"keywords": "",
"title": "百度一下,你就知道"
},
"msg": "请求成功!"
}
curl -X GET \
"https://api.example.com/v1/users/12345" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json"
import requests
url = "https://api.example.com/v1/users/12345"
headers = {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch(
'https://api.example.com/v1/users/12345',
{
method: 'GET',
headers: {
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
'Content-Type': 'application/json'
}
}
);
const data = await response.json();
console.log(data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.example.com/v1/users/12345");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$headers = array();
$headers[] = "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...";
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
| 状态码 | 描述 |
|---|---|
| 100 | 您的apikey值为空! |
| 101 | 您的apikey值不存在! |
| 103 | 当前接口为实名认证后可用,请您先进行实名! |
| 104 | 请求频率超限! |
| 105 | 接口不存在或已下线! |
| 106 | 您的余额不足,请及时充值! |
| 107 | 您当前的接口免费使用次数已用完,请明日再来! |
| 109 | 您的账号已被封禁,不可使用任何接口! |
| 110 | 接口维护中,请稍后再试! |
| 111 | 请求参数不完整,请检查后再次访问! |
{
"code": 1001,
"message": "用户不存在",
"data": null
}