maps可调用
Google Maps Search
查看请求示例并在 Playground 中使用此 API。调用受账户余额与限额约束。
API 地址与价格
POST
https://api.serpbase.dev/google/maps/search目录价格:每次请求 2 积分。
请求参数示例
示例来自此产品的目录,不代表全部参数或必填规则。完整说明见接口文档,已知字段由 API 校验。
| 参数 | 示例类型 | 示例值 |
|---|---|---|
| location | object | {"location_query":"Seattle, WA"} |
| query | string | "coffee" |
JSON
{
"location": {
"location_query": "Seattle, WA"
},
"query": "coffee"
}调用示例
cURL
curl -X POST 'https://api.serpbase.dev/google/maps/search' \
-H "Content-Type: application/json" \
-H 'X-API-Key: YOUR_API_KEY' \
-d '{"location":{"location_query":"Seattle, WA"},"query":"coffee"}'JavaScript
const response = await fetch("https://api.serpbase.dev/google/maps/search", {
"method": "POST",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
"body": "{\"location\":{\"location_query\":\"Seattle, WA\"},\"query\":\"coffee\"}"
});
const result = await response.json();
// Check result.status and result.error for the API outcome.
console.log(result);响应与调用结果
响应为 JSON。搜索接口的 HTTP 200 不代表业务成功,请查看响应中的 status 与 error;实际返回字段和错误说明见接口文档。
查看响应说明