संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यूरोपियन इकनॉमिक एरिया (ईईए) के डेवलपर
इस दस्तावेज़ में, Places API (नया) का इस्तेमाल करने की ज़रूरी शर्तों के बारे में बताया गया है. साथ ही, इसे चालू करने और पुष्टि किया गया अनुरोध करने का तरीका भी बताया गया है.
checklist
पक्का करें कि आपने ज़रूरी शर्तें पूरी की हों.
settings
अपने Google Cloud प्रोजेक्ट में एपीआई चालू करें.
verified_user
एपीआई अनुरोध की पुष्टि करने के लिए, एपीआई पासकोड या OAuth कॉन्फ़िगर करें.
[null,null,["आखिरी बार 2025-08-16 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eGoogle Maps Platform products require API keys for authentication and billing purposes, linking your project and billing account to the API.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the Places API, ensure you have a project with a billing account and the Places API enabled.\u003c/p\u003e\n"],["\u003cp\u003eYou can create and restrict API keys through the Google Cloud Console or the Cloud SDK.\u003c/p\u003e\n"],["\u003cp\u003eGoogle strongly recommends restricting your API keys to enhance security by limiting usage to only necessary APIs for your application.\u003c/p\u003e\n"],["\u003cp\u003eInclude your API key with every Places API request, ensuring it is URL encoded and the request is made over HTTPS.\u003c/p\u003e\n"]]],["API keys are required to authenticate Google Maps Platform requests. To create one, navigate to the Google Maps Platform Credentials page, click \"Create credentials,\" then \"API key,\" and close the dialog. To restrict an API key for security, go to the same Credentials page, select the key, set \"Application restrictions\" to IP addresses, specify allowed IP addresses, then set \"API restrictions,\" to the specific API, save your changes. Every Places API request needs the key in the request.\n"],null,["Select platform: [Android](/maps/documentation/places/android-sdk/get-api-key \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/get-api-key \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/get-api-key \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/places/web-service/get-api-key \"View this page for the Web Service platform docs.\") \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\nGoogle Maps Platform products are secured from unauthorized use by restricting API calls\nto those that provide proper authentication credentials. These credentials are in the form of\nan API key - a unique alphanumeric string that associates your Google billing account with your\nproject, and with the specific API or SDK.\n\nThis guide shows how to create, restrict, and use your API key for Google Maps Platform.\n\nBefore you begin\n\nBefore you start using the Places API, you need a project with a billing account and the\nPlaces API enabled. To learn more, see [Set up in Cloud console](/maps/documentation/places/web-service/cloud-setup).\n\nCreating API keys\n\n\u003cbr /\u003e\n\n| **Note:** If you are using both Places API (Legacy) and Places API (New), we recommend that you create a separate API key for each API version. To prevent accidental charges, check all other API keys to ensure that you have only enabled Places API (Legacy) or Places API (New) on those keys where necessary.\n\n\nThe API key is a unique identifier that authenticates requests associated with your project for\nusage and billing purposes. You must have at least one API key associated with your project.\n\nTo create an API key:\n\nConsole \n\n1. Go to the **Google Maps Platform \\\u003e Credentials** page.\n\n [Go to the Credentials page](https://console.cloud.google.com/project/_/google/maps-apis/credentials?utm_source=Docs_CreateAPIKey&utm_content=Docs_places-backend)\n2. On the **Credentials** page, click **Create credentials \\\u003e API key** . \n The **API key created** dialog displays your newly created API key.\n3. Click **Close.** \n The new API key is listed on the **Credentials** page under **API keys** . \n (Remember to [restrict the API](/maps/api-security-best-practices#restricting-api-keys) key before using it in production.)\n\nCloud SDK \n\n```bash\ngcloud services api-keys create \\\n --project \"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\" \\\n --display-name \"\u003cvar translate=\"no\"\u003eDISPLAY_NAME\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud services api-keys create`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/create)\n\n\u003cbr /\u003e\n\nRestricting API keys\n\nGoogle strongly recommends that you restrict your API keys by limiting their usage to those only\nAPIs needed for your application. Restricting API keys adds security to your application by\nprotecting it from unwarranted requests. For more information, see\n[API security best practices](/maps/api-security-best-practices#restrict_apikey).\n\n| When restricting an API key in the Cloud console, **Application restrictions** override any APIs enabled under **API restrictions**. Follow best practices by creating a separate API key for each app, and for each platform on which that app is available.\n\nTo restrict an API key:\n\nConsole\n\n1. Go to the **Google Maps Platform \\\u003e Credentials** page.\n\n [Go to the Credentials page](https://console.cloud.google.com/project/_/google/maps-apis/credentials?utm_source=Docs_RestrictAPIKey&utm_content=Docs_places-backend)\n2. Select the API key that you want to set a restriction on. The API key property page appears.\n3. Under **Key restrictions**, set the following restrictions:\n - Application restrictions:\n 1. To accept requests from the list of web server IP addresses that you supply, select **IP addresses (web servers, cron jobs, etc.)** from the list of **Application restrictions** . Specify one or more IPv4 or IPv6 address, or subnet using CIDR notation. The IP addresses must match the source address the Google Maps Platform servers observe. If you use [network\n address translation (NAT)](https://en.wikipedia.org/wiki/Network_address_translation), this would typically correspond to your machine's *public* IP address.\n - API restrictions:\n 1. Click **Restrict key**.\n 2. Select either **Places API (Legacy)** or **Places API (New)** from **Select APIs** dropdown, but not both. If Places API (Legacy) or Places API (New) is not listed, you need to [enable](/maps/documentation/places/web-service/cloud-setup#enabling-apis) it. **Note:**If you are using both the Places API (Legacy) and Places API (New), we recommend that you create a separate API key for each API version.\n4. To finalize your changes, click **Save** . \n\nCloud SDK\n\nPlaces API (New)\n\n\nList existing keys. \n\n```bash\ngcloud services api-keys list --project=\"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\"\n```\n\n\nClear existing restrictions on existing key. \n\n```bash\ngcloud services api-keys update \"projects/\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e/keys/\u003cvar translate=\"no\"\u003eKEY_ID\u003c/var\u003e\" \\\n --clear-restrictions\n```\n\n\nSet new restrictions on existing key. \n\n```bash\ngcloud services api-keys update projects/PROJECT/locations/global/keys/KEY_ID \\\n --api-target=service=places.googleapis.com\n --allowed-ips=\"\u003cvar translate=\"no\"\u003eIP_ADDRESS\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud services api-keys update`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/update)\n- [`gcloud services api-keys lookup`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/lookup)\n- [`gcloud services api-keys list`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/list)\n\nPlaces API (Legacy)\n\n\nList existing keys. \n\n```bash\ngcloud services api-keys list --project=\"\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e\"\n```\n\n\nClear existing restrictions on existing key. \n\n```bash\ngcloud services api-keys update \"projects/\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e/keys/\u003cvar translate=\"no\"\u003eKEY_ID\u003c/var\u003e\" \\\n --clear-restrictions\n```\n\n\nSet new restrictions on existing key. \n\n```bash\ngcloud services api-keys update projects/PROJECT/locations/global/keys/KEY_ID \\\n --api-target=service=places-backend.googleapis.com\n --allowed-ips=\"\u003cvar translate=\"no\"\u003eIP_ADDRESS\u003c/var\u003e\"\n```\n\nRead more about the\n[Google Cloud SDK](https://cloud.google.com/sdk)\n,\n[Cloud SDK installation](https://cloud.google.com/sdk/docs/install)\n, and the following commands:\n\n- [`gcloud services api-keys update`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/update)\n- [`gcloud services api-keys lookup`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/lookup)\n- [`gcloud services api-keys list`](https://cloud.google.com/sdk/gcloud/reference/services/api-keys/list)\n\nAdding the API key to your request\n\nYou must include an API key with every Places API request. In the following example,\nreplace `YOUR_API_KEY` with your API key.\n`https://places.googleapis.com/v1/places/ChIJj61dQgK6j4AR4GeTYWZsKWw?fields=id,displayName&key=`YOUR_API_KEY\n\nHTTPS is required for requests that use an API key.\n| **Note:** When using Web Services, all special characters inside the parameters must be URL encoded. URLs must be properly encoded to be valid and are limited to 2048 characters for all web services. Be aware of this limit when constructing your URLs. Different browsers, proxies, and servers may have different URL character limits as well."]]