Method: photos.batchGet
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Yêu cầu HTTP
GET https://streetviewpublish.googleapis.com/v1/photos:batchGet
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Tham số |
photoIds[] |
string
Bắt buộc. Mã của Photos . Đối với các yêu cầu HTTP GET, tham số truy vấn URL phải là photoIds=<id1>&photoIds=<id2>&... .
|
view |
enum (PhotoView )
Bắt buộc. Chỉ định xem có cần trả về URL tải xuống cho các byte ảnh trong Phản hồi ảnh hay không.
|
languageCode |
string
Không bắt buộc. Mã ngôn ngữ BCP-47, chẳng hạn như "en-US" hoặc "sr-Latn". Để biết thêm thông tin, hãy truy cập vào http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. Nếu languageCode không được chỉ định, thì hệ thống sẽ sử dụng lựa chọn ưu tiên về ngôn ngữ của người dùng đối với các dịch vụ của Google.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Phản hồi yêu cầu nhận hàng loạt Photos
.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"results": [
{
object (PhotoResponse )
}
]
} |
Trường |
results[] |
object (PhotoResponse )
Danh sách kết quả cho từng Photo được yêu cầu, theo cùng thứ tự như các yêu cầu trong photos.batchGet .
|
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/streetviewpublish
Để biết thêm thông tin, hãy xem bài viết Tổng quan về OAuth 2.0.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eRetrieves metadata for multiple photos using their IDs via a \u003ccode\u003eGET\u003c/code\u003e request to the specified endpoint.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing photo IDs and view preference via query parameters, and an empty request body.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a list of results, each corresponding to a requested photo, and indicating success or failure.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is required using the \u003ccode\u003ehttps://www.googleapis.com/auth/streetviewpublish\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"],["\u003cp\u003eIf the batch request fails, it may be due to missing fields or authentication errors, while individual photos may have separate failures detailed within the response.\u003c/p\u003e\n"]]],["This document details the process for retrieving metadata of multiple Street View photos via the `photos.batchGet` method. A `GET` request to `https://streetviewpublish.googleapis.com/v1/photos:batchGet` is required. The request must include `photoIds` and a `view` parameter in the query, and optionally a `languageCode`. The request body should be empty. The response body returns a list of `PhotoResponse` objects containing the requested photo metadata. The request requires `https://www.googleapis.com/auth/streetviewpublish` OAuth scope.\n"],null,["# Method: photos.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.BatchGetPhotosResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGets the metadata of the specified [Photo](/streetview/publish/reference/rest/v1/photo#Photo) batch.\n\nNote that if [photos.batchGet](/streetview/publish/reference/rest/v1/photos/batchGet#google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos) fails, either critical fields are missing or there is an authentication error. Even if [photos.batchGet](/streetview/publish/reference/rest/v1/photos/batchGet#google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos) succeeds, individual photos in the batch may have failures. These failures are specified in each [PhotoResponse.status](/streetview/publish/reference/rest/v1/PhotoResponse#FIELDS.status) in [BatchGetPhotosResponse.results](/streetview/publish/reference/rest/v1/photos/batchGet#body.BatchGetPhotosResponse.FIELDS.results). See [photo.get](/streetview/publish/reference/rest/v1/photo/get#google.streetview.publish.v1.StreetViewPublishService.GetPhoto) for specific failures that can occur per photo.\n\n### HTTP request\n\n`GET https://streetviewpublish.googleapis.com/v1/photos:batchGet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `photoIds[]` | `string` Required. IDs of the [Photos](/streetview/publish/reference/rest/v1/photo#Photo). For HTTP GET requests, the URL query parameter should be `photoIds=\u003cid1\u003e&photoIds=\u003cid2\u003e&...`. |\n| `view` | `enum (`[PhotoView](/streetview/publish/reference/rest/v1/PhotoView)`)` Required. Specifies if a download URL for the photo bytes should be returned in the Photo response. |\n| `languageCode` | `string` Optional. The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more information, see \u003chttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier\u003e. If languageCode is unspecified, the user's language preference for Google services is used. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse to batch get of [Photos](/streetview/publish/reference/rest/v1/photo#Photo).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------|\n| ``` { \"results\": [ { object (/streetview/publish/reference/rest/v1/PhotoResponse) } ] } ``` |\n\n| Fields ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `results[]` | `object (`[PhotoResponse](/streetview/publish/reference/rest/v1/PhotoResponse)`)` List of results for each individual [Photo](/streetview/publish/reference/rest/v1/photo#Photo) requested, in the same order as the requests in [photos.batchGet](/streetview/publish/reference/rest/v1/photos/batchGet#google.streetview.publish.v1.StreetViewPublishService.BatchGetPhotos). |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/streetviewpublish`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]