پوشاندن میدان مورد نیاز است. شما باید مشخص کنید که کدام فیلدها را می خواهید در پاسخ بازگردانید. هیچ لیست پیش فرضی از فیلدهای برگشتی وجود ندارد. اگر این لیست را حذف کنید، متدها با خطا مواجه می شوند. برای اطلاعات بیشتر، FieldMask را ببینید.
جزئیات مکان (جدید) از کلیدهای API و نشانههای OAuth به عنوان مکانیزم احراز هویت پشتیبانی میکند.
فقط JSON به عنوان قالب پاسخ در جزئیات مکان (جدید) پشتیبانی می شود.
قالب پاسخ JSON برای Places API (جدید) از قالب APIهای قدیمی تغییر کرده است. برای جزئیات بیشتر، به انتقال پاسخ API Places مراجعه کنید.
جدول زیر پارامترهایی را در جزئیات مکان (میراث) که برای جزئیات مکان (جدید) تغییر نام داده یا تغییر یافته اند، یا پارامترهایی که دیگر پشتیبانی نمی شوند، فهرست می کند.
پارامتر فعلی
پارامتر جدید
یادداشت ها
place_id
places/ PLACE_ID
رشته places/ PLACE_IDنام منبع مکان نیز نامیده میشود. در پاسخ از یک درخواست جزئیات مکان (جدید)، جستجوی نزدیک (جدید)، و جستجوی متن (جدید)، این رشته در قسمت name پاسخ موجود است. شناسه مکان مستقل در قسمت id پاسخ موجود است.
language
languageCode
region
regionCode
درخواست نمونه
مثال زیر درخواست GET از جزئیات مکان (میراث) استفاده می کند. در این مثال، شما یک پاسخ JSON حاوی اطلاعات مربوط به شناسه مکان درخواست میکنید و همه پارامترها را به عنوان پارامترهای URL ارسال میکنید. این مثال همچنین از fields استفاده می کند، بنابراین پاسخ فقط شامل نام نمایشی و آدرس قالب بندی شده مکان است:
curl -L -X GET \
'https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJj61dQgK6j4AR4GeTYWZsKWw&fields=name%2Cformatted_address&key=API_KEY'
با جزئیات مکان (جدید)، شما یک درخواست GET می کنید و تمام پارامترها را در پارامترهای URL و هدرها به عنوان بخشی از درخواست ارسال می کنید. این مثال همچنین از یک فیلد ماسک استفاده می کند، بنابراین پاسخ فقط شامل نام نمایشی و آدرس فرمت شده مکان است:
رشته places/ PLACE_IDنام منبع مکان نیز نامیده میشود. در پاسخ از یک درخواست جزئیات مکان (جدید)، جستجوی نزدیک (جدید)، و جستجوی متن (جدید)، این رشته در قسمت name پاسخ موجود است. شناسه مکان مستقل در قسمت id پاسخ موجود است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Migrate to Place Details (New)\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\nIntroduction\n------------\n\nPlaces API supports\n[Place Details (Legacy)](/maps/documentation/places/web-service/details).\nIf you are familiar with Places API (Legacy), [Place Details (New)](/maps/documentation/places/web-service/place-details)\nmakes the following changes:\n\n- Field masking is required. You must specify which fields you want returned in the response. There is no default list of returned fields. If you omit this list, the methods return an error. For more information, see [FieldMask](/maps/documentation/places/web-service/place-details#fieldmask).\n- Place Details (New) supports both [API keys](/maps/documentation/places/web-service/get-api-key) and [OAuth](/maps/documentation/places/web-service/oauth-token) tokens as the authentication mechanism.\n- Only JSON is supported as a response format in Place Details (New).\n- The JSON response format for Places API (New) has changed from the format of the legacy APIs. For more details, see [Migrate the Places API response](/maps/documentation/places/web-service/migrate-response).\n\nThe following table lists parameters in Place Details (Legacy) that have been\nrenamed or modified for Place Details (New), or parameters that are no\nlonger supported.\n\n| Current parameter | New parameter | Notes |\n|-------------------|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `place_id` | `places/`\u003cvar translate=\"no\"\u003ePLACE_ID\u003c/var\u003e | The string `places/`\u003cvar translate=\"no\"\u003ePLACE_ID\u003c/var\u003e is also called the place *resource name* . In the response from a Place Details (New), Nearby Search (New), and Text Search (New) request, this string is contained in the `name` field of the response. The standalone place ID is contained in the `id` field of the response. |\n| `language` | `languageCode` | |\n| `region` | `regionCode` | |\n\nExample request\n---------------\n\nThe following example GET request uses the Place Details (Legacy). In this\nexample, you request a JSON response containing information about a place ID and\npass all parameters as URL parameters. This example also uses `fields` so the\nresponse only includes the display name and formatted address of the place: \n\n```curl\ncurl -L -X GET \\\n'https://maps.googleapis.com/maps/api/place/details/json?place_id=ChIJj61dQgK6j4AR4GeTYWZsKWw&fields=name%2Cformatted_address&key=API_KEY'\n```\n\nWith Place Details (New), you make a GET request and pass all parameters\nin URL parameters and headers as part of the request. This example also uses a\nfield mask so the response only includes the display name and formatted address\nof the place: \n\n```\ncurl -X GET -H 'Content-Type: application/json' \\\n-H \"X-Goog-Api-Key: API_KEY\" \\\n-H \"X-Goog-FieldMask: displayName,formattedAddress\" \\\nhttps://places.googleapis.com/v1/places/ChIJj61dQgK6j4AR4GeTYWZsKWw\n```\n\nThe string `places/`\u003cvar translate=\"no\"\u003ePLACE_ID\u003c/var\u003e is also called the place\n*resource name* . In the response from a Place Details (New),\nNearby Search (New), and Text Search (New) request, this string\nis contained in the `name` field of the response. The standalone place ID is\ncontained in the `id` field of the response.\n| **Note:** In the [Place Details (Legacy)](/maps/documentation/places/web-service/details), the `name` field of the response contained the human-readable name for the place. In the new API, that field is now called `displayName`."]]