Google Business Performance API มีเมธอด API
ใหม่ที่อนุญาตให้ดึง `DailyMetrics` หลายรายการในคําขอ API รายการเดียว
ตรวจสอบ
กําหนดการเลิกใช้งานและวิธีการย้ายข้อมูลจากเมธอด v4 reportInsights API ไปยัง API ประสิทธิภาพของ Google Business Profile
Method: accounts.locations.list
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงสถานที่ตั้งสำหรับบัญชีที่ระบุ
คำขอ HTTP
GET https://mybusiness.googleapis.com/v4/{parent=accounts/*}/locations
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
parent |
string
ชื่อบัญชีที่จะดึงข้อมูลสถานที่ หาก Account มาจาก AccountType ส่วนบุคคล ระบบจะส่งคืนเฉพาะสถานที่ที่บัญชีเป็นเจ้าของโดยตรงเท่านั้น มิฉะนั้นจะแสดงสถานที่ที่เข้าถึงได้ทั้งหมดจากบัญชี ไม่ว่าจะโดยตรงหรือโดยอ้อม
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
pageSize |
integer
จำนวนสถานที่ที่จะดึงข้อมูลต่อ 1 หน้า ค่าเริ่มต้นคือ 100, ต่ำสุดคือ 1 และขนาดสูงสุดของหน้าเว็บคือ 100
|
pageToken |
string
หากระบุไว้ ระบบจะดึงสถานที่ตั้ง page แห่งถัดไป โทเค็นของหน้าเว็บจะส่งคืนจากการเรียกไปยัง locations.list ครั้งก่อน เมื่อมีสถานที่มากเกินกว่าจะพอดีกับขนาดหน้าที่ร้องขอ
|
filter |
string
ตัวกรองที่จำกัดสถานที่ตั้งที่จะส่งคืน การตอบกลับมีเฉพาะรายการที่ตรงกับตัวกรอง หาก filter ว่างเปล่า ระบบจะใช้ข้อจำกัดและเรียกข้อมูลสถานที่ตั้งทั้งหมด (ใส่เลขหน้า) สำหรับบัญชีที่ขอ สำหรับข้อมูลเพิ่มเติมเกี่ยวกับช่องที่ถูกต้องและการใช้งานตัวอย่าง โปรดดูคู่มือการใช้ข้อมูลตำแหน่ง
|
languageCode (deprecated) |
string
รหัสภาษา BCP 47 ที่ใช้รับพร็อพเพอร์ตี้ตำแหน่งที่แสดง หากภาษานี้ไม่พร้อมใช้งาน ก็จะให้บริการเป็นภาษาของสถานที่นั้น หากไม่มีทั้ง 2 รูปแบบ ระบบจะให้บริการเป็นภาษาอังกฤษ เลิกใช้งานแล้ว หลังจากวันที่ 15 สิงหาคม 2020 ระบบจะไม่ใช้ช่องนี้อีกต่อไป แต่ระบบจะใช้ภาษาของสถานที่ตั้งนั้นๆ แทนเสมอ
|
orderBy |
string
กำลังจัดเรียงคำขอ ช่องหลายช่องควรคั่นด้วยคอมมาโดยใช้ไวยากรณ์ SQL ต่อไปนี้ ลำดับการจัดเรียงเริ่มต้นคือจากน้อยไปมาก หากต้องการระบุลำดับจากมากไปน้อย ให้ใส่คำต่อท้าย " มากไปน้อย" ควรเพิ่มลงไป ฟิลด์ที่ใช้ได้สำหรับ orderBy คือ locationName และ storeCode ตัวอย่างเช่น: "locationName, storeCode desc" หรือ "locationName" หรือ "คำอธิบายรหัสร้านค้า"
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
ข้อความตอบกลับสำหรับ Locations.ListLocations
การแสดง JSON |
{
"locations": [
{
object (Location )
}
],
"nextPageToken": string,
"totalSize": integer
} |
ช่อง |
locations[] |
object (Location )
สถานที่
|
nextPageToken |
string
ถ้าจำนวนสถานที่ตั้งเกินขนาดหน้าเว็บที่ขอ ฟิลด์นี้จะมีโทเค็นเพื่อดึงข้อมูลหน้าถัดไปของสถานที่ตั้งในการเรียก locations.list ครั้งต่อๆ ไป หากไม่มีตำแหน่งเพิ่มเติม ช่องนี้จะไม่ปรากฏในคำตอบ
|
totalSize |
integer
จำนวนตำแหน่งโดยประมาณในรายการโดยไม่คำนึงถึงการใส่เลขหน้า
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth รายการใดรายการหนึ่งต่อไปนี้
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
สำหรับข้อมูลเพิ่มเติม โปรดดูที่ภาพรวมของ OAuth 2.0
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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)."]]