ให้สิทธิ์คำขอ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทุกคําขอที่แอปพลิเคชันส่งไปยัง Google AMP URL API จําเป็นต้องระบุแอปพลิเคชันของคุณให้ Google ทราบ
ระบุแอปพลิเคชันของคุณโดยใช้คีย์ API ของแอปพลิเคชัน
รับและใช้คีย์ API
คีย์ API ต้องมาพร้อมกับคําขอที่ส่งไปยัง Google AMP URL API สําหรับข้อมูลสาธารณะ
คีย์ API จะระบุโปรเจ็กต์และให้สิทธิ์เข้าถึง API โควต้า และรายงาน
หากต้องการจัดหาคีย์ API ให้ทําตามขั้นตอนต่อไปนี้
- เปิดหน้าข้อมูลเข้าสู่ระบบ
- สร้างและใช้คีย์เซิร์ฟเวอร์
อย่าใช้คีย์นี้นอกโค้ดเซิร์ฟเวอร์ของคุณ
เช่น อย่าฝังเนื้อหาไว้ในหน้าเว็บ
หากต้องการป้องกันไม่ให้มีการขโมยโควต้า ให้จํากัดคีย์ของคุณเพื่ออนุญาตเฉพาะคําขอจากเซิร์ฟเวอร์และที่อยู่ IP #39 เท่านั้น
โปรดทําตามแนวทางปฏิบัติแนะนําในการใช้คีย์ API อย่างปลอดภัยเพื่อให้คีย์ API มีความปลอดภัย
เมื่อคุณมีคีย์ API แล้ว แอปพลิเคชันจะสามารถเพิ่มพารามิเตอร์การค้นหา
key=yourAPIKey
ต่อท้าย URL คําขอทั้งหมด
คีย์ API มีความปลอดภัยสําหรับการฝังใน URL โดยไม่จําเป็นต้องมีการเข้ารหัส
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2023-08-30 UTC
[null,null,["อัปเดตล่าสุด 2023-08-30 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."]]