คุณกำลังดูเอกสารประกอบเดิมสำหรับ Google Photos Library API
Method: albums.list
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงอัลบั้มทั้งหมดที่แสดงต่อผู้ใช้ในแท็บอัลบั้มของแอป Google Photos
คำขอ HTTP
GET https://photoslibrary.googleapis.com/v1/albums
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
pageSize |
integer
จำนวนอัลบั้มสูงสุดที่จะแสดงในคำตอบ อาจแสดงผลอัลบั้มน้อยกว่าจำนวนที่ระบุ pageSize เริ่มต้นคือ 20 สูงสุดคือ 50
|
pageToken |
string
โทเค็นต่อเนื่องเพื่อรับผลลัพธ์หน้าถัดไป การเพิ่มข้อมูลนี้ลงในคำขอจะแสดงแถวหลัง pageToken pageToken ควรเป็นค่าที่แสดงผลในพารามิเตอร์ nextPageToken ในการตอบกลับคำขอ listAlbums
|
excludeNonAppCreatedData |
boolean
หากตั้งค่าไว้ ผลลัพธ์จะไม่รวมรายการสื่อที่ไม่ได้สร้างโดยแอปนี้ ค่าเริ่มต้นคือเท็จ (ระบบจะแสดงอัลบั้มทั้งหมด) ระบบจะไม่สนใจช่องนี้หากใช้ขอบเขต photoslibrary.readonly.appcreateddata
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
รายการอัลบั้มที่ขอ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"albums": [
{
object (Album )
}
],
"nextPageToken": string
} |
ช่อง |
albums[] |
object (Album )
เอาต์พุตเท่านั้น รายการอัลบั้มที่แสดงในแท็บอัลบั้มของแอป Google Photos ของผู้ใช้
|
nextPageToken |
string
เอาต์พุตเท่านั้น โทเค็นที่จะใช้เพื่อรับอัลบั้มชุดถัดไป จะป้อนข้อมูลหากมีอัลบั้มที่จะเรียกเพิ่มเติมสำหรับคำขอนี้
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth รายการใดรายการหนึ่งต่อไปนี้
https://www.googleapis.com/auth/photoslibrary
https://www.googleapis.com/auth/photoslibrary.readonly
https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eLists all albums displayed in the user's Google Photos Albums tab using the \u003ccode\u003eGET https://photoslibrary.googleapis.com/v1/albums\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eAllows pagination with \u003ccode\u003epageSize\u003c/code\u003e and \u003ccode\u003epageToken\u003c/code\u003e query parameters to control the number of albums returned and retrieve subsequent pages.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a list of \u003ccode\u003ealbums\u003c/code\u003e and a \u003ccode\u003enextPageToken\u003c/code\u003e for further navigation if available.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with one of the specified OAuth scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary\u003c/code\u003e, for access.\u003c/p\u003e\n"],["\u003cp\u003eCan exclude non-app created data using the \u003ccode\u003eexcludeNonAppCreatedData\u003c/code\u003e parameter or the \u003ccode\u003ephotoslibrary.readonly.appcreateddata\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["To retrieve a user's albums from Google Photos, send a `GET` request to `https://photoslibrary.googleapis.com/v1/albums`. The request body must be empty. Optional query parameters include `pageSize` (default 20, max 50), `pageToken` for pagination, and `excludeNonAppCreatedData`. The response contains an array of album objects and `nextPageToken` for subsequent requests. Authorization requires one of three specified OAuth scopes.\n"],null,[]]