Google Maps API
Google Maps 搜索附近地点 API
在 Google Maps 上围绕精确的经纬度搜索,每次调用最多返回 20 个标准化地点,每个地点的地址都拆分为街道、城市、州、邮政编码和国家。当你有坐标并希望地图视口以其为中心时使用此接口;如果只有地点名称,请使用 maps.search。将返回的 nextCursor 作为 cursor 传回,即可获取接下来的 20 个地点。
POST/v1/run/maps.search_nearby
可用率
100.00%
30d · 363 次调用
请求数
363
30d
响应时间
4.1s
中位数 · 30d
试一试
发出你的第一个请求
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。
{
"data": {
"items": [
{
"address": "123 Main St",
"categories": [
"example"
],
"category": "general",
"cid": "a1b2c3d4",
"city": "San Francisco",
"countryCode": "US",
"description": "A short example description of this item.",
"domain": "example.com",
"image": "https://example.com/image.jpg",
"latitude": 37.7749,
"longitude": -122.4194,
"name": "Example title",
"neighborhood": "example",
"phone": "+1 555-0142",
"placeId": "a1b2c3d4",
"postalCode": "94107",
"rank": 1,
"rating": 4.6,
"reviewCount": 12500,
"state": "CA",
"street": "123 Main St",
"url": "https://example.com/page",
"website": "https://example.com/page"
}
],
"nextCursor": "example"
},
"found": true,
"reason": "not_found"
}响应类型定义
interface MapsSearchNearbyResponse {
data: {
items: {
address?: string;
categories?: string[];
category?: string;
cid?: string;
city?: string;
countryCode?: string;
description?: string;
domain?: string;
image?: string;
latitude?: number;
longitude?: number;
name: string;
neighborhood?: string;
phone?: string;
placeId: string;
postalCode?: string;
rank?: number;
rating?: number;
reviewCount?: number;
state?: string;
street?: string;
url: string;
website?: string;
}[];
nextCursor?: string | null;
} | null;
found: boolean;
reason?: "not_found";
}完整的参数与响应参考:这个接口的每个字段、类型和示例。
参考
请求、响应与价格
最近验证于 2026-09-29 · 可用率和延迟按 30d 统计POST /v1/run/maps.search_nearby
curl -X POST https://api.getanyapi.com/v1/run/maps.search_nearby \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"coordinates":{"latitude":30.2672,"longitude":-97.7431},"limit":20,"query":"coffee shop"}'| 字段 | 类型 | 示例值 |
|---|---|---|
| 请求体 | ||
| coordinates | string | {"latitude":30.2672,"longitude":-97.7431}搜索所围绕的精确地图中心点。如果只有地点名称,请改用 maps.search。 |
| query | string | "coffee shop"你会在 Google Maps 搜索栏中输入的内容(例如 coffee shop)。 |
| cursor | string | 来自上一次响应中 nextCursor 的不透明游标。传回它以获取下一页地点。 |
| language | string | 结果使用的两字母语言代码(例如 en)。 |
| limit | integer | 20本次响应最多返回的地点数(1-20)。Google Maps 每次调用返回一个视口,约 20 个地点;需要更多时用 cursor 翻页。按请求固定计费。 |
| zoom | number | Google Maps 视口缩放级别。数值越低覆盖范围越大,越高则越集中在坐标周围。 |
| 响应 | ||
| data | object | The result wrapper, or null when nothing matched. |
| data.items | object[] | Matching Google Maps place records, nearest the requested coordinates first. Populated whenever the provider has data for the entity. |
| data.items[].address | string | Full formatted street address. |
| data.items[].categories | string[] | Every Google Maps category listed for the place. |
| data.items[].category | string | Primary place category (e.g. Coffee shop). |
| data.items[].cid | string | Google customer/place id (cid). |
| data.items[].city | string | City the place is in. |
| data.items[].countryCode | string | Two-letter country code. |
| data.items[].description | string | Google's one-line description of the place. |
| data.items[].domain | string | Registrable domain of the place website. |
| data.items[].image | string | Thumbnail photo URL for the place. |
| data.items[].latitude | number | Latitude of the place in decimal degrees. |
| data.items[].longitude | number | Longitude of the place in decimal degrees. |
| data.items[].name | string | Place name. Populated whenever the provider has data for the entity. |
| data.items[].neighborhood | string | Neighborhood the place is in. |
| data.items[].phone | string | Business phone number, when listed. |
| data.items[].placeId | string | Google Maps place id (stable identifier for the place). Populated whenever the provider has data for the entity. |
| data.items[].postalCode | string | Postal code of the place. |
| data.items[].rank | integer | One-based position of the place in the Google Maps result order. |
| data.items[].rating | number | Average Google rating out of 5. |
| data.items[].reviewCount | integer | Number of Google reviews the place has. |
| data.items[].state | string | State or region the place is in, spelled in full (e.g. Texas). |
| data.items[].street | string | Street line of the address. |
| data.items[].url | string | Canonical Google Maps URL for the place. Populated whenever the provider has data for the entity. |
| data.items[].website | string | The place's own website URL, when listed. |
| data.nextCursor | string | Opaque cursor for the next page of places, or null when this search is complete. Pass it back as cursor to continue. |
| found | boolean | True when the search returned at least one matching place. |
| reason | "not_found" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| 价格 | ||
| 每次请求价格 | USD | US$0.0013 |
| 价格(/千次请求) | USD | US$1.30 |
常见问题
关于 Google Maps 搜索附近地点 API
AnyAPI 的 Google Maps 搜索附近地点 API 只需一次 POST 请求 /v1/run/maps.search_nearby,就以统一格式的 JSON 返回 Google Maps 数据。在 Google Maps 上围绕精确的经纬度搜索,每次调用最多返回 20 个标准化地点,每个地点的地址都拆分为街道、城市、州、邮政编码和国家。当你有坐标并希望地图视口以其为中心时使用此接口;如果只有地点名称,请使用 maps.search。将返回的 nextCursor 作为 cursor 传回,即可获取接下来的 20 个地点。无论哪个数据源提供服务,AnyAPI 都返回同一套统一的 schema。费用:每千次请求 US$1.30 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 Google Maps 搜索附近地点 API 调用中有 100.0% 成功,响应时间中位数为 4.1 秒,共测量 363 次调用。
费用:每千次请求 US$1.30 起,以美元计价,无需订阅,也没有每月最低消费。你只需为一个美元钱包充值,每次调用从中扣费。部分由钱包付费的失败请求会产生处理费用,我们按成本原价转嫁,不加价;错误响应会显示收取的金额。
在 Google Maps 上围绕精确的经纬度搜索,每次调用最多返回 20 个标准化地点,每个地点的地址都拆分为街道、城市、州、邮政编码和国家。当你有坐标并希望地图视口以其为中心时使用此接口;如果只有地点名称,请使用 maps.search。将返回的 nextCursor 作为 cursor 传回,即可获取接下来的 20 个地点。响应是统一格式的 JSON,外层结构与每个 AnyAPI 接口相同,所以解析另一个接口只需换一个 URL,别的都不用改。
过去 30 天,通过 AnyAPI 发起的 Google Maps 搜索附近地点 API 调用中有 100.0% 成功,响应时间中位数为 4.1 秒,共测量 363 次调用。这些是 AnyAPI 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。