跳转到主要内容

简介

Google Search 是 Ace Data Cloud 提供的搜索服务,Google 搜索 API。通过 Ace Data Cloud 统一 API,你可以使用 cURL 快速调用 Google Search,实现网页搜索、图片搜索、新闻搜索、地图搜索、视频搜索等功能。

前置条件

  • 拥有 Ace Data Cloud 账号并获取 API Token
  • 安装了 cURL 的终端环境

基础用法

调用 Google Search API 的主端点为:
POST https://api.acedata.cloud/serp/google
完整 cURL 命令示例:
curl -X POST https://api.acedata.cloud/serp/google \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "artificial intelligence latest news", "type": "search", "number": 10, "language": "en", "country": "US"}'
请将 YOUR_API_TOKEN 替换为你在 Ace Data Cloud 平台获取的实际 Token。

响应示例

成功调用后返回 JSON 格式数据,例如:
{
  "status": "success",
  "data": {
    ...
  }
}

使用 jq 处理响应

推荐使用 jq 工具格式化输出:
curl -s -X POST https://api.acedata.cloud/serp/google \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "artificial intelligence latest news", "type": "search", "number": 10, "language": "en", "country": "US"}' | jq .

错误处理

常见错误码:
状态码说明
401认证失败,请检查 API Token
403余额不足或无权访问
429请求频率超限
500服务器内部错误

下一步