L'API
Google Business Performance ha un metodo
NOVITÀ che consente di recuperare più `dailyMetrics` in un'unica richiesta API.
Consulta il
calendario del ritiro e le istruzioni per eseguire la migrazione dal metodo API ReportInsights della versione 4 all'API Performance di Google Profilo.
Method: accounts.locations.list
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Elenca le località dell'account specificato.
Richiesta HTTP
GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations
L'URL utilizza la sintassi di transcodifica gRPC.
Parametri del percorso
Parametri |
parent |
string
Il nome dell'account da cui recuperare le posizioni. Se l'Account è di AccountType PERSONALE, vengono restituite solo le Sedi che sono di proprietà diretta dell'Account, altrimenti verranno restituite tutte le sedi accessibili dall'Account, direttamente o indirettamente.
|
Parametri di query
Parametri |
pageSize |
integer
Il numero di sedi da recuperare per pagina. Il valore predefinito è 100, il minimo è 1 e la dimensione massima della pagina è 100.
|
pageToken |
string
Se specificato, consente di recuperare le page posizioni successive. Il token di pagina viene restituito dalle chiamate precedenti a locations.list quando sono presenti più sedi di quelle che potrebbero rientrare nelle dimensioni di pagina richieste.
|
filter |
string
Un filtro vincola le località da restituire. La risposta include solo le voci che corrispondono al filtro. Se il campo filter è vuoto, vengono applicati i vincoli e vengono recuperate tutte le località (suddivise in pagine) per l'account richiesto. Per ulteriori informazioni sui campi validi e sull'utilizzo di esempio, consulta la Guida all'utilizzo dei dati sulla posizione.
|
languageCode (deprecated) |
string
Il codice della lingua BCP 47 in cui visualizzare le proprietà della località. Se questa lingua non è disponibile, verranno forniti nella lingua della località. Se nessuno dei due è disponibile, verrà fornito in inglese. Deprecato. Dopo il 15 agosto 2020, questo campo non verrà più applicato. Verrà invece sempre utilizzata la lingua della località.
|
orderBy |
string
Ordinamento della richiesta. Più campi devono essere separati da virgole, secondo la sintassi SQL. L'ordinamento predefinito è crescente. Per specificare l'ordine decrescente, un suffisso " disc" aggiungere. I campi validi per orderBy sono locationName e storeCode. Ad esempio: "locationName, storeCode desc" o "locationName" o "storeCode desc"
|
Corpo della richiesta
Il corpo della richiesta deve essere vuoto.
Corpo della risposta
In caso di esito positivo, il corpo della risposta contiene dati con la seguente struttura:
Messaggio di risposta per locations.ListLocations.
Rappresentazione JSON |
{
"locations": [
{
object (Location )
}
],
"nextPageToken": string,
"totalSize": integer
} |
Campi |
locations[] |
object (Location )
Le località.
|
nextPageToken |
string
Se il numero di sedi supera le dimensioni di pagina richieste, questo campo viene compilato con un token per recuperare la pagina successiva di sedi in una chiamata successiva a locations.list . Se non sono presenti altre località, questo campo non è presente nella risposta.
|
totalSize |
integer
Il numero approssimativo di località nell'elenco, indipendentemente dall'impaginazione.
|
Ambiti di autorizzazione
Richiede uno dei seguenti ambiti OAuth:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
Per ulteriori informazioni, consulta la panoramica di OAuth 2.0.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[[["\u003cp\u003eLists all accessible locations for a specified Google My Business account, including directly or indirectly owned locations based on account type.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering, pagination, and sorting of location data through query parameters like \u003ccode\u003efilter\u003c/code\u003e, \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, and \u003ccode\u003eorderBy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReturns a list of locations with details like location name, store code, and other properties, along with pagination information if applicable.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes for accessing and managing business data.\u003c/p\u003e\n"],["\u003cp\u003eProvides a total count of locations irrespective of pagination for easier management and understanding of the data set.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.locations.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListLocationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n\nLists the locations for the specified account.\n\n### HTTP request\n\n`GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` The name of the account to fetch locations from. If the [Account](/my-business/reference/rest/v4/accounts#Account) is of [AccountType](/my-business/reference/rest/v4/accounts#Account.AccountType) PERSONAL, only Locations that are directly owned by the Account are returned, otherwise it will return all accessible locations from the Account, either directly or indirectly. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` How many locations to fetch per page. Default is 100, minimum is 1, and maximum page size is 100. |\n| `pageToken` | `string` If specified, it fetches the next `page` of locations. The page token is returned by previous calls to `locations.list` when there were more locations than could fit in the requested page size. |\n| `filter` | `string` A filter constraining the locations to return. The response includes only entries that match the filter. If `filter` is empty, then constraints are applied and all locations (paginated) are retrieved for the requested account. For more information about valid fields and example usage, see [Work with Location Data Guide](https://developers.google.com/my-business/content/location-data#filter_results_when_you_list_locations). |\n| `languageCode` **(deprecated)** | `string` The BCP 47 code of language to get display location properties in. If this language is not available, they will be provided in the language of the location. If neither is available, they will be provided in English. Deprecated. After August 15th, 2020, this field will no longer be applied. Instead, the language of the location will always be used. |\n| `orderBy` | `string` Sorting order for the request. Multiple fields should be comma-separated, following SQL syntax. The default sorting order is ascending. To specify descending order, a suffix \" desc\" should be added. Valid fields to orderBy are locationName and storeCode. For example: \"locationName, storeCode desc\" or \"locationName\" or \"storeCode desc\" |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for Locations.ListLocations.\n\n| JSON representation ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"locations\": [ { object (/my-business/reference/rest/v4/accounts.locations#Location) } ], \"nextPageToken\": string, \"totalSize\": integer } ``` |\n\n| Fields ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `locations[]` | `object (`[Location](/my-business/reference/rest/v4/accounts.locations#Location)`)` The locations. |\n| `nextPageToken` | `string` If the number of locations exceeded the requested page size, this field is populated with a token to fetch the next page of locations on a subsequent call to `locations.list`. If there are no more locations, this field is not present in the response. |\n| `totalSize` | `integer` The approximate number of Locations in the list irrespective of pagination. |\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/plus.business.manage`\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]