/api/v4/locations列出所有地点
返回您账户中按游标分页的地点列表。
参数
查询
| 名称 | 类型 | 必填 | 描述 | 默认值 |
|---|---|---|---|---|
| first | integer | 可选 | Number of records to fetch from the start of the connection (forward pagination). Combine with `after`. | 50 |
| last | integer | 可选 | Number of records to fetch from the end of the connection (backward pagination). Combine with `before`. | — |
| after | string | 可选 | Cursor to fetch records after. Pass `pageInfo.endCursor` from the previous page. | — |
| before | string | 可选 | Cursor to fetch records before, used with `last`. Pass the `cursor` of the first edge of the page you are moving back from. `pageInfo` carries no `startCursor` field, so the edge cursor is the value to use. | — |
| filter | string | 可选 | JSON-encoded filter object to narrow the result set (e.g. by approval status or sync state). | — |
响应
200Cursor-paginated connection of locations. Each edge exposes a `cursor` and a `node` (the full location).
{ "data": { "allLocations": { "edges": [ { "cursor": "TG9jYXRpb246MTgwMDI4OQ==", "node": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "databaseId": 1800289, "accountId": 12345, "accountName": "owner@brightsmile-dental.com", "name": "Jenny Home", "approved": "APPROVED", "archived": false, "archivalScheduledAt": null, "archivedAt": null, "street": "600 Congress Ave, Suite 200", "city": "Austin", "stateIso": "TX", "stateName": "Texas", "postalCode": "78701", "countryIso": "US", "countryCode": "1", "latitude": "30.2711286", "longitude": "-97.7436995", "phone": "5125550142", "additionalPhones": [], "bizUrl": null, "hideAddress": false, "storeId": null, "categoryId": 15, "subCategoryId": 1432, "subCategoryName": "Restaurants", "additionalCategoryIds": [], "additionalCategoryNames": [], "description": "This is a standalone duplex house. A comfortable, private residence located in the Bouldin Creek neighborhood of Austin, offering spacious duplex living with easy access to the surrounding South Congress area and downtown Austin.", "businessHours": [], "package": "PREMIUM", "planId": 3797, "planName": "Launch", "temporarilyClosed": false, "ownerEmail": null, "ownerName": null, "googleVerificationStatus": { "status": "NOT_CONNECTED", "message": null }, "voiceStatus": 3, "uid": "3c92283c-6145-4a43-8a62-0c15fd712021", "createdDate": "July 06, 2026", "lastUpdatedDate": "July 06, 2026", "updatedAt": "2026-07-06T18:33:29.664Z", "placeActionLinks": [ { "placeActionType": "FOOD_ORDERING", "uri": "https://order.example.com", "isPreferred": true, "name": "locations/1944.../placeActionLinks/54ada85bc246058a", "submissionStatus": "success", "submissionMessage": "Already up to date on Google.", "lastSubmittedAt": "2026-07-08T12:14:36Z" } ], "discoveredPlaceActionLinks": [ { "placeActionType": "APPOINTMENT", "uri": "https://book.example.com", "isPreferred": false, "name": "locations/1944.../placeActionLinks/abc123", "providerType": "MERCHANT", "isEditable": true } ] } } ], "pageInfo": { "hasNextPage": false, "hasPreviousPage": false, "endCursor": "TG9jYXRpb246MTgwMDI4OQ==", "total": 1 } } }}401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.
分页遍历您账户中的每个地点。结果按创建日期排序(最新的在前)。每条边都包含一个 cursor(不透明的 base64 令牌,对于地点,其解码结果为 Location:<databaseId>)和一个保存完整地点记录的 node。
使用场景:将每个地点同步到您自己的系统。 从 ?first=50 开始,读取 pageInfo.hasNextPage,如果为 true,则使用 ?first=50&after=<pageInfo.endCursor> 请求下一页。重复此过程,直到 hasNextPage 为 false。要从另一端继续回填,请使用 last + before,并传入当前页第一条边的 cursor,以向前翻页。节点的 base64 id 是所有其他端点所需的标识符,请将其传给按 ID 获取地点、语音助手或更新地点。
使用场景:获取筛选后的子集。 在 filter 中传入 JSON 编码的对象,在服务端筛选结果(例如按审批状态),不必拉取所有页面后在客户端筛选。这样可使大型账户的请求保持在速率限制以内。
分页与速率限制注意事项:游标是不透明的:切勿手动构造游标;始终原样发送 API 返回的游标:获取下一页时使用 pageInfo.endCursor,返回上一页时使用边自身的 cursor(pageInfo 没有 startCursor)。请使用 first/after(往后翻页)或 last/before(往前翻页),不要同时使用两个方向。不加间隔的分页循环是导致 429 响应的最常见原因;请遵循 Retry-After 响应头,并且同一时间只请求一个页面。
每个地点都会返回 placeActionLinks(Listings API 管理的 Google 操作链接)和 discoveredPlaceActionLinks(直接在商家的 Google 商家资料中发现、尚未纳入管理的链接)。有关如何读取、纳入管理和管理这些链接,请参阅地点操作链接指南。
curl -X GET 'https://listingsapi.com/api/v4/locations' \ -H "Authorization: API $LISTINGSAPI_KEY"