Google Maps Platform 제품은 API 호출을 적절한 사용자 인증 정보를 제공하는 API 호출로 제한하여 무단 사용으로부터 보호합니다. 이러한 사용자 인증 정보는 Google 결제 계정을 프로젝트, 특정 API나 SDK와 연결하는 고유한 영숫자 문자열인 API 키 형태입니다.
이 가이드에서는 Google Maps Platform에서 API 키를 생성, 제한 및 사용하는 방법을 설명합니다.
시작하기 전에
Directions API를 사용하려면 결제 계정이 있고 Directions API가 사용 설정된 프로젝트가 필요합니다. 자세한 내용은 Cloud 콘솔에서 설정하기를 참고하세요.
API 키 만들기
API 키는 사용 및 결제에 관한 프로젝트와 관련된 요청을 인증하는 고유 식별자입니다. 프로젝트에 연결된 API 키가 하나 이상 있어야 합니다.
API 키를 애플리케이션에 필요한 API에서만 사용하도록 제한하는 것이 좋습니다. API 키를 제한하면 불필요한 요청으로부터 애플리케이션이 보호되어 애플리케이션의 보안이 강화됩니다. 제한되지 않은 API 키를 악용하여 발생한 비용은 개발자가 부담해야 합니다.
자세한 내용은 API 보안 권장사항을 참고하세요.
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eGoogle Maps Platform secures its products by requiring API keys for authentication and billing purposes.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys can be created and managed through the Google Cloud Console or the Cloud SDK.\u003c/p\u003e\n"],["\u003cp\u003eRestricting API keys to specific applications and IP addresses enhances security.\u003c/p\u003e\n"],["\u003cp\u003eInclude your API key in every Directions API request using the \u003ccode\u003ekey\u003c/code\u003e parameter, ensuring HTTPS is used.\u003c/p\u003e\n"]]],["API keys are crucial for securing Google Maps Platform products, authenticating requests, and linking usage to a billing account. To create an API key, use the Google Maps Platform Credentials page or the Cloud SDK. Restricting keys, via application and API restrictions, is highly recommended to prevent unauthorized use. Restricting keys can be done via the Google Cloud Console or the Cloud SDK. Finally, each Directions API request requires an API key, included in the URL, with HTTPS protocol.\n"],null,["# Use API Keys with Directions API\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----------------\n\nBefore you start using the Directions API, you need a project with a billing account and the\nDirections API enabled. To learn more, see [Set up in Cloud console](/maps/documentation/directions/cloud-setup).\n\nCreating API keys\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\n### Console\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_directions-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\n### Cloud 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\nRestricting API keys\n--------------------\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. **You are financially responsible for charges caused by abuse of unrestricted API keys.** 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\n### Console\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_directions-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 **Directions API** from **Select APIs** dropdown. If the Directions API is not listed, you need to [enable](/maps/documentation/directions/cloud-setup#enabling-apis) it.\n4. To finalize your changes, click **Save** . \n\n### Cloud SDK\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=directions-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----------------------------------\n\nYou must include an API key with every Directions API request. In the following example,\nreplace `YOUR_API_KEY` with your API key.\n`https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&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."]]