最后更新
更新日志/search_places5 credits per call搜索地点
在 Google Maps 上按文本查询搜索某个位置周边的地点(查询可以是地点名称、商家类型,或两者兼有,例如 "Archetype Coffee"、"pizza"、"hotels in Paris")。最多返回约 20 个地点,包含名称、place_id、地址、坐标、类别、评分、评论数、电话、网站、营业时间等(Google 未提供的字段为 null)。
Authorization: Bearer <key> on every request.Parameters
what to search for; may contain a place name, a category, or an address/city
latitude of the map centre used to bias results (default central London)
longitude of the map centre used to bias results
approximate search area radius in metres around lat/lng
number of results to skip, for paging (20 per page: 0, 20, 40, ...)
language code for the results, e.g. "en", "de"
country code for the results, e.g. "us", "gb"
Response fields
querye.g."coffee"counte.g.20places
namee.g."Archetype Coffee"place_ide.g."ChIJ32WYJnsbdkgR1FckbQTtMk8"feature_ide.g."0x48761b7b269865df:0x4f32ed046d2457d4"addresse.g."31 Riding House St, London W1W 7DY, United Kingdom"address_partslate.g.51.518557699999995lnge.g.-0.1409618categoriesratinge.g.4.9reviews_counte.g.425price_levelphonewebsitedescriptionhours
Fridaye.g."8:30 AM–4 PM"Saturdaye.g."10 AM–4 PM"Sundaye.g."10 AM–4 PM"Mondaye.g."8 AM–4 PM"Tuesdaye.g."8 AM–4 PM"Wednesdaye.g."8 AM–4 PM"Thursdaye.g."8 AM–4 PM"open_statuse.g."Closed · Opens 10 AM Sat"timezonee.g."Europe/London"neighborhoode.g."London, United Kingdom"thumbnaile.g."https://lh3.googleusercontent.com/grass-cs/AABkmLdTXy00y2JYJaNoIyu5GUCxrVjA7NjlpnQgPY5QfJy02o1fOe6k_u3Mv2QHsStBIW-XO7L7To8JjHxaPgPOIUZSFnqiBgakCOwr9KR43JKXmAMV8ef7_gJn57xyXi9hZzvBvwV78Q=w80-h106-k-no"google_maps_urle.g."https://www.google.com/maps/place/?q=place_id:ChIJ32WYJnsbdkgR1FckbQTtMk8"curl "https://api.maviapi.com/v1/sites/maps-google/search_places?query=coffee&lat=51.5072&lng=-0.1276&radius_m=5000&offset=0&hl=en&gl=us" \-H "Authorization: Bearer $MAVI_KEY"
{
"query": "coffee",
"count": 20,
"places": [
{
"name": "Archetype Coffee",
"place_id": "ChIJ32WYJnsbdkgR1FckbQTtMk8",
"feature_id": "0x48761b7b269865df:0x4f32ed046d2457d4",
"address": "31 Riding House St, London W1W 7DY, United Kingdom",
"address_parts": [
"31 Riding House St"
],
"lat": 51.518557699999995,
"lng": -0.1409618,
"categories": [
"Coffee shop"
],
"rating": 4.9,
"reviews_count": 425,
"price_level": null,
"phone": null,
"website": null,
"description": null,
"hours": {
"Friday": "8:30 AM–4 PM",
"Saturday": "10 AM–4 PM",
"Sunday": "10 AM–4 PM",
"Monday": "8 AM–4 PM",
"Tuesday": "8 AM–4 PM",
"Wednesday": "8 AM–4 PM",
"Thursday": "8 AM–4 PM"
},
"open_status": "Closed · Opens 10 AM Sat",
"timezone": "Europe/London",
"neighborhood": "London, United Kingdom",
"thumbnail": "https://lh3.googleusercontent.com/grass-cs/AABkmLdTXy00y2JYJaNoIyu5GUCxrVjA7NjlpnQgPY5QfJy02o1fOe6k_u3Mv2QHsStBIW-XO7L7To8JjHxaPgPOIUZSFnqiBgakCOwr9KR43JKXmAMV8ef7_gJn57xyXi9hZzvBvwV78Q=w80-h106-k-no",
"google_maps_url": "https://www.google.com/maps/place/?q=place_id:ChIJ32WYJnsbdkgR1FckbQTtMk8"
}
]
}Get all the data, no code
Collect every page of GET /search_places into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use Google Maps API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of Google Maps API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=maps-google -- npx -y '@maviapi/mcp'Import Google Maps API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/maps-google/openapi.json - Postman
https://api.maviapi.com/v1/apis/maps-google/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
使用 Google Maps API 进行开发
选择一个端点开始
- 搜索地点
GET /search_places在 Google Maps 上按文本查询搜索某个位置周边的地点(查询可以是地点名称、商家类型,或两者兼有,例如 "Archetype Coffee"、"pizza"、"hotels in Paris")。最多返回约 20 个地点,包含名称、place_id、地址、坐标、类别、评分、评论数、电话、网站、营业时间等(Google 未提供的字段为 null)。
GET /search_places 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 query string / query 否 what to search for; may contain a place name, a category, or an address/city lat number / query 否 latitude of the map centre used to bias results (default central London) lng number / query 否 longitude of the map centre used to bias results radius_m number / query 否 approximate search area radius in metres around lat/lng offset integer / query 否 number of results to skip, for paging (20 per page: 0, 20, 40, ...) hl string / query 否 language code for the results, e.g. "en", "de" gl string / query 否 country code for the results, e.g. "us", "gb" 响应字段 字段 类型 说明 query string count integer places object[] places[].name string places[].place_id string places[].feature_id string places[].address string places[].address_parts string[] places[].lat number places[].lng number places[].categories string[] places[].rating number places[].reviews_count integer places[].price_level null places[].phone null places[].website null places[].description null places[].hours object places[].hours.Friday string places[].hours.Saturday string places[].hours.Sunday string places[].hours.Monday string places[].hours.Tuesday string places[].hours.Wednesday string places[].hours.Thursday string places[].open_status string places[].timezone string places[].neighborhood string places[].thumbnail string places[].google_maps_url string - 地点详情 V2
GET /place_details_v2Google Maps 上单个地点的完整详情:包含 place_details 的全部字段(名称、地址、坐标、类别、评分、评论数、电话、网站、营业时间、描述、属性、评论摘录、评论话题、照片 URL),另加 business_status:"OPERATIONAL"、"CLOSED_PERMANENTLY" 或 "CLOSED_TEMPORARILY"(仅在 Google 未显示状态时为 null)。Google 未提供的字段为 null。
GET /place_details_v2 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 place_id string / query 否 Google place ID (e.g. "ChIJ32WYJnsbdkgR1FckbQTtMk8"), as returned in `place_id` by search_places / nearby_places feature_id string / query 否 Google Maps feature ID (e.g. "0x47c6098d7d832a0f:0x9d8f878939adfa9f"), as returned in `feature_id`; when given it is used instead of place_id and the call is faster hl string / query 否 language code for the results, e.g. "en", "de" gl string / query 否 country code for the results, e.g. "us", "gb" 响应字段 字段 类型 说明 name string place_id string feature_id string address string address_parts string[] lat number lng number categories string[] rating number reviews_count integer price_level null phone null website null description null hours object hours.Friday string hours.Saturday string hours.Sunday string hours.Monday string hours.Tuesday string hours.Wednesday string hours.Thursday string open_status string timezone string neighborhood string thumbnail string google_maps_url string owner_description string attributes object attributes.Accessibility object[] attributes.Accessibility[].name string attributes.Accessibility[].available boolean review_snippets object[] review_snippets[].text string review_snippets[].rating integer review_topics object[] review_topics[].topic string review_topics[].mentions integer photos string[] business_status string - 地点详情
GET /place_detailsGoogle Maps 上单个地点的完整详情:名称、地址、坐标、类别、评分、评论数、电话、网站、营业时间、描述、无障碍和设施属性、评论摘录、评论话题和照片 URL(Google 未提供的字段为 null)。
GET /place_details 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 place_id string / query 否 Google place ID (e.g. "ChIJ32WYJnsbdkgR1FckbQTtMk8"), as returned in `place_id` by search_places / nearby_places feature_id string / query 否 Google Maps feature ID (e.g. "0x48761b7b269865df:0x4f32ed046d2457d4"), as returned in `feature_id`; when given it is used instead of place_id and the call is faster hl string / query 否 language code for the results, e.g. "en", "de" gl string / query 否 country code for the results, e.g. "us", "gb" 响应字段 字段 类型 说明 name string place_id string feature_id string address string address_parts string[] lat number lng number categories string[] rating number reviews_count integer price_level null phone null website null description null hours object hours.Friday string hours.Saturday string hours.Sunday string hours.Monday string hours.Tuesday string hours.Wednesday string hours.Thursday string open_status string timezone string neighborhood string thumbnail string google_maps_url string owner_description string attributes object attributes.Accessibility object[] attributes.Accessibility[].name string attributes.Accessibility[].available boolean review_snippets object[] review_snippets[].text string review_snippets[].rating integer review_topics object[] review_topics[].topic string review_topics[].mentions integer photos string[] - 附近地点
GET /nearby_places指定经纬度附近某一类型的地点,每页最多约 20 个,每个地点包含名称、place_id、地址、坐标、到给定点的距离 distance_m、类别、评分、评论数、电话、网站、营业时间等(Google 未提供的字段为 null)。
GET /nearby_places 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 lat number / query 否 latitude of the point to search around (default Times Square, New York) lng number / query 否 longitude of the point to search around category string / query 否 kind of place to look for, e.g. "restaurants", "coffee", "hotels", "pharmacy", "atm", "things to do", "gas station"; may also be a name such as "Starbucks" radius_m number / query 否 approximate radius in metres of the area searched around the point offset integer / query 否 number of results to skip, for paging (20 per page: 0, 20, 40, ...) sort_by_distance boolean / query 否 true to order results nearest first instead of Google's relevance order hl string / query 否 language code for the results, e.g. "en", "de" gl string / query 否 country code for the results, e.g. "us", "gb" 响应字段 字段 类型 说明 lat number lng number category string count integer places object[] places[].name string places[].place_id string places[].feature_id string places[].address string places[].address_parts string[] places[].lat number places[].lng number places[].categories string[] places[].rating number places[].reviews_count integer places[].price_level null places[].phone null places[].website string places[].description string places[].hours object places[].hours.Friday string places[].hours.Saturday string places[].hours.Sunday string places[].hours.Monday string places[].hours.Tuesday string places[].hours.Wednesday string places[].hours.Thursday string places[].open_status string places[].timezone string places[].neighborhood string places[].thumbnail string places[].google_maps_url string places[].distance_m integer
将 Google Maps 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
搜索地点GET /search_places | name, place_id, feature_id, address, address_parts, lat, lng, categories, rating, reviews_count, price_level, phone, website, description, hours, open_status, timezone, neighborhood, thumbnail, google_maps_url |
附近地点GET /nearby_places | name, place_id, feature_id, address, address_parts, lat, lng, categories, rating, reviews_count, price_level, phone, website, description, hours, open_status, timezone, neighborhood, thumbnail, google_maps_url, distance_m |
嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作
Google Maps API 常见问题
能获取什么数据、费用多少、如何调用。
Google Maps 有官方 API 吗?
有,Google Maps 提供自己的 API:Places API (New)(核实日期:2026-11-25)。本页的 Google Maps API 与它无关,是非官方 API:它是 maviapi 针对 maps.google.com 上的公开数据提供的独立托管 API,并非由 Google Maps 开发、认可或支持。
Google Maps API 可以获取哪些数据?
Google Maps API 有 4 个端点。每个端点都返回 JSON,参数和字段见上方的文档:
- GET
/search_places: 在 Google Maps 上按文本查询搜索某个位置周边的地点(查询可以是地点名称、商家类型,或两者兼有,例如 "Archetype Coffee"、"pizza"、"hotels in Paris")。 - GET
/place_details_v2: Google Maps 上单个地点的完整详情:包含 place_details 的全部字段(名称、地址、坐标、类别、评分、评论数、电话、网站、营业时间、描述、属性、评论摘录、评论话题、照片 URL),另加 business_status:"OPERATIONAL"、"CLOSED_PERMANENTLY" 或… - GET
/place_details: Google Maps 上单个地点的完整详情:名称、地址、坐标、类别、评分、评论数、电话、网站、营业时间、描述、无障碍和设施属性、评论摘录、评论话题和照片 URL(Google 未提供的字段为 null)。 - GET
/nearby_places: 指定经纬度附近某一类型的地点,每页最多约 20 个,每个地点包含名称、place_id、地址、坐标、到给定点的距离 distance_m、类别、评分、评论数、电话、网站、营业时间等(Google 未提供的字段为 null)。
Google Maps API 的价格是多少?
调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。此 API 的每个端点每次调用消耗 5 个积分。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.98。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。
如何调用 Google Maps API?
向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /search_places:
curl 'https://api.maviapi.com/v1/sites/maps-google/search_places' \
-H "Authorization: Bearer $MAVI_KEY"在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。
以 JSON 获取 Google Maps 数据有哪些方式?
以 JSON 获取 Google Maps 数据的每种方式适合不同的需求:
- Places API (New): 需要写入权限、账号数据或与 Google Maps 签订协议时更合适。
- 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 maps.google.com 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
- Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
- RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
- maviapi: 本页的 Google Maps API:4 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。
maps.google.com 改版后会怎样?
更新会破坏我的 Google Maps API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 API
- Google API
以 JSON 形式返回 Google 搜索结果:任意查询词的网页排名结果和新闻搜索。
- Google Images API
来自 images.google.com 的结构化数据。
- Tripadvisor API
来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…