Method: mediaItems.list
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eLists all media items from a user's Google Photos library using the \u003ccode\u003elistMediaItems\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eAllows pagination with \u003ccode\u003epageSize\u003c/code\u003e and \u003ccode\u003epageToken\u003c/code\u003e parameters to retrieve large sets of media items.\u003c/p\u003e\n"],["\u003cp\u003eReturns an array of \u003ccode\u003eMediaItem\u003c/code\u003e objects containing information about each media item.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes like \u003ccode\u003ephotoslibrary\u003c/code\u003e or \u003ccode\u003ephotoslibrary.readonly\u003c/code\u003e for authorization.\u003c/p\u003e\n"],["\u003cp\u003eFunctionality for interacting with media items not created by the app will be limited after March 31, 2025.\u003c/p\u003e\n"]]],["This content outlines how to list media items from a user's Google Photos library using the Photos API. Key actions involve sending a `GET` HTTP request to `https://photoslibrary.googleapis.com/v1/mediaItems`, with an empty request body. Optional query parameters include `pageSize` (default 25, max 100) and `pageToken` for pagination. The successful response is a JSON object containing an array of `mediaItems` and an optional `nextPageToken`. Authorization requires specific OAuth scopes. Note that beginning March 31, 2025, media access will be limited.\n"],null,["# Method: mediaItems.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListMediaItemsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nList all media items created by your app from a user's Google Photos library.\n\n### HTTP request\n\n`GET https://photoslibrary.googleapis.com/v1/mediaItems`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` Maximum number of media items to return in the response. Fewer media items might be returned than the specified number. The default `pageSize` is 25, the maximum is 100. |\n| `pageToken` | `string` A continuation token to get the next page of the results. Adding this to the request returns the rows after the `pageToken`. The `pageToken` should be the value returned in the `nextPageToken` parameter in the response to the `listMediaItems` request. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nList of all media items from the user's Google Photos library.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"mediaItems\": [ { object (/photos/library/reference/rest/v1/mediaItems#MediaItem) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mediaItems[]` | `object (`[MediaItem](/photos/library/reference/rest/v1/mediaItems#MediaItem)`)` Output only. List of media items in the user's library. |\n| `nextPageToken` | `string` Output only. Token to use to get the next set of media items. Its presence is the only reliable indicator of more media items being available in the next request. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `\n https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata`"]]