SerpBase
google可调用

Google Web Search

查看请求示例并在 Playground 中使用此 API。调用受账户余额与限额约束。

API 地址与价格

POSThttps://api.serpbase.dev/google/search

目录价格:每次请求 1 积分。

请求参数示例

示例来自此产品的目录,不代表全部参数或必填规则。完整说明见接口文档,已知字段由 API 校验。

目录请求参数示例
参数示例类型示例值
devicestring"mobile"
glstring"us"
hlstring"en"
qstring"coffee shops"
JSON
{
  "device": "mobile",
  "gl": "us",
  "hl": "en",
  "q": "coffee shops"
}

调用示例

cURL
curl -X POST 'https://api.serpbase.dev/google/search' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"device":"mobile","gl":"us","hl":"en","q":"coffee shops"}'
JavaScript
const response = await fetch("https://api.serpbase.dev/google/search", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_API_KEY"
  },
  "body": "{\"device\":\"mobile\",\"gl\":\"us\",\"hl\":\"en\",\"q\":\"coffee shops\"}"
});
const result = await response.json();
// Check result.status and result.error for the API outcome.
console.log(result);

响应与调用结果

响应为 JSON。搜索接口的 HTTP 200 不代表业务成功,请查看响应中的 status 与 error;实际返回字段和错误说明见接口文档。

查看响应说明
Google Web Search API | SerpBase