مطلوب. اسم مورد لوسائط صورة بالتنسيق: places/{placeId}/photos/{photo_reference}/media.
يظهر اسم المورد لصورة كما هو معروض في حقل photos.name لعنصر "مكان" بالتنسيق places/{placeId}/photos/{photo_reference}. عليك إلحاق /media في نهاية مورد الصورة للحصول على اسم مورد وسائط الصورة.
مَعلمات طلب البحث
المعلمات
maxWidthPx
integer
اختياريّ. تحدّد الحد الأقصى للعرض المطلوب للصورة، بالبكسل. إذا كانت الصورة أصغر من القيم المحدّدة، سيتم عرض الصورة الأصلية. إذا كانت الصورة أكبر في أيّ من سمتَيها، سيتم تصغيرها لتتطابق مع أصغر سمتَيها، مع الاحتفاظ بنسبة العرض إلى الارتفاع الأصلية. تقبل كلّ من السمتَين maxHeightPx وmaxWidthPx عددًا صحيحًا بين 1 و4800، شاملةً. إذا لم تكن القيمة ضمن النطاق المسموح به، سيتم عرض الخطأ INVALID_ARGUMENT.
يجب تحديد سمة واحدة على الأقل من maxHeightPx أو maxWidthPx. إذا لم يتم تحديد maxHeightPx أو maxWidthPx، سيتم عرض خطأ INVALID_ARGUMENT.
maxHeightPx
integer
اختياريّ. تحدّد هذه السمة الحد الأقصى للارتفاع المطلوب للصورة، بالبكسل. إذا كانت الصورة أصغر من القيم المحدّدة، سيتم عرض الصورة الأصلية. إذا كانت الصورة أكبر في أيّ من سمتَيها، سيتم تصغيرها لتتطابق مع أصغر سمتَيها، مع الاحتفاظ بنسبة العرض إلى الارتفاع الأصلية. تقبل كلّ من السمتَين maxHeightPx وmaxWidthPx عددًا صحيحًا بين 1 و4800، شاملةً. إذا لم تكن القيمة ضمن النطاق المسموح به، سيتم عرض الخطأ INVALID_ARGUMENT.
يجب تحديد سمة واحدة على الأقل من maxHeightPx أو maxWidthPx. إذا لم يتم تحديد maxHeightPx أو maxWidthPx، سيتم عرض خطأ INVALID_ARGUMENT.
skipHttpRedirect
boolean
اختياريّ. في حال ضبطه، يمكنك تخطّي السلوك التلقائي لإعادة توجيه HTTP وعرض استجابة بتنسيق نصي (على سبيل المثال، بتنسيق JSON لحالة استخدام HTTP). في حال عدم ضبط هذه القيمة، سيتم إصدار إعادة توجيه HTTP لإعادة توجيه المكالمة إلى وسائط الصور. يتم تجاهل هذا الخيار لطلبات غير HTTP.
نص الطلب
يجب أن يكون نص الطلب فارغًا.
نص الاستجابة
ملف وسائط صورة من Places API
إذا كانت الاستجابة ناجحة، سيحتوي نص الاستجابة على بيانات بالبنية التالية:
تمثيل JSON
{"name": string,"photoUri": string}
الحقول
name
string
اسم مورد لوسائط صورة بالتنسيق: places/{placeId}/photos/{photo_reference}/media.
photoUri
string
عنوان URL صالح لفترة قصيرة يمكن استخدامه لعرض الصورة.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eRetrieve a photo media resource using a specific photo reference string through a GET request.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires a \u003ccode\u003ename\u003c/code\u003e path parameter specifying the photo media resource, formatted as \u003ccode\u003eplaces/{placeId}/photos/{photo_reference}/media\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eOptionally customize the retrieved photo's dimensions using \u003ccode\u003emaxWidthPx\u003c/code\u003e and \u003ccode\u003emaxHeightPx\u003c/code\u003e query parameters, with values ranging from 1 to 4800.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a JSON object containing the photo media's resource name (\u003ccode\u003ename\u003c/code\u003e) and a temporary URI (\u003ccode\u003ephotoUri\u003c/code\u003e) for rendering the photo.\u003c/p\u003e\n"]]],["This outlines how to retrieve photo media using a `GET` request to the specified URL, which requires a photo resource `name` in the path parameters. Optional query parameters `maxWidthPx` and `maxHeightPx` allow for image resizing (1-4800 pixels). `skipHttpRedirect` is another optional parameter. The request body must be empty. The response includes `name` and a short-lived `photoUri` for the photo. Access requires the `cloud-platform` authorization scope.\n"],null,["# Method: places.photos.getMedia\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.PhotoMedia.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n\nGet a photo media with a photo reference string.\n\n### HTTP request\n\n`GET https://places.googleapis.com/v1/{name=places/*/photos/*/media}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The resource name of a photo media in the format: `places/{placeId}/photos/{photo_reference}/media`. The resource name of a photo as returned in a Place object's `photos.name` field comes with the format `places/{placeId}/photos/{photo_reference}`. You need to append `/media` at the end of the photo resource to get the photo media resource name. |\n\n### Query parameters\n\n| Parameters ||\n|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxWidthPx` | `integer` Optional. Specifies the maximum desired width, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the maxHeightPx and maxWidthPx properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned. At least one of maxHeightPx or maxWidthPx needs to be specified. If neither maxHeightPx nor maxWidthPx is specified, an INVALID_ARGUMENT error will be returned. |\n| `maxHeightPx` | `integer` Optional. Specifies the maximum desired height, in pixels, of the image. If the image is smaller than the values specified, the original image will be returned. If the image is larger in either dimension, it will be scaled to match the smaller of the two dimensions, restricted to its original aspect ratio. Both the maxHeightPx and maxWidthPx properties accept an integer between 1 and 4800, inclusively. If the value is not within the allowed range, an INVALID_ARGUMENT error will be returned. At least one of maxHeightPx or maxWidthPx needs to be specified. If neither maxHeightPx nor maxWidthPx is specified, an INVALID_ARGUMENT error will be returned. |\n| `skipHttpRedirect` | `boolean` Optional. If set, skip the default HTTP redirect behavior and render a text format (for example, in JSON format for HTTP use case) response. If not set, an HTTP redirect will be issued to redirect the call to the image media. This option is ignored for non-HTTP requests. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA photo media from Places API.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------|\n| ``` { \"name\": string, \"photoUri\": string } ``` |\n\n| Fields ||\n|------------|---------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The resource name of a photo media in the format: `places/{placeId}/photos/{photo_reference}/media`. |\n| `photoUri` | `string` A short-lived uri that can be used to render the photo. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`"]]