Google 포토 라이브러리 API의 기존 문서를 보고 계신 것입니다.
Method: mediaItems.batchGet
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThis API endpoint \u003ccode\u003eGET https://photoslibrary.googleapis.com/v1/mediaItems:batchGet\u003c/code\u003e retrieves a list of media items for specified identifiers, returning them in the order requested.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003emediaItemIds\u003c/code\u003e query parameter containing a list of media item identifiers, with a maximum of 50 items per request.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a \u003ccode\u003emediaItemResults\u003c/code\u003e array, which contains the retrieved media items and any associated errors that may have occurred during retrieval.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is required using one of the following OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary\u003c/code\u003e, \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary.readonly\u003c/code\u003e, or \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata\u003c/code\u003e.\u003c/p\u003e\n"]]],["This document details how to retrieve media items using the `batchGet` method. Key actions involve sending a `GET` request to `https://photoslibrary.googleapis.com/v1/mediaItems:batchGet` with specific `mediaItemIds` as query parameters. The request body must be empty. The response contains a list of `mediaItemResults`, each including a `mediaItem` object or a `status` object indicating retrieval success or failure. Authorization requires specific OAuth scopes. A maximum of 50 media items can be retrieved per request.\n"],null,["# Method: mediaItems.batchGet\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.BatchGetMediaItemsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [MediaItemResult](#MediaItemResult)\n - [JSON representation](#MediaItemResult.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReturns the list of media items for the specified media item identifiers. Items are returned in the same order as the supplied identifiers.\n\n### HTTP request\n\n`GET https://photoslibrary.googleapis.com/v1/mediaItems:batchGet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mediaItemIds[]` | `string` Required. Identifiers of the media items to be requested. Must not contain repeated identifiers and cannot be empty. The maximum number of media items that can be retrieved in one call is 50. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse to retrieve a list of media items.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"mediaItemResults\": [ { object (/photos/library/legacy/reference/rest/v1/mediaItems/batchGet#MediaItemResult) } ] } ``` |\n\n| Fields ||\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mediaItemResults[]` | `object (`[MediaItemResult](/photos/library/legacy/reference/rest/v1/mediaItems/batchGet#MediaItemResult)`)` Output only. List of media items retrieved. Note that even if the call to mediaItems.batchGet succeeds, there may have been failures for some media items in the batch. These failures are indicated in each [MediaItemResult.status](/photos/library/legacy/reference/rest/v1/mediaItems/batchGet#MediaItemResult.FIELDS.status). |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/photoslibrary`\n- `\n https://www.googleapis.com/auth/photoslibrary.readonly`\n- `\n https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata`\n\nMediaItemResult\n---------------\n\nResult of retrieving a media item.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"status\": { object (/photos/library/legacy/reference/rest/v1/Status) }, \"mediaItem\": { object (/photos/library/legacy/reference/rest/v1/mediaItems#MediaItem) } } ``` |\n\n| Fields ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `status` | `object (`[Status](/photos/library/legacy/reference/rest/v1/Status)`)` If an error occurred while accessing this media item, this field is populated with information related to the error. For details regarding this field, see [Status](/photos/library/legacy/reference/rest/v1/Status). |\n| `mediaItem` | `object (`[MediaItem](/photos/library/legacy/reference/rest/v1/mediaItems#MediaItem)`)` Media item retrieved from the user's library. It's populated if no errors occurred and the media item was fetched successfully. |"]]