هذا المنتج أو هذه الميزة في حالة "قديم". لمزيد من المعلومات عن الحالة "قديمة"، يُرجى الاطّلاع على المنتجات والميزات القديمة. لنقل البيانات إلى Places API (الإصدار الجديد)، يُرجى الاطّلاع على دليل نقل البيانات.
Place Photos (إصدار قديم)، وهو جزء من Places API، هو واجهة برمجة تطبيقات للقراءة فقط تتيح لك إضافة محتوى فوتوغرافي عالي الجودة إلى تطبيقك. تتيح لك ميزة "صور الأماكن" (الإصدار القديم) الوصول إلى ملايين الصور المخزّنة في قاعدة بيانات "الأماكن". عند الحصول على معلومات عن مكان باستخدام طلب Place Details، سيتم عرض مراجع الصور للمحتوى الفوتوغرافي ذي الصلة. تعرض طلبات البحث عن "مكان" (الإصدار القديم) و"البحث عن أماكن قريبة" (الإصدار القديم) و"البحث النصي" (الإصدار القديم) أيضًا مرجعًا واحدًا للصورة لكل مكان، عند الاقتضاء. باستخدام Place Photos (الإصدار القديم)، يمكنك بعد ذلك الوصول إلى الصور المشار إليها وتغيير حجم الصورة إلى الحجم الأمثل لتطبيقك.
طلبات "صور المكان" (الإصدار القديم)
طلب "صور الأماكن" (الإصدار القديم) هو عنوان URL بتنسيق HTTP على النحو التالي:
يجب توفّر مَعلمات معيّنة لبدء طلب بحث. وكما هو معتاد في عناوين URL، يتم الفصل بين جميع المَعلمات باستخدام رمز العطف اللاتيني (&). في ما يلي قائمة بالمعلمات وقيمها المحتملة.
Required parameters
photo_reference
A string identifier that uniquely identifies a photo. Photo references are
returned from either a Place Search or Place Details request.
maxheight or maxwidth
maxheight 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.
maxwidth 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 maxheight and maxwidth properties
accept an integer between 1 and 1600.
You must specify either maxheight, or maxwidth, or both.
مراجع الصور
يجب أن تتضمّن جميع الطلبات إلى Place Photos (الإصدار القديم) photo_reference،
يتم عرضها في الردّ على طلب Find Place (الإصدار القديم) أو Nearby Search (الإصدار القديم) أو
Text Search (الإصدار القديم) أو Place Details (الإصدار القديم). ستتضمّن الاستجابة لهذه الطلبات الحقل photos[] إذا كان المكان يتضمّن محتوًى فوتوغرافيًا ذا صلة.
ملاحظة: يختلف عدد الصور التي يتم عرضها حسب الطلب.
يعرض طلب Find Place (الإصدار القديم) أو Nearby Search (الإصدار القديم) أو Text Search (الإصدار القديم) عنصر photo واحدًا على الأكثر في المصفوفة.
يعرض طلب "تفاصيل المكان (الإصدار القديم)" ما يصل إلى عشرة عناصر photo.
يحتوي كل عنصر photo على الحقول التالية:
photo_reference: سلسلة تُستخدَم لتحديد الصورة عند تنفيذ طلب "صور الأماكن" (الإصدار القديم).
height: الحد الأقصى لارتفاع الصورة
width: الحد الأقصى لعرض الصورة
html_attributions[]: يحتوي على أي معلومات مطلوبة عن المصدر. سيكون هذا الحقل متاحًا دائمًا، ولكن قد يكون فارغًا.
يتم الحصول على الصور التي تعرضها ميزة "صور الأماكن" (الإصدار القديم) من مجموعة متنوعة من المصادر، بما في ذلك مالكو الأنشطة التجارية والصور التي يساهم بها المستخدمون. في معظم الحالات، يمكن استخدام هذه الصور بدون الإشارة إلى المصدر، أو سيتم تضمين الإشارة المطلوبة إلى المصدر كجزء من الصورة. ومع ذلك، إذا كان العنصر photo الذي تم عرضه يتضمّن قيمة في الحقل html_attributions، عليك تضمين معلومات إضافية عن مصدر الصورة في تطبيقك في أي مكان تعرض فيه الصورة.
.
يوضّح المثال التالي طلبًا للحصول على تفاصيل المكان (الإصدار القديم):
تاريخ التعديل الأخير: 2025-09-04 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-09-04 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Place Photos (Legacy)\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n**Note: Server-side\nand client-side libraries**\n\nThe Places API is also available with the\n[Java Client,\nPython Client, Go Client and Node.js Client for Google Maps Services](/maps/documentation/places/web-service/client-library).\nThe Places API and the client libraries are for\nuse in server applications.\n\nLooking to use this service in a JavaScript application? Take\na look at the\n[Places Library, Maps JavaScript API](/maps/documentation/javascript/places).\n\nPlace Photos (Legacy), part of the Places API, is a read-\nonly API that lets you add high quality photographic content to your\napplication. Place Photos (Legacy) gives you access to the millions of photos\nstored in the Places database. When you get place information using a Place\nDetails request, photo references will be returned for relevant photographic\ncontent. Find Place (Legacy), Nearby Search (Legacy), and Text Search (Legacy)\nrequests also return a single photo reference per place, when relevant. Using\nPlace Photos (Legacy) you can then access the referenced photos and resize the\nimage to the optimal size for your application.\n\nPlace Photos (Legacy) requests\n------------------------------\n\nA Place Photos (Legacy) request is an HTTP URL of the following form: \n\n```text\nhttps://maps.googleapis.com/maps/api/place/photo?parameters\n```\n\nCertain parameters are required to initiate a search request. As is standard\nin URLs, all parameters are separated using the ampersand (`&`) character. The\nlist of parameters and their possible values are enumerated below.\n\n\nRequired parameters\n-------------------\n\n-\n\n ### photo_reference\n\n\n A string identifier that uniquely identifies a photo. Photo references are\n returned from either a Place Search or Place Details request.\n-\n\n ### maxheight or maxwidth\n\n `maxheight` specifies the maximum desired height, in pixels, of the image. If the\n image is smaller than the values specified, the original image will be\n returned. If the image is larger in either dimension, it will be scaled to\n match the smaller of the two dimensions, restricted to its original aspect\n ratio.\n\n `maxwidth` specifies the maximum desired width, in pixels, of the image. If the\n image is smaller than the values specified, the original image will be returned.\n If the image is larger in either dimension, it will be scaled to match the\n smaller of the two dimensions, restricted to its original aspect ratio.\n\n\n Both the `maxheight` and `maxwidth` properties\n accept an integer between `1` and `1600`.\n\n\n You must specify either `maxheight`, or `maxwidth`, or both.\n\n\u003cbr /\u003e\n\nPhoto references\n----------------\n\nAll requests to Place Photos (Legacy) must include a `photo_reference`,\nreturned in the response to a Find Place (Legacy), Nearby Search (Legacy),\nText Search (Legacy), or Place Details (Legacy) request. The response to these\nrequests will contain a `photos[]` field if the place has related photographic\ncontent.\n\n**Note:** The number of photos returned varies by request.\n\n- A Find Place (Legacy), Nearby Search (Legacy), or Text Search (Legacy) request returns at most one `photo` element in the array.\n- A Place Details (Legacy) request returns up to ten `photo` elements.\n\nEach `photo` element contains the following fields:\n\n- `photo_reference` --- a string used to identify the photo when you perform a Place Photos (Legacy) request.\n- `height` --- the maximum height of the image.\n- `width` --- the maximum width of the image.\n- `html_attributions[]` --- contains any required attributions. This field will always be present, but may be empty.\n\nPhotos returned by Place Photos (Legacy) are sourced from a variety of locations,\nincluding business owners and user contributed photos. In most cases, these\nphotos can be used without attribution, or will have the required attribution\nincluded as a part of the image. However, if the returned `photo` element\nincludes a value in the `html_attributions` field, you must include the\nadditional attribution in your application wherever you display the image.\n| **Caution:** You cannot cache a `photo_reference`. Also, a `photo_reference` can expire. Ensure that you always get the `photo_reference` from the response to a request to [Place Details (Legacy)](/maps/documentation/places/web-service/details), [Find Place (Legacy)](/maps/documentation/places/web-service/search-find-place), [Nearby Search (Legacy)](/maps/documentation/places/web-service/search-nearby), or [Text Search (Legacy)](/maps/documentation/places/web-service/search-text). For more information, see the caching restrictions stated in Section 5.4 of the [Google Maps Platform Service Specific\n| Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms)\n\nThe following example shows a Place Details (Legacy) request: \n\n```\ncurl \"https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJcUElzOzMQQwRLuV30nMUEUM&key=YOUR_API_KEY\"\n```\n\nAn example of the `photos[]` array in the response is shown below. \n\n ...\n \"photos\" : [\n {\n \"html_attributions\" : [],\n \"height\" : 853,\n \"width\" : 1280,\n \"photo_reference\" : \"ATJ83zhSSAtkh5LTozXMhBghqubeOxnZWUV2m7Hv2tQaIzKQJgvZk9yCaEjBW0r0Zx1oJ9RF1G7oeM34sQQMOv8s2zA0sgGBiyBgvdyMxeVByRgHUXmv-rkJ2wyvNv17jyTSySm_-_6R2B0v4eKX257HOxvXlx_TSwp2NrICKrZM2d5d2P4q\"\n }]\n ...\n\nPlace Photos (Legacy) example\n-----------------------------\n\nAn example request is shown below. This request returns the referenced\nimage, resizing it so that it is at most 400 pixels wide. \n\n```html\nhttps://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photo_reference=ATJ83zhSSAtkh5LTozXMhBghqubeOxnZWUV2m7Hv2tQaIzKQJgvZk9yCaEjBW0r0Zx1oJ9RF1G7oeM34sQQMOv8s2zA0sgGBiyBgvdyMxeVByRgHUXmv-rkJ2wyvNv17jyTSySm_-_6R2B0v4eKX257HOxvXlx_TSwp2NrICKrZM2d5d2P4q&key=YOUR_API_KEY\n```\n| **Note:** Replace the API key in this example with your own API key for the request to work in your application.\n\nPlace Photos (Legacy) response\n------------------------------\n\nThe response of a successful Place Photos (Legacy) request is an image. The type\nof the image depends upon the type of the originally submitted photo.\n\nIf your request exceeds your available quota, the server returns an\nHTTP 403 status and displays the below image to indicate that the quota has\nbeen exceeded:\n\nIf the server is unable to understand your request, then it returns HTTP 400\nstatus, which indicates an invalid request. The most common reasons for an\ninvalid request include:\n\n- The submitted photo reference was not correctly specified.\n- The request did not include either the `maxwidth` or the `maxheight` parameters.\n- The value for either the `maxwidth` or the `maxheight` parameter was set to `null`.\n- The `photo_reference` has expired. If `photo_reference` expires, make a request to [Place Details (Legacy)](/maps/documentation/places/web-service/details), [Find Place (Legacy)](/maps/documentation/places/web-service/search-find-place), [Nearby Search (Legacy)](/maps/documentation/places/web-service/search-nearby), or [Text Search (Legacy)](/maps/documentation/places/web-service/search-text) to get the updated `photo_reference` value."]]