リクエストの承認
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アプリケーションから Google AMP URL API に送信するすべてのリクエストでは、Google に対してアプリケーションを指定する必要があります。アプリケーションの指定には、アプリケーションの API キーを使用します。
API キーを取得して使用する
API キーは、パブリック データ用の Google AMP URL API へのリクエストで使用する必要があります。
API キーはプロジェクトを識別し、API アクセス、割り当て、およびレポートを提供します。API キーを取得する手順は次のとおりです。
- [認証情報] ページを開きます。
- サーバーキーを作成して使用します。このキーは、サーバーのコード以外で使用しないでください。たとえば、ウェブページには埋め込まないでください。割り当ての盗用を防ぐには、キーを制限して、自分のサーバーの送信元 IP アドレスからのリクエストだけが許可されるようにします。
API キーの安全性を保つには、API キーを安全に使用するためのベスト プラクティスに沿って対応してください。
API キーを作成すると、アプリケーションですべてのリクエスト URL の末尾にクエリ パラメータ key=yourAPIKey
を追加できます。
API キーは URL に安全に埋め込むことができます。エンコードは不要です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-04 UTC。
[null,null,["最終更新日 2025-08-04 UTC。"],[[["\u003cp\u003eEvery request sent to the Google AMP URL API must identify your application using an API key.\u003c/p\u003e\n"],["\u003cp\u003eObtain an API key through the Google Developers Console, specifically a Server key, and restrict its usage to your server's IP addresses for security.\u003c/p\u003e\n"],["\u003cp\u003eInclude your API key in all request URLs as a query parameter (\u003ccode\u003ekey=yourAPIKey\u003c/code\u003e), which is safe for embedding without encoding.\u003c/p\u003e\n"]]],["To interact with the Google AMP URL API, obtain an API key from the Credentials page. Create a Server key and restrict it to your server's IP addresses for security. Append the `key=`yourAPIKey parameter to all request URLs. This key identifies your project, grants API access, and provides quota and reports. Do not embed the key outside of server code, as it's designed for server-side use. Refer to the linked best practices for securely managing your API key.\n"],null,["# Authorize Requests\n\nEvery request your application sends\nto the Google AMP URL API needs\nto identify your application to Google.\nIdentify your application using the application's\n[API key](https://developers.google.com/console/help/generating-dev-keys).\n\nAcquire and use an API key\n--------------------------\n\nAn [API key](https://developers.google.com/console/help/generating-dev-keys)\nmust accompany requests to the Google AMP URL API for public data.\n\nThe API key identifies your project and provides API access, quota, and reports.\nTo acquire an API key, do the following:\n\n1. Open the [Credentials page](https://console.developers.google.com/apis/credentials?project=_).\n2. Create and use a **Server key**. Do not use this key outside of your server code. For example, do not embed it in a web page. To prevent quota theft, restrict your key so that requests are only allowed from your servers' source IP addresses.\n\nTo keep your API keys secure, follow the\n[best practices for securely using\nAPI keys](https://developers.google.com/console/help/api-key-best-practices).\n\nAfter you have an API key,\nyour application can append the query parameter\n`key=`yourAPIKey\nto all request URLs.\n\nThe API key is safe for embedding in URLs; it doesn't need any encoding."]]