Truy xuất thông tin chi tiết về vị trí
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hướng dẫn này sẽ cho bạn biết cách truy xuất các chỉ số vị trí trong Trang doanh nghiệp.
API Google Doanh nghiệp của tôi cho phép bạn làm việc với các chỉ số vị trí để truy xuất các loại dữ liệu sau:
Trước khi bắt đầu
Trước khi sử dụng API Google Doanh nghiệp của tôi, bạn cần đăng ký ứng dụng và lấy thông tin xác thực OAuth 2.0. Để biết thông tin chi tiết về cách bắt đầu sử dụng API Google Doanh nghiệp của tôi, hãy xem phần Thiết lập cơ bản.
Thông tin chi tiết được hỗ trợ
Để biết thông tin chi tiết được hỗ trợ, hãy xem trang tham khảo về Chỉ số.
Thông tin chi tiết cơ bản
Truy xuất thông tin chi tiết cơ bản cho một danh sách vị trí nhất định. Sử dụng API accounts.locations.reportInsights
để trả về thông tin chi tiết liên kết với một vị trí.
Để trả về thông tin chi tiết cơ bản liên kết với một vị trí, hãy sử dụng nội dung sau:
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"
}
}
}
Chỉ đường lái xe
Truy xuất các chỉ số về đường đi bằng ô tô cho một danh sách vị trí nhất định. Sử dụng API accounts.locations.reportInsights
để trả về các chỉ số về hướng lái xe được liên kết với một vị trí.
Để trả về các chỉ số về hướng lái xe, hãy sử dụng nội dung sau:
POST
https://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights
{
"locationNames": [
"accounts/{accountId}/locations/{locationId}"
],
"drivingDirectionsRequest": {
"numDays": "NINETY"
}
}
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-29 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eThis tutorial demonstrates how to retrieve location metrics, such as basic insights and driving directions, using the Google My Business API.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, you'll need to register your application and obtain OAuth 2.0 credentials as outlined in the basic setup guide.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve basic insights like direct and indirect queries for specific locations within a defined timeframe using the \u003ccode\u003eaccounts.locations.reportInsights\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eDriving direction metrics, including data for the past 90 days, can also be retrieved using the \u003ccode\u003eaccounts.locations.reportInsights\u003c/code\u003e API with a driving directions request.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the Metric reference page for a comprehensive list of supported insights available through the Google My Business API.\u003c/p\u003e\n"]]],[],null,["# Retrieve location insights\n\n\u003cbr /\u003e\n\nThis tutorial shows you how to retrieve location metrics in Business Profile.\nThe Google My Business API provides you with the ability to work with location\nmetrics to retrieve the following types of data:\n\n- [Supported insights](#supported_insights)\n- [Basic insights](#basic_insights)\n- [Driving directions](#driving_directions)\n\nBefore you begin\n----------------\n\nBefore you use the Google My Business API, you need to register your application\nand obtain OAuth 2.0 credentials. For details on how to get started with the\nGoogle My Business API, see [Basic setup](/my-business/content/basic-setup).\n\nSupported insights\n------------------\n\nFor supported insights, see the [Metric](/my-business/reference/rest/v4/Metric)\nreference page.\n\nBasic insights\n--------------\n\nRetrieves basic insights for a given list of locations. Use the [`accounts.locations.reportInsights`](/my-business/reference/rest/v4/accounts.locations/reportInsights)\nAPI to return the insights that are associated with a location.\n\nTo return the basic insights associated with a location, use the following:\nHTTP \n\n```\nPOST\nhttps://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights\n{\n \"locationNames\": [\n \"accounts/{accountId}/locations/{locationId}\"\n ],\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"QUERIES_DIRECT\"\n },\n {\n \"metric\": \"QUERIES_INDIRECT\"\n }\n ],\n \"timeRange\": {\n \"startTime\": \"2016-10-12T01:01:23.045123456Z\",\n \"endTime\": \"2017-01-10T23:59:59.045123456Z\"\n }\n }\n}\n```\n\nDriving directions\n------------------\n\nRetrieves driving direction metrics for a given list of locations. Use the\n[`accounts.locations.reportInsights`](/my-business/reference/rest/v4/accounts.locations/reportInsights)\nAPI to return driving direction metrics that are associated with a location.\n\nTo return the driving direction metrics, use the following:\nHTTP \n\n```\nPOST\nhttps://mybusiness.googleapis.com/v4/accounts/{accountId}/locations:reportInsights\n{\n \"locationNames\": [\n \"accounts/{accountId}/locations/{locationId}\"\n ],\n \"drivingDirectionsRequest\": {\n \"numDays\": \"NINETY\"\n }\n}\n```"]]