คุณกำลังดูเอกสารประกอบเดิมสำหรับ Google Photos Library API
ภาพรวมของ Library API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แอปใช้ Google Photos Library API เพื่ออ่าน เขียน และแชร์รูปภาพและวิดีโอใน
Google Photos ได้
Library API เป็น RESTful API ที่มีเพย์โหลด JSON โครงสร้างของ API นี้จะอิงตามแนวคิดผลิตภัณฑ์ของ Google Photos ดังนี้
- คลังภาพ: สื่อที่เก็บไว้ในบัญชี Google Photos ของผู้ใช้
- อัลบั้ม: คอลเล็กชันสื่อซึ่งสามารถ
แชร์กับผู้ใช้รายอื่นได้
- รายการสื่อ: รูปภาพ วิดีโอ และข้อมูลเมตา
- การแชร์: ฟีเจอร์ที่ช่วยให้ผู้ใช้
แชร์สื่อกับผู้ใช้คนอื่นๆ ได้
การให้สิทธิ์
Library API ใช้ OAuth 2.0 เพื่อจัดการการให้สิทธิ์ เช่นเดียวกับ Google REST API อื่นๆ
แอปของคุณจะขอสิทธิ์เข้าถึงคลังภาพ Google Photos ของผู้ใช้ผ่านขอบเขตการให้สิทธิ์ต่างๆ ที่ API มีให้ได้
โปรดทราบว่า Library API ไม่รองรับบัญชีบริการ หากต้องการใช้ API นี้ ผู้ใช้ต้องลงชื่อเข้าใช้บัญชี Google ที่ถูกต้อง
การใช้ Library API
ก่อนที่จะเริ่มพัฒนาแอป โปรดคำนึงถึงสิ่งต่อไปนี้
สำรวจ API
หากต้องการลองใช้ Library API โดยไม่ต้องเขียนโค้ด ให้ใช้ API Explorer ที่มีอยู่ในเอกสารอ้างอิง
ต่อไปนี้เป็นวิธีการบางส่วนสำหรับลองใช้ API Explorer
ดูตัวอย่างโค้ดที่แสดงฟีเจอร์สำคัญบางส่วนของ Library API
โปรแกรมพาร์ทเนอร์
คุณผสานรวมกับ Google Photos Library API ได้โดยไม่ต้องเข้าร่วมโปรแกรมพาร์ทเนอร์
อย่างไรก็ตาม หากแอปมีแนวโน้มที่จะมีโควต้าการใช้งานทั่วไปเกินระดับที่กำหนดไว้ โปรดแสดงความสนใจในโปรแกรมพาร์ทเนอร์ของ Google Photos
ดูข้อมูลเพิ่มเติม
จุดบางส่วนที่ควรไปจากที่นี่:
- เริ่มต้นใช้งาน: กำหนดค่าโปรเจ็กต์และลองใช้ตัวอย่าง
- คำแนะนำ: คำแนะนำวิธีใช้และแนวคิดต่างๆ เกี่ยวกับการใช้ Library API
- ข้อมูลอ้างอิง: เอกสารอ้างอิง API
- การสนับสนุน: ตัวเลือกการสนับสนุน
สำหรับการขอความช่วยเหลือหรือแสดงความคิดเห็น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eThe Google Photos Library API allows your app to read, write, and share photos and videos stored in Google Photos.\u003c/p\u003e\n"],["\u003cp\u003eIt uses a RESTful API with JSON payload and OAuth 2.0 for authorization, requiring users to be signed in to a Google Account.\u003c/p\u003e\n"],["\u003cp\u003eBefore developing your app, review the acceptable use policy, UX guidelines, and API limits and quotas.\u003c/p\u003e\n"],["\u003cp\u003eExplore the API through the API Explorer or by checking out the provided code samples.\u003c/p\u003e\n"],["\u003cp\u003eConsider joining the Google Photos partner program if your app is likely to exceed the general availability quota limit.\u003c/p\u003e\n"]]],["The Google Photos Library API enables apps to interact with Google Photos content, reading, writing, and sharing photos and videos. It's a RESTful API using JSON payloads, organized around libraries, albums, media items, and sharing. Access requires OAuth 2.0 authorization via specific scopes, and service accounts are not supported. Developers should adhere to usage policies, UX guidelines, and quotas. The API can be explored through the API Explorer, and code samples are available. Those who need more quota should apply to the Google Photos partner program.\n"],null,["# Library API overview\n\nUsing the Google Photos Library API your app can read, write, and share photos and videos in\nGoogle Photos.\n\nThe Library API is a [RESTful\nAPI](/photos/library/legacy/guides/about-restful-apis) with JSON payload. The structure\nof the API is based on the product concepts of Google Photos:\n\n- [Library](/photos/library/legacy/guides/list): media stored in the user's Google Photos account.\n- [Albums](/photos/library/legacy/guides/manage-albums): media collections which can be shared with other users.\n- [Media items](/photos/library/legacy/guides/access-media-items): photos, videos, and their metadata.\n- [Sharing](/photos/library/legacy/guides/share-media): feature that enables users to share their media with other users.\n\nAuthorization\n-------------\n\nLike other Google REST APIs, the Library API uses [OAuth\n2.0](/identity/protocols/OAuth2) to handle authorization.\nYour app can request access to the user's Google Photos library via the\nvarious [authorization\nscopes](/photos/library/legacy/guides/authorization) provided by the\nAPI.\n\nNote that the Library API does not support service accounts; to use this\nAPI, users must be signed in to a valid Google Account.\n\nUsing the Library API\n---------------------\n\nBefore you get started on your app development, keep the following in mind:\n\n- [Acceptable use policy](/photos/library/legacy/guides/acceptable-use)\n- [UX guidelines](/photos/library/legacy/guides/ux-guidelines) for designing your app\n- The Library API [limits and\n quotas](/photos/library/legacy/guides/api-limits-quotas)\n\nExplore the API\n---------------\n\nTo try out the Library API without writing any code, use the API Explorer\navailable in the reference documentation.\n\nHere are some methods to try using the API Explorer:\n\n- [List](/photos/library/legacy/reference/rest/v1/albums/list) your albums.\n- Apply filters to a [media item\n search](/photos/library/legacy/reference/rest/v1/mediaItems/search).\n\nCheck out our [code sample](/photos/library/samples) that shows some of the key\nfeatures of the Library API.\n\nPartner program\n---------------\n\nYou can integrate with the Google Photos Library API without joining the partner program.\nHowever, if your app is likely to exceed the general availability [quota\nlimit](/photos/library/legacy/guides/api-limits-quotas), express interest in the [Google Photos\npartner program](/photos/partner-program).\n\nLearn more\n----------\n\nSome places to go from here:\n\n- [Get started](/photos/library/legacy/guides/get-started): configure your project and try out the sample.\n- [Guides](/photos/library/legacy/guides/list): the how-to guides and concepts around using the Library API.\n- [Reference](/photos/library/reference): the API reference documentation\n- [Support](/photos/library/support/how-to-get-help): the support options for requesting help or giving feedback."]]