GET/api/v4/locations/{locationId}/posts

Recupera i post per una sede

Restituisce una pagina di campagne di post sui social (annunci, eventi, offerte) destinate a una singola sede.

Richiede una chiave API. Consulta Autenticazione per il formato dell’header e la rotazione delle chiavi.

Parametri

Percorso

NomeTipoObbligatorioDescrizione
locationIdstringobbligatorioBase64-encoded location cursor / global ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). Pass it unchanged, do not URL-encode it. The base64 cursor always resolves; the raw numeric database ID also works on this endpoint, but the base64 form is the portable choice across the API.

Query

NomeTipoObbligatorioDescrizionePredefinito
pageintegerfacoltativo1-based page number for offset pagination.1
perPageintegerfacoltativoNumber of records per page. Must not exceed 50.10

Risposte

200A page of post campaigns for the location, under `data.postsByLocation`. `records` is empty when the location has no posts yet.
Response
{  "data": {    "postsByLocation": {      "records": [        {          "id": "U29jaWFsUG9zdDo0NDEyMg==",          "name": "Summer Hours Update",          "status": "SUCCESS",          "type": "ANNOUNCEMENT",          "createdAt": "2026-06-28",          "scheduledStartDate": "2026-06-28",          "scheduledEndDate": "2026-07-28",          "views": 128,          "clicks": 14,          "shares": 0,          "reactions": 3,          "comments": 1,          "sites": ["GOOGLE"],          "message": [            { "site": "GOOGLE", "message": "We have extended our summer hours! Open until 9pm on weekdays." }          ],          "cta": [            { "type": { "value": "LEARN_MORE", "label": "Learn more" }, "url": "https://jennyhome.example/hours", "site": "GOOGLE", "tinyUrl": "https://tiny.cc/jh-hours" }          ],          "contextInfo": null,          "mediaUrl": [            { "url": "https://cdn.listingsapi.com/posts/44122/summer.jpg", "site": "GOOGLE", "type": "IMAGE" }          ],          "publishDetails": [            { "site": "GOOGLE", "status": "PUBLISHED", "createdDate": "2026-06-28", "publishedDate": "2026-06-28", "submissionError": null }          ],          "postLinks": [            { "site": "GOOGLE", "link": "https://www.google.com/maps/place/?post=44122" }          ],          "locationIds": [1800289],          "clientName": "Jenny Home"        }      ],      "locationDetails": [        {          "id": "TG9jYXRpb246MTgwMDI4OQ==",          "name": "Jenny Home",          "street": "600 Congress Ave, Suite 200",          "city": "Austin",          "postalCode": "78701",          "countryIso": "US",          "stateIso": "TX",          "stateName": "Texas",          "storeId": null        }      ],      "pageInfo": {        "totalPages": 1,        "hasNextPage": false,        "hasPreviousPage": false,        "totalRecords": 1      }    }  }}
401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.

Usa questo endpoint per recuperare la cronologia dei post di un singolo punto vendita: ogni campagna di annunci, eventi e offerte che include la sede, con il relativo status del ciclo di vita e i contatori delle interazioni per ciascun post (views, clicks, reactions).

Caso d'uso: verifica prima di una campagna. Prima di programmare un nuovo post Google per Jenny Home, chiama GET /locations/TG9jYXRpb246MTgwMDI4OQ==/posts per vedere cosa è già pubblicato, quali post sono ancora SCHEDULED e quali risultati ha ottenuto l'ultimo annuncio. Leggi type in ogni record per individuare le offerte; questo endpoint non dispone di un filtro per tipo lato server.

Aspetti da tenere presenti.

  • Gli unici argomenti accettati da questo endpoint sono page e perPage. Qui non sono previsti parametri filters, sortFields, locationIds o componentIdentifier (questi appartengono all'endpoint per i post in blocco), e se ne invii uno viene ignorato anziché rifiutato. Filtra e ordina records restituito nel tuo codice.
  • tag viene rifiutato immediatamente su questa route, con tag is not a supported parameter for this query. Usa l'endpoint per i post in blocco quando devi individuare un insieme di sedi a partire da un tag.
  • perPage ha un limite massimo di 50; un valore superiore causa un errore con per_page must not exceed 50.
  • Passa locationId come cursore base64 (e.g. TG9jYXRpb246MTgwMDI4OQ==) esattamente come viene restituito dagli endpoint di elenco/ricerca, senza applicare la codifica URL.
  • La paginazione è basata su offset: usa page e perPage (valore predefinito 10) e leggi pageInfo.totalPages / pageInfo.totalRecords per sapere quando fermarti.
  • Il polling prolungato può raggiungere il limite di frequenza delle richieste dell'account (HTTP 429); rispetta l'header Retry-After.

L'array records nell'esempio sopra è rappresentativo. La sede precaricata nell'ambiente live (Jenny Home) attualmente non ha post sui social, quindi una chiamata reale restituisce records: [] con pageInfo.totalRecords: 0.

Risorse correlate: crea post con POST /posts, recupera una singola campagna con GET /posts/{postId} oppure elenca le campagne in blocco (per più sedi) con GET /locations/{locationId}/bulk-posts, che accetta filters e sortFields e restituisce la risposta sotto rollupSocialPosts.

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