GET
/api/v4/locations-by-ids依 ID 取得地點
在單一請求中傳回指定一組地點 ID 的完整地點資訊。
參數
查詢
| 名稱 | 類型 | 必填 | 說明 | 預設值 |
|---|---|---|---|---|
| ids | string | 必填 | JSON-encoded array of base64 location IDs, e.g. `["TG9jYXRpb246MTgwMDI4OQ=="]`. URL-encode the value. | — |
回應
200Array of full location objects, one per resolved ID. Unknown IDs are omitted.
{ "data": { "getLocationsByIds": [ { "id": "TG9jYXRpb246MTgwMDI4OQ==", "databaseId": 1800289, "accountId": 12345, "storeId": null, "name": "Jenny Home", "archived": false, "archivedAt": null, "street": "600 Congress Ave, Suite 200", "city": "Austin", "stateIso": "TX", "postalCode": "78701", "countryIso": "US", "countryCode": "1", "latitude": "30.2711286", "longitude": "-97.7436995", "phone": "5125550142", "additionalPhones": [], "bizUrl": null, "hideAddress": false, "categoryId": 15, "subCategoryId": 1432, "subCategoryName": "Restaurants", "additionalCategoryIds": [], "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.", "contentPreferredLanguage": "ENGLISH", "businessHours": [], "moreHours": [], "package": "PREMIUM", "planId": 3797, "planName": "Launch", "temporarilyClosed": false, "ownerName": null, "ownerEmail": null, "paymentMethods": [], "locationPhotos": [], "isRestaurant": true, "voiceStatus": 3, "yearOfIncorporation": null, "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 } ] } ] }}401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.
在單一請求中擷取特定一組 ID 的完整地點詳細資料,成本遠低於針對每個地點各執行一次 GET。啟用中和已封存的地點都能查得。請將 ID 編碼為 JSON 陣列並做 URL 編碼,再透過 ids 查詢參數傳入。
使用案例:為來自 webhook 或工作的整批 ID 補齊資料。 當您收到地點 ID 清單(來自您自己的資料儲存區、webhook 承載資料,或逐頁擷取的地點清單)時,可一次查得所有地點:?ids=["TG9jYXRpb246MTgwMDI4OQ==","TG9jYXRpb246MTgwMDI5MA=="]。您帳戶中不存在的 ID 會直接從陣列中略過,不會發出通知,也不會引發錯誤,因此請比較傳回的數量與您請求的數量,以找出已失效的 ID。
注意事項:查詢鍵為 ids。 此端點會從 ids 參數讀取 JSON 陣列。相較於以迴圈逐筆查詢,將多個 ID 合併至單次呼叫,可讓您的請求頻率維持在遠低於速率限制的水準;如果您確實要平行發出請求,請在收到 429 時遵循 Retry-After 標頭。
每個地點都會傳回 placeActionLinks(由 Listings API 管理的 Google 動作連結)和 discoveredPlaceActionLinks(直接在商家的 Google 商家檔案上找到、尚未納入管理的連結)。請參閱地點動作連結指南。
Request
curl -X GET 'https://listingsapi.com/api/v4/locations-by-ids?ids=<ids>' \ -H "Authorization: API $LISTINGSAPI_KEY"