ผลิตภัณฑ์หรือฟีเจอร์นี้อยู่ในสถานะเดิม ดูข้อมูลเพิ่มเติมเกี่ยวกับระยะเดิมและวิธีย้ายข้อมูลจากบริการเดิมไปยังบริการที่ใหม่กว่าได้ที่
ผลิตภัณฑ์และฟีเจอร์เดิม
ไลบรารีของไคลเอ็นต์สำหรับบริการเว็บของ Google Maps
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ไคลเอ็นต์ Java, ไคลเอ็นต์ Python, ไคลเอ็นต์ Go และไคลเอ็นต์ Node.js สำหรับบริการของ Google Maps เป็นไลบรารีของไคลเอ็นต์ที่ชุมชนสนับสนุน ซึ่งเป็นโอเพนซอร์สภายใต้สัญญาอนุญาต Apache 2.0 คุณสามารถดาวน์โหลดและมีส่วนร่วมใน GitHub ซึ่งคุณจะดูวิธีการติดตั้งและโค้ดตัวอย่างได้ด้วย
เหตุผลที่ควรใช้คลังไลบรารีไคลเอ็นต์
ไคลเอ็นต์ Java, ไคลเอ็นต์ Python, ไคลเอ็นต์ Go และไคลเอ็นต์ Node.js สำหรับบริการ Google Maps ช่วยให้คุณทำงานกับเว็บเซอร์วิสของ Google Maps บนเซิร์ฟเวอร์ได้
ซึ่งจะรวมฟังก์ชันการทำงานของ API ต่อไปนี้
นอกจากฟังก์ชันการทำงานที่ API เหล่านี้มอบให้แล้ว ไลบรารีของไคลเอ็นต์ยังทําให้งานทั่วไปบางอย่างง่ายขึ้นด้วย
- การจำกัดอัตราการส่งข้อมูลอัตโนมัติ โดยค่าเริ่มต้น ระบบจะส่งคำขอตามอัตราการจำกัดที่คาดไว้สำหรับแต่ละเว็บเซอร์วิส คุณสามารถระบุขีดจำกัด QPM ที่กําหนดเองได้โดยใช้
new GeoApiContext().setQueryRateLimit(qpm)
- ลองอีกครั้งหากไม่สำเร็จ ไลบรารีของไคลเอ็นต์จะลองส่งคำขออีกครั้งโดยอัตโนมัติหาก API ส่งข้อผิดพลาด
5xx
การลองใหม่จะใช้ Exponential Backoff ซึ่งจะช่วยในกรณีที่เกิดความล้มเหลวเป็นระยะๆ
- การตรวจสอบสิทธิ์ที่ง่ายดาย ไลบรารีของไคลเอ็นต์ช่วยให้การตรวจสอบสิทธิ์ด้วยคีย์ API ที่พร้อมให้ใช้งานแบบไม่มีค่าใช้จ่ายเป็นเรื่องง่าย ลูกค้าแพ็กเกจพรีเมียมของ Google Maps Platform ใช้รหัสไคลเอ็นต์และรหัสลับได้
- POJO ไลบรารี Java จะแสดงผลออบเจ็กต์เนทีฟสําหรับการตอบกลับ API แต่ละรายการ ไลบรารี Python จะแสดงโครงสร้างตามที่ได้รับจาก API
- แบบอะซิงโครนัสหรือแบบซิงโครนัส คำขอทั้งหมดรองรับรูปแบบการเรียกแบบซิงโครนัสหรือแบบอะซิงโครนัส
ข้อกำหนดและเงื่อนไข
ไลบรารีไคลเอ็นต์สําหรับบริการเว็บของ Google Maps ได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0
ไลบรารีของไคลเอ็นต์คือ Wrapper สำหรับเว็บเซอร์วิสของ Google Maps บริการเว็บของ Google Maps อยู่ภายใต้ข้อกำหนดในการให้บริการของ Google Maps Platform
สำคัญ: ไลบรารีเหล่านี้ไม่อยู่ภายใต้นโยบายการเลิกใช้งานหรือข้อตกลงการสนับสนุนมาตรฐานของ Google
คีย์ API และรหัสไคลเอ็นต์
เว็บเซอร์วิส Google Maps แต่ละรายการต้องใช้คีย์ API หรือรหัสไคลเอ็นต์ ดูคำแนะนำเกี่ยวกับเวลาที่ใช้คีย์ API, เวลาที่ใช้รหัสไคลเอ็นต์ และวิธีรับคีย์ API หรือรหัสไคลเอ็นต์ได้ที่คู่มือการตรวจสอบสิทธิ์สำหรับ API ที่คุณใช้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eCommunity-supported client libraries for Google Maps Services are available in Java, Python, Go, and Node.js, offering convenient access to various Google Maps APIs like Geocoding, Directions, and Places.\u003c/p\u003e\n"],["\u003cp\u003eThese open-source libraries, under the Apache 2.0 License, provide features such as automatic rate limiting, retry on failure, easy authentication, and support for both synchronous and asynchronous calls.\u003c/p\u003e\n"],["\u003cp\u003eThe client libraries are governed by the Google Maps Platform Terms of Service, but they are not covered by the standard Google deprecation policy or support agreement.\u003c/p\u003e\n"],["\u003cp\u003eEach Google Maps web service requires an API key or client ID for authentication, with specific guides available for each API to help users obtain and use them.\u003c/p\u003e\n"]]],[],null,["# Client Libraries for Google Maps Web Services\n\nThe Java Client, Python Client, Go Client and\nNode.js Client for Google Maps Services are community supported client libraries, open sourced under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). They are\navailable for download and contributions on GitHub, where you will also find installation\ninstructions and sample code: \n\n- [Java Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)\n- [Python Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)\n- [Go Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)\n- [Node.js Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)\n\nWhy use the client libraries?\n-----------------------------\n\nThe Java Client, Python Client, Go Client\nand Node.js Client for Google Maps Services enable you to work with Google Maps web services on your server.\nThey wrap the functionality of the following APIs:\n\n- [Address Validation API](/maps/documentation/address-validation/overview)\n- [Directions API (Legacy)](/maps/documentation/directions/start)\n- [Distance Matrix API (Legacy)](/maps/documentation/distancematrix/start)\n- [Elevation API](/maps/documentation/elevation/start)\n- [Geocoding API](/maps/documentation/geocoding/start)\n- [Places API](/maps/documentation/places/web-service/overview)\n- [Roads API](/maps/documentation/roads/overview)\n- [Time Zone API](/maps/documentation/timezone/start)\n\nIn addition to the functionality provided by these APIs, the client libraries\nmake some common tasks a little easier.\n\n- **Automatic Rate Limiting** By default, requests are sent at the expected rate limit for each web service. You can provide custom QPM limits with `new GeoApiContext().setQueryRateLimit(qpm)`.\n- **Retry on Failure** The client libraries will automatically retry any request if the API sends a `5xx` error. Retries use exponential back-off, which helps in the event of intermittent failures.\n- **Easy Authentication** The client libraries make it easy to authenticate with your freely available API Key. [Google Maps Platform Premium Plan](/maps/premium) customers can use their [client ID and secret](/maps/premium/overview#client-id).\n- **POJOs** The Java libraries return native objects for each of the API responses. The Python libraries return the structure as it is received from the API.\n- **Asynchronous or synchronous** All requests support synchronous or asynchronous calling style.\n\nTerms and conditions\n--------------------\n\nThe client libraries for the Google Maps web services are licensed under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\n\nThe client libraries are wrappers for the Google Maps web services. The Google Maps\nweb services are governed by the [Google Maps Platform Terms of Service](https://cloud.google.com/maps-platform/terms).\n\n**Important** : These libraries are **not covered**\nby the standard Google deprecation policy or support agreement.\n\nAPI keys and client IDs\n-----------------------\n\nEach Google Maps web service requires an API key or client ID. For a guide on\nwhen to use an API key, when to use a client ID, and how to get hold of your\nAPI key or client ID, see the authentication guide for the API you're using:\n\n- [Address Validation API](/maps/documentation/address-validation/get-api-key)\n- [Directions API (Legacy)](/maps/documentation/directions/get-api-key)\n- [Distance Matrix API (Legacy)](/maps/documentation/distancematrix/get-api-key)\n- [Elevation API](/maps/documentation/elevation/get-api-key)\n- [Geocoding API](/maps/documentation/geocoding/get-api-key)\n- [Places API](/maps/documentation/places/web-service/get-api-key)\n- [Roads API](/maps/documentation/roads/get-api-key)\n- [Time Zone API](/maps/documentation/timezone/get-api-key)"]]