web/search
实时访问全球最大的搜索引擎,获取最精准的搜索结果。
接口详情
POST
https://api123.codenews.cc/v1/search请求参数
| 参数名 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| q | string | 是 | - | 搜索关键词 |
| page | number | 否 | 1 | 页码 |
| count | number | 否 | 10 | 每页结果数 |
代码示例
请将 $API_KEY 替换为您在控制台申请的真实 API Key。
curl -X POST https://api123.codenews.cc/v1/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"q": "apple"}'响应示例
{
"searchParameters": {
"q": "apple"
},
"organic": [
{
"title": "Apple",
"link": "https://www.apple.com",
"snippet": "Discover the innovative world of Apple..."
},
{
"title": "Apple - Wikipedia",
"link": "https://en.wikipedia.org/wiki/Apple",
"snippet": "An apple is an edible fruit produced by an apple tree..."
}
],
"credits": 1
}错误码
| 状态码 | 说明 |
|---|---|
| 401 | API Key 无效或缺失 |
| 400 | 参数错误,例如缺失 q |