/api/v4/locationsTampilkan semua lokasi
Mengembalikan daftar lokasi di akun Anda dengan paginasi berbasis cursor.
Parameter
Query
| Nama | Tipe | Wajib | Deskripsi | Default |
|---|---|---|---|---|
| first | integer | opsional | Number of records to fetch from the start of the connection (forward pagination). Combine with `after`. | 50 |
| last | integer | opsional | Number of records to fetch from the end of the connection (backward pagination). Combine with `before`. | — |
| after | string | opsional | Cursor to fetch records after. Pass `pageInfo.endCursor` from the previous page. | — |
| before | string | opsional | 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 | opsional | JSON-encoded filter object to narrow the result set (e.g. by approval status or sync state). | — |
Respons
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.
Menelusuri setiap lokasi di akun Anda halaman demi halaman. Hasil diurutkan berdasarkan tanggal pembuatan (terbaru terlebih dahulu). Setiap edge memuat cursor (token base64 opak yang, untuk lokasi, jika didekode menghasilkan Location:<databaseId>) dan node yang berisi catatan lokasi lengkap.
Kasus penggunaan: sinkronkan setiap lokasi ke sistem Anda sendiri. Mulai dengan ?first=50, baca pageInfo.hasNextPage, dan jika true, minta halaman berikutnya dengan ?first=50&after=<pageInfo.endCursor>. Ulangi hingga hasNextPage bernilai false. Untuk melanjutkan backfill dari ujung yang berlawanan, gunakan last + before dengan cursor dari edge pertama pada halaman yang menjadi titik awal Anda bergerak mundur. id dalam format base64 pada node adalah pengenal yang diharapkan oleh setiap endpoint lainnya; gunakan pengenal tersebut untuk mendapatkan lokasi berdasarkan ID, asisten suara, atau memperbarui lokasi.
Kasus penggunaan: sebagian data yang difilter. Sertakan objek yang dikodekan dalam JSON pada filter untuk membatasi cakupan koneksi di sisi server (misalnya berdasarkan status persetujuan), alih-alih mengambil setiap halaman dan memfilternya di sisi klien. Dengan demikian, akun besar tetap berada dalam batas laju permintaan.
Hal yang perlu diperhatikan terkait paginasi + batas laju permintaan: cursor bersifat opak: jangan pernah membuatnya secara manual; selalu kirim ulang cursor yang dikembalikan API, baik pageInfo.endCursor saat bergerak maju maupun cursor milik edge itu sendiri saat bergerak mundur (pageInfo tidak memiliki startCursor). Gunakan salah satu pasangan, first/after (maju) atau last/before (mundur), bukan kedua arah sekaligus. Perulangan paginasi dengan jeda yang sangat singkat merupakan penyebab paling umum respons 429; patuhi header Retry-After dan hindari mengirim permintaan untuk lebih dari satu halaman yang masih diproses pada saat yang sama.
Setiap lokasi mengembalikan placeActionLinks (tautan tindakan Google yang dikelola Listings API) dan discoveredPlaceActionLinks (tautan yang ditemukan langsung di profil Google bisnis tersebut dan belum dikelola). Lihat panduan Place Action Links untuk mengetahui cara membaca, mengadopsi, dan mengelolanya.
curl -X GET 'https://listingsapi.com/api/v4/locations' \ -H "Authorization: API $LISTINGSAPI_KEY"