GET/api/v4/locations

列出所有地點

傳回您帳戶中以游標分頁的地點清單。

需要 API 金鑰。標頭格式與金鑰輪替請參閱驗證。

參數

查詢

名稱類型必填說明預設值
firstinteger選填Number of records to fetch from the start of the connection (forward pagination). Combine with `after`.50
lastinteger選填Number of records to fetch from the end of the connection (backward pagination). Combine with `before`.—
afterstring選填Cursor to fetch records after. Pass `pageInfo.endCursor` from the previous page.—
beforestring選填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.—
filterstring選填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).
Response
{  "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.

逐頁列出您帳戶中的每個地點。結果依建立日期排序(最新的在前)。每個 edge 都包含一個 cursor(不透明的 base64 權杖,對地點而言,解碼後為 Location:<databaseId>),以及一個內含完整地點記錄的 node。

使用案例:將每個地點同步到您自己的系統。 從 ?first=50 開始,讀取 pageInfo.hasNextPage,若為 true,則使用 ?first=50&after=<pageInfo.endCursor> 請求下一頁。重複此步驟,直到 hasNextPage 為 false。若要從另一端繼續回填,請使用 last + before,並帶入您目前所在頁面第一個 edge 的 cursor,往回翻頁。node 的 base64 id 是所有其他端點所需的識別碼,請將它傳入依 ID 取得地點、語音助理或更新地點。

使用案例:篩選後的部分資料。 在 filter 中傳入以 JSON 編碼的物件,即可在伺服器端限定連線的資料範圍(例如依核准狀態),而不必擷取每一頁後再於用戶端篩選。這可讓大型帳戶的請求維持在速率限制內。

分頁與速率限制的注意事項:游標是不透明值,切勿自行組出;一律重新傳送 API 傳回的游標,向前翻頁時使用 pageInfo.endCursor,向後翻頁時則使用 edge 本身的 cursor(pageInfo 沒有 startCursor)。請使用 first/after(向前)或 last/before(向後),不要同時使用兩個方向。密集執行分頁迴圈是造成 429 回應最常見的原因;請遵循 Retry-After 標頭,並避免同時有超過 1 個頁面請求尚未完成。

每個地點都會傳回 placeActionLinks(Listings API 管理的 Google 動作連結)和 discoveredPlaceActionLinks(直接在商家的 Google 商家檔案上找到、但尚未納入管理的連結)。如需瞭解如何讀取、納入管理及管理這些連結,請參閱地點動作連結指南。

Request
curl -X GET 'https://listingsapi.com/api/v4/locations' \  -H "Authorization: API $LISTINGSAPI_KEY"