مجوز درخواست ها
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
هر درخواستی که برنامه شما به Google AMP URL API ارسال می کند، باید برنامه شما را به Google شناسایی کند. برنامه خود را با استفاده از کلید API برنامه شناسایی کنید.
یک کلید API را بدست آورید و از آن استفاده کنید
یک کلید API باید با درخواستهای Google AMP URL API برای دادههای عمومی همراه باشد.
کلید API پروژه شما را شناسایی می کند و دسترسی، سهمیه و گزارش های API را فراهم می کند. برای به دست آوردن یک کلید API، موارد زیر را انجام دهید:
- صفحه اعتبارنامه را باز کنید.
- یک کلید سرور ایجاد و استفاده کنید. از این کلید خارج از کد سرور خود استفاده نکنید. به عنوان مثال، آن را در یک صفحه وب جاسازی نکنید. برای جلوگیری از سرقت سهمیه، کلید خود را محدود کنید تا درخواستها فقط از آدرسهای IP منبع سرور شما مجاز باشد.
برای ایمن نگه داشتن کلیدهای API خود، بهترین روش ها را برای استفاده ایمن از کلیدهای API دنبال کنید.
بعد از اینکه یک کلید API داشتید، برنامه شما می تواند پارامتر query key= yourAPIKey
را به همه URL های درخواستی اضافه کند.
کلید API برای جاسازی در URL ها ایمن است. به هیچ کدگذاری نیاز ندارد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2023-08-30 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2023-08-30 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]