Interfejs
Google Business Performance API udostępnia
NOWĄ metodę interfejsu API, która umożliwia pobieranie wielu parametrów „DailyMetrics” w jednym żądaniu API.
Zapoznaj się z
harmonogramem wycofywania i instrukcjami, jak przejść z metody raportu API w wersji 4 na interfejs Google Business Profile Performance API.
Pobieranie statystyk lokalizacji
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Z tego samouczka dowiesz się, jak pobrać dane o lokalizacji w Profilu Firmy.
Interfejs Google My Business API umożliwia pracę z danymi o lokalizacji, aby pobierać te typy danych:
Zanim zaczniesz
Zanim użyjesz interfejsu Google Moja Firma API, musisz zarejestrować aplikację i uzyskać poświadczenia OAuth 2.0. Szczegółowe informacje o tym, jak zacząć korzystać z interfejsu Google My Business API, znajdziesz w artykule Konfiguracja podstawowa.
Obsługiwane statystyki
Informacje o obsługiwanych funkcjach znajdziesz na stronie z informacjami o danych.
Podstawowe statystyki
Pobiera podstawowe statystyki dotyczące podanej listy lokalizacji. Użyj interfejsu API accounts.locations.reportInsights
, aby pobrać statystyki powiązane z lokalizacją.
Aby uzyskać podstawowe statystyki powiązane z lokalizacją, użyj tych opcji:
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights
{
"locationNames": [
"accounts/{accountId}/locations/{locationId}"
],
"basicRequest": {
"metricRequests": [
{
"metric": "QUERIES_DIRECT"
},
{
"metric": "QUERIES_INDIRECT"
}
],
"timeRange": {
"startTime": "2016-10-12T01:01:23.045123456Z",
"endTime": "2017-01-10T23:59:59.045123456Z"
}
}
}
Trasa dojazdu
Pobiera dane dotyczące wskazówek dojazdu do podanej listy lokalizacji. Użyj interfejsu API accounts.locations.reportInsights
, aby zwrócić dane o kierunkach jazdy powiązane z lokalizacją.
Aby zwrócić dane dotyczące wskazówek dojazdu, użyj tych opcji:
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights
{
"locationNames": [
"accounts/{accountId}/locations/{locationId}"
],
"drivingDirectionsRequest": {
"numDays": "NINETY"
}
}
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-01-29 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-01-29 UTC."],[[["This tutorial demonstrates how to retrieve location metrics, such as basic insights and driving directions, using the Google My Business API."],["Before using the API, you'll need to register your application and obtain OAuth 2.0 credentials as outlined in the basic setup guide."],["You can retrieve basic insights like direct and indirect queries for specific locations within a defined timeframe using the `accounts.locations.reportInsights` API."],["Driving direction metrics, including data for the past 90 days, can also be retrieved using the `accounts.locations.reportInsights` API with a driving directions request."],["Refer to the Metric reference page for a comprehensive list of supported insights available through the Google My Business API."]]],[]]