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"}'
字段类型示例值
请求体
coordinatesstring{"latitude":30.2672,"longitude":-97.7431}搜索所围绕的精确地图中心点。如果只有地点名称,请改用 maps.search。
querystring"coffee shop"你会在 Google Maps 搜索栏中输入的内容(例如 coffee shop)。
cursorstring来自上一次响应中 nextCursor 的不透明游标。传回它以获取下一页地点。
languagestring结果使用的两字母语言代码(例如 en)。
limitinteger20本次响应最多返回的地点数(1-20)。Google Maps 每次调用返回一个视口,约 20 个地点;需要更多时用 cursor 翻页。按请求固定计费。
zoomnumberGoogle Maps 视口缩放级别。数值越低覆盖范围越大,越高则越集中在坐标周围。
响应
dataobjectThe result wrapper, or null when nothing matched.
data.itemsobject[]Matching Google Maps place records, nearest the requested coordinates first. Populated whenever the provider has data for the entity.
data.items[].addressstringFull formatted street address.
data.items[].categoriesstring[]Every Google Maps category listed for the place.
data.items[].categorystringPrimary place category (e.g. Coffee shop).
data.items[].cidstringGoogle customer/place id (cid).
data.items[].citystringCity the place is in.
data.items[].countryCodestringTwo-letter country code.
data.items[].descriptionstringGoogle's one-line description of the place.
data.items[].domainstringRegistrable domain of the place website.
data.items[].imagestringThumbnail photo URL for the place.
data.items[].latitudenumberLatitude of the place in decimal degrees.
data.items[].longitudenumberLongitude of the place in decimal degrees.
data.items[].namestringPlace name. Populated whenever the provider has data for the entity.
data.items[].neighborhoodstringNeighborhood the place is in.
data.items[].phonestringBusiness phone number, when listed.
data.items[].placeIdstringGoogle Maps place id (stable identifier for the place). Populated whenever the provider has data for the entity.
data.items[].postalCodestringPostal code of the place.
data.items[].rankintegerOne-based position of the place in the Google Maps result order.
data.items[].ratingnumberAverage Google rating out of 5.
data.items[].reviewCountintegerNumber of Google reviews the place has.
data.items[].statestringState or region the place is in, spelled in full (e.g. Texas).
data.items[].streetstringStreet line of the address.
data.items[].urlstringCanonical Google Maps URL for the place. Populated whenever the provider has data for the entity.
data.items[].websitestringThe place's own website URL, when listed.
data.nextCursorstringOpaque cursor for the next page of places, or null when this search is complete. Pass it back as cursor to continue.
foundbooleanTrue 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.
价格
每次请求价格USDUS$0.0013
价格(/千次请求)USDUS$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 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。