این محصول یا ویژگی در وضعیت Legacy است. برای اطلاعات بیشتر درباره وضعیت Legacy به محصولات و ویژگی های Legacy مراجعه کنید. برای انتقال به Places API (جدید)، به راهنمای مهاجرت مراجعه کنید.
Place Photos (Legacy)، بخشی از Places API، یک API فقط خواندنی است که به شما امکان می دهد محتوای عکاسی با کیفیت بالا را به برنامه خود اضافه کنید. Place Photos (Legacy) به شما امکان دسترسی به میلیون ها عکس ذخیره شده در پایگاه داده Places را می دهد. وقتی اطلاعات مکان را با استفاده از درخواست جزئیات مکان دریافت میکنید، مراجع عکس برای محتوای عکاسی مربوطه بازگردانده میشوند. درخواستهای Find Place (Legacy)، Nearby Search (Legacy) و Text Search (Legacy) نیز در صورت مرتبط بودن، یک مرجع عکس را در هر مکان برمیگردانند. با استفاده از Place Photos (Legacy) می توانید به عکس های ارجاع شده دسترسی داشته باشید و اندازه تصویر را به اندازه مطلوب برای برنامه خود تغییر دهید.
درخواستهای عکسهای مکان (میراث).
درخواست Place Photos (Legacy) یک 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.
مراجع عکس
همه درخواستهای مربوط به عکسهای مکان (میراث) باید شامل یک photo_reference باشد که در پاسخ به درخواست «یافتن مکان» (میراث)، «جستجوی نزدیک» (میراث)، «جستجوی متنی» (میراث)، یا «جزئیات مکان» (میراث) ارائه میشود. اگر مکان دارای محتوای عکاسی مرتبط باشد، پاسخ به این درخواستها شامل یک قسمت photos[] خواهد بود.
توجه: تعداد عکس های برگشتی بر اساس درخواست متفاوت است.
درخواست Find Place (Legacy)، Nearby Search (Legacy)، یا Text Search (Legacy) حداکثر یک عنصر photo را در آرایه برمی گرداند.
درخواست جزئیات مکان (میراث) تا ده عنصر photo را برمی گرداند.
هر عنصر photo حاوی فیلدهای زیر است:
photo_reference - رشتهای که برای شناسایی عکس هنگام انجام درخواست Place Photos (Legacy) استفاده میشود.
height - حداکثر ارتفاع تصویر.
width - حداکثر عرض تصویر.
html_attributions[] - شامل هر گونه اسناد مورد نیاز است. این فیلد همیشه وجود خواهد داشت، اما ممکن است خالی باشد.
عکسهای برگردانده شده توسط Place Photos (میراث) از مکانهای مختلف، از جمله صاحبان کسبوکار و عکسهای ارائهشده توسط کاربر، تهیه شدهاند. در بیشتر موارد، این عکسها را میتوان بدون ذکر منبع استفاده کرد یا به عنوان بخشی از تصویر، ارجاع مورد نیاز را در نظر گرفت. با این حال، اگر عنصر photo برگشتی دارای مقداری در فیلد html_attributions باشد، باید هرجا که تصویر را نمایش میدهید، انتساب اضافی را در برنامه خود وارد کنید.
مثال زیر یک درخواست جزئیات مکان (میراث) را نشان می دهد:
یک نمونه درخواست در زیر نشان داده شده است. این درخواست تصویر ارجاع شده را برمی گرداند و اندازه آن را طوری تغییر می دهد که حداکثر 400 پیکسل عرض داشته باشد.
تاریخ آخرین بهروزرسانی 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."]]