API Hop 文档
Google Maps 接口参考
搜索 Google Maps 本地商户和地点,或按地点 ID 查询。 地点评论 · 地点照片 · 照片元数据 · 商户动态 · 路线规划 · 地点自动补全 · 贡献者评论 · 本地搜索 · 本地服务 · 活动搜索.
并发上限
AI 与 Data 分别共享账户级并发槽位,默认 5 AI / 2 Data,订阅套餐可调整上限。接口单独配置仍受分类总上限约束。达到任一上限返回 HTTP 429;异步任务执行结束前占用槽位。
GET /v1/google-maps/search GET /v1/google-maps/reviews GET /v1/google-maps/photos GET /v1/google-maps/photos/meta GET /v1/google-maps/posts GET /v1/google-maps/directions GET /v1/google-maps/autocomplete GET /v1/google-maps/contributor/reviews GET /v1/google-maps/local GET /v1/google-maps/local/services GET /v1/google-maps/events 搜索 Google Maps 本地商户和地点,或按地点 ID 查询。 地点评论 · 地点照片 · 照片元数据 · 商户动态 · 路线规划 · 地点自动补全 · 贡献者评论 · 本地搜索 · 本地服务 · 活动搜索.
- 搜索 Google Maps 地点:
GET https://api.apihop.ai/v1/google-maps/search - 地点评论:
GET https://api.apihop.ai/v1/google-maps/reviews - 地点照片:
GET https://api.apihop.ai/v1/google-maps/photos - 照片元数据:
GET https://api.apihop.ai/v1/google-maps/photos/meta - 商户动态:
GET https://api.apihop.ai/v1/google-maps/posts - 路线规划:
GET https://api.apihop.ai/v1/google-maps/directions - 地点自动补全:
GET https://api.apihop.ai/v1/google-maps/autocomplete - 贡献者评论:
GET https://api.apihop.ai/v1/google-maps/contributor/reviews - 本地搜索:
GET https://api.apihop.ai/v1/google-maps/local - 本地服务:
GET https://api.apihop.ai/v1/google-maps/local/services - 活动搜索:
GET https://api.apihop.ai/v1/google-maps/events
认证与计费
默认每次成功请求 $0.0003(300 credits)。 使用 API Hop API Key。可用性取决于已启用网关和密钥权限。每次成功请求的价格以当前目录和账户显示为准,账户专属价格优先。成功的空结果也计费,失败请求释放预占额度。超时为 60 秒,不自动重试或翻页,结算失败不会重复调用上游。
Authorization: Bearer YOUR_API_KEY请求参数
搜索 Google Maps 地点
GET https://api.apihop.ai/v1/google-maps/search
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
query | string | 搜索词 | coffee shop |
type | string | 模式; search, place | - |
place_id | string | 地点 ID | ChIJP8p2kJC1RIYR2qrGoXZtZCk |
data_cid | string | 十进制地点 CID | 2982629209513831130 |
latitude | number | 纬度; min: -90; max: 90 | 30.2672 |
longitude | number | 经度; min: -180; max: 180 | -97.7431 |
location | string | 命名起点 | Austin, TX |
zoom | number | 视图缩放; min: 3; max: 30 | 13.1 |
m | number | 视图高度(米); min: 1; max: 15028132 | - |
start | integer | 结果偏移量; min: 0; max: 9007199254740991 | 0 |
gl | string | 国家提示 | us |
hl | string | 界面语言 | en-US |
nearby | boolean | 附近偏好 | - |
zero_trace | boolean | 不归档响应产物 | - |
min_price | integer | 最低价格; min: 0; max: 9007199254740991 | - |
max_price | integer | 最高价格; min: 0; max: 9007199254740991 | - |
min_rating | number | 偏好的最低评分; 2, 2.5, 3, 3.5, 4, 4.5 | - |
open_state | string | 营业状态; now, 24h | - |
open_on_day | string | 当地星期; mon, tue, wed, thu, fri, sat, sun | - |
open_at_hour | integer | 当地小时; min: 0; max: 23 | - |
地点评论
GET https://api.apihop.ai/v1/google-maps/reviews
按地点查询评论,可按排序、文本或主题筛选;文本与主题不能同时提供。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
id | string | Google place_id 或十六进制 data_id;不支持十进制 CID 和贡献者 ID。; 必填 | - |
next_page_token | string | 不透明续页令牌,一小时后过期;沿用同一账户、参数、设备和 limit。; maxLength: 24576 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 20 | - |
sort_by | string | 评论排序方式;贡献者评论仅支持 newest。; relevance, newest, rating_high, rating_low, qualityScore, newestFirst, ratingHigh, ratingLow | - |
query | string | 按文本过滤评论,最多 500 个 UTF-8 字节;与 topic_id 互斥。; maxLength: 500 | - |
topic_id | string | 结果过滤器中的评论主题 ID,与 query 互斥。; maxLength: 131; ^(?:[A-Za-z0-9_-]{1,128}|/[mg]/[A-Za-z0-9_-]{1,128})$ | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseid: Google place_id OR hexadecimal data_id; NOT decimal CID, contributor IDquery XOR topic_id (optional)next_page_token: opaque; expires after 1 hour; preserve account, parameters, device and limit; no automatic paginationno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/reviews" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=ChIJM8w7rqS1RIYRhEz2-KuoqzE" \
--data-urlencode "limit=10"地点照片
GET https://api.apihop.ai/v1/google-maps/photos
读取地点图库;下一页令牌和分类 ID 应从该地点的返回结果复制。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
id | string | 从对应 Google Maps 结果复制的地点标识。; 必填 | - |
next_page_token | string | 不透明续页令牌,一小时后过期;沿用同一账户、参数、设备和 limit。; maxLength: 24576 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 100 | - |
category_id | string | 从该地点图库复制的照片分类 ID。; maxLength: 1024; ^[A-Za-z0-9_-]+={0,2}$ | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseid: Google Maps place identifier; category_id: copy from this place gallerynext_page_token: opaque; expires after 1 hour; preserve account, parameters, device and limit; no automatic paginationno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/photos" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=0x8644b5a4ae3bcc33:0x31aba8abf8f64c84" \
--data-urlencode "limit=10"照片元数据
GET https://api.apihop.ai/v1/google-maps/photos/meta
读取单张照片的贡献者、位置、日期和图片元数据。请复制照片列表 results 中照片条目的 id 字段,不要使用 data_id 地点标识。日期使用 YYYY-MM-DD。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
id | string | 从照片列表结果复制的照片 id,不是地点 data_id。; 必填; maxLength: 255; ^[A-Za-z0-9_-]{20,255}$ | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseid: copy photo ID from GET https://api.apihop.ai/v1/google-maps/photos results; NOT place data_idno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/photos/meta" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=AF1QipPFfVtTCFKV9n-uOBqTTOHuRemFBg0PWN7xdVxp"商户动态
GET https://api.apihop.ai/v1/google-maps/posts
读取商户动态、活动详情和链接;使用返回的下一页令牌继续查询。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
id | string | 从对应 Google Maps 结果复制的地点标识。; 必填 | - |
next_page_token | string | 不透明续页令牌,一小时后过期;沿用同一账户、参数、设备和 limit。; maxLength: 24576 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 100 | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseid: Google Maps place identifiernext_page_token: opaque; expires after 1 hour; preserve account, parameters, device and limit; no automatic paginationno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=0x8644b5a4ae3bcc33:0x31aba8abf8f64c84" \
--data-urlencode "limit=10"路线规划
GET https://api.apihop.ai/v1/google-maps/directions
起点和终点各选择地址、十六进制地点 ID 或坐标中的一种表示。公交偏好 route、prefer 及 last_available 需要 travel_mode=transit。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
origin | string | 路线起点地址;与 start_data_id、start_coords 三选一。 | - |
destination | string | 路线终点地址;与 end_data_id、end_coords 三选一。 | - |
start_data_id | string | 起点的十六进制 Maps 地点数据 ID。; maxLength: 37; ^0x[0-9a-fA-F]{1,16}:0x[0-9a-fA-F]{1,16}$ | - |
end_data_id | string | 终点的十六进制 Maps 地点数据 ID。; maxLength: 37; ^0x[0-9a-fA-F]{1,16}:0x[0-9a-fA-F]{1,16}$ | - |
start_coords | string | 起点坐标,格式为 纬度,经度。; maxLength: 80 | - |
end_coords | string | 终点坐标,格式为 纬度,经度。; maxLength: 80 | - |
travel_mode | string | 出行方式。; driving, walking, bicycling, transit, two-wheeler, best, flight | - |
distance_unit | integer | 距离单位:0 为公里,1 为英里。; ≥ 0; ≤ 1 | - |
avoid | string | 要避开的道路类型,以逗号分隔。 | - |
prefer | string | 偏好的公交方式,以逗号分隔;需要 travel_mode=transit。 | - |
route | integer | 公交偏好:2 少换乘,3 少步行,4 无障碍;需要 transit。; ≥ 2; ≤ 4 | - |
time | string | 出发/到达时间:depart_at:秒级时间戳 或 arrive_by:秒级时间戳;last_available 仅用于公交。; maxLength: 40 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 100 | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseorigin XOR start_data_id XOR start_coords (required)destination XOR end_data_id XOR end_coords (required)start_coords, end_coords: latitude,longitude; latitude: -90..90; longitude: -180..180prefer, route => travel_mode=transit; time=last_available => travel_mode=transittime: depart_at:Unix_seconds OR arrive_by:Unix_seconds OR last_availabledistance_unit: 0=km, 1=mi; route: 2=fewer transfers, 3=less walking, 4=wheelchair accessibleno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/directions" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "origin=Austin, TX" \
--data-urlencode "destination=Dallas, TX" \
--data-urlencode "travel_mode=driving"地点自动补全
GET https://api.apihop.ai/v1/google-maps/autocomplete
返回搜索词和地点建议。光标位置按 UTF-16 计数;坐标须成对提供;视口支持缩放或米制高度。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
query | string | 搜索词,最多 8192 个 UTF-8 字节。; 必填 | - |
latitude | number | 纬度;必须同时提供 longitude。; ≥ -90; ≤ 90 | - |
longitude | number | 经度;必须同时提供 latitude。; ≥ -180; ≤ 180 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 100 | - |
ll | string | 地图视口:@纬度,经度,缩放z(3–21)或 @纬度,经度,高度m(正数米)。; maxLength: 120 | - |
cp | integer | 搜索词中的光标位置,按 UTF-16 代码单元计数,不能超过 query 长度。; ≥ 0 | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiselatitude AND longitude (optional)cp <= query.length (UTF-16)ll: @latitude,longitude,zoomz (3..21) OR @latitude,longitude,heightm (>0)no_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/autocomplete" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=coffee in Austin" \
--data-urlencode "limit=5"贡献者评论
GET https://api.apihop.ai/v1/google-maps/contributor/reviews
按贡献者 ID 读取最新排序的前 200 条评论。page 默认 1,limit 默认 20;大于 1 的 page 不可与续页令牌同用。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
id | string | Google Maps 贡献者资料网址中的数字贡献者 ID。; 必填; ^[0-9]+$ | - |
next_page_token | string | 不透明续页令牌,一小时后过期;沿用同一账户、参数、设备和 limit。; maxLength: 24576 | - |
page | integer | 从 1 开始的页码,仅遍历前 200 条评论;page 大于 1 时不能使用续页令牌。; ≥ 1; ≤ 200 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 50 | - |
sort_by | string | 评论排序方式;贡献者评论仅支持 newest。; newest | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwiseid: numeric Google Maps contributor profile ID(page - 1) * limit < 200; page default: 1; limit default: 20page > 1 => NOT next_page_tokennext_page_token: opaque; expires after 1 hour; preserve account, parameters, device and limit; no automatic paginationno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/contributor/reviews" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=112967280418127956987" \
--data-urlencode "limit=20"本地搜索
GET https://api.apihop.ai/v1/google-maps/local
搜索 Google 本地结果。命名地点、经纬度和 uule 三种定位方式互斥,start 为结果偏移量。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
query | string | 搜索词,最多 8192 个 UTF-8 字节。; 必填 | - |
location | string | 地点名称;与经纬度及 uule 互斥。 | - |
latitude | number | 纬度;必须同时提供 longitude。; ≥ -90; ≤ 90 | - |
longitude | number | 经度;必须同时提供 latitude。; ≥ -180; ≤ 180 | - |
uule | string | 编码后的 Google 地理位置;与 location 和经纬度互斥。; maxLength: 4096 | - |
google_domain | string | Google 国家域名,例如 google.com 或 google.co.uk。 | - |
start | integer | 结果偏移量,从 0 开始。; ≥ 0; ≤ 1000 | - |
tbs | string | Google 原生筛选条件,以逗号分隔的 key:value 表示。; maxLength: 512 | - |
ludocid | string | Google 地点客户标识 CID;保留为十进制字符串。; ^[0-9]{1,20}$ | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwise(latitude AND longitude) XOR location XOR uule (optional)tbs: comma-separated key:value filters; ludocid: Google place CIDno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/local" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=coffee shop" \
--data-urlencode "location=Austin, TX"本地服务
GET https://api.apihop.ai/v1/google-maps/local/services
搜索本地赞助服务商,或复制结果中的 cid、bid、pid 三个值一起查询服务商资料;query 选择服务类别。地理 data_cid 指城市或行政区,与 location 互斥。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
query | string | 搜索词,最多 8192 个 UTF-8 字节。; 必填 | - |
location | string | 地点名称;与经纬度及 uule 互斥。 | - |
limit | integer | 最多返回的条数;实际结果可能更少。; ≥ 1; ≤ 20 | - |
data_cid | string | 城市或行政区的非零无符号 64 位十进制 CID,与 location 互斥。 | - |
job_type | string | 搜索服务类别中的具体服务,例如电工的 restore_power。; maxLength: 100; ^[a-z][a-z0-9_]{0,99}$ | - |
cid | string | 结果中的服务商 CID,必须与 bid、pid 一起提供。; ^[0-9]{1,20}$ | - |
bid | string | 结果中的服务商 BID,必须与 cid、pid 一起提供。; ^[0-9]{1,20}$ | - |
pid | string | 结果中的服务商 PID,必须与 cid、bid 一起提供。; ^[0-9]{1,20}$ | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwisedata_cid: geographic city/district CID, string 1..18446744073709551615; NOT locationcid AND bid AND pid (optional group); query selects the service categoryno_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/local/services" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=plumber" \
--data-urlencode "location=Austin, TX" \
--data-urlencode "limit=5"活动搜索
GET https://api.apihop.ai/v1/google-maps/events
搜索 Google 活动卡片。命名地点、经纬度和 uule 三种定位方式互斥。
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 两个字母的国家代码,例如 us。; ^[A-Za-z]{2}$ | us |
language | string | 界面语言代码,例如 en。 | en |
device | string | 来源页面的设备展示类型。; desktop, mobile, tablet | - |
zero_trace | boolean | 不归档响应产物;仍保留计费元数据。 | - |
no_cache | boolean | 兼容参数;true 和 false 均获取新数据并按成功请求正常计费。 | - |
query | string | 搜索词,最多 8192 个 UTF-8 字节。; 必填 | - |
location | string | 地点名称;与经纬度及 uule 互斥。 | - |
latitude | number | 纬度;必须同时提供 longitude。; ≥ -90; ≤ 90 | - |
longitude | number | 经度;必须同时提供 latitude。; ≥ -180; ≤ 180 | - |
uule | string | 编码后的 Google 地理位置;与 location 和经纬度互斥。; maxLength: 4096 | - |
GET query only; unknown, repeated, empty, control-character values rejected; no request bodyquery: UTF-8 bytes <= 8192 unless maxLength specifies otherwise; strings: length <= 8192 unless maxLength specifies otherwise(latitude AND longitude) XOR location XOR uule (optional)no_cache: true OR false both fetch fresh results; normal successful-request billing
curl --get "https://api.apihop.ai/v1/google-maps/events" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=events in Austin" \
--data-urlencode "location=Austin, TX"校验规则
仅接受查询参数,不接受请求体。未知、重复、空值和包含控制字符的参数会被拒绝。搜索必须提供 query;place_id 或 data_cid 选择地点查询,两者互斥,type 必须与所选模式一致。data_cid 必须保留为十进制字符串,范围 1–18446744073709551615。地点查询不允许下表中的搜索专用过滤参数。latitude 和 longitude 必须同时提供,且不能与 location 同用。m 需要搜索起点且与 zoom 互斥。nearby 即使为 false 也需要起点。min_price 不能大于 max_price。open_state 与 open_on_day、open_at_hour 互斥,open_at_hour 需要 open_on_day,0 表示午夜。gl 为两个字母国家代码,hl 为两至三个字母语言代码,可加两至四个字母后缀。不注入默认值,每个字符串最多 8192 字符。start 是偏移量,通常为 0、20、40,每页最多 20 个结果。
search: query; type = search (optional)place: place_id XOR data_cid; type = place (optional); data_cid: 1..18446744073709551615 (string)place: NOT latitude, longitude, location, zoom, m, start, nearby, min_price, max_price, min_rating, open_state, open_on_day, open_at_hourorigin (optional): (latitude AND longitude) XOR location; m => (coordinates OR location) AND NOT zoom; nearby => coordinates OR locationmin_price <= max_price; open_at_hour => open_on_day; open_state => NOT open_on_day AND NOT open_at_hourgl: /^[a-z]{2}$/i; hl: /^[a-z]{2,3}(?:-[a-z]{2,4})?$/i; string.length <= 8192
示例
curl --get "https://api.apihop.ai/v1/google-maps/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=coffee shop" \
--data-urlencode "latitude=30.2672" \
--data-urlencode "longitude=-97.7431" \
--data-urlencode "start=0"curl --get "https://api.apihop.ai/v1/google-maps/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "data_cid=2982629209513831130" \
--data-urlencode "hl=en"响应与错误
保留原生 JSON 响应和数字精度。下方仅为空成功结果示例,不是真实调用。HTTP 400 表示输入无效;401 需要认证;402 余额不足;403 不可用或无权限;405 方法不支持;429 限流;5xx 服务或上游故障。请保留 X-Request-Id 以便排查。
{
"success": true,
"request_id": "example-request",
"data": {
"format": "json",
"content": {
"search_parameters": {
"q": "coffee shop",
"type": "maps",
"engine": "google_maps"
},
"has_next_page": false,
"results": []
}
}
}