Google 地圖網路服務適用的用戶端程式庫
Google 地圖服務適用的 Java、Python、Go 和 Node.js 用戶端都是社群支援的用戶端程式庫,並依據阿帕契 2.0 授權的條款提供開放原始碼。您可以到 GitHub 下載這些用戶端或相關貢獻項目、查看安裝操作說明及取得程式碼範例:
使用用戶端程式庫的好處
Google 地圖服務適用的 Java 用戶端、Python 用戶端、Go 用戶端和 Node.js 用戶端,都可讓您在自家伺服器上使用 Google 地圖網路服務。這些用戶端內含下列 API 的功能:
除了這些 API 提供的功能,用戶端程式庫還能讓一些常見的工作變得更簡單一些。
- 自動頻率限制:根據預設,系統會按照各個網路服務的預期頻率限制傳送要求,您可以自訂 QPM 限制
new GeoApiContext().setQueryRateLimit(qpm)
。
- 失敗時重試:若 API 傳送
5xx
錯誤,用戶端程式庫會自動重試任何要求,並在重試時使用指數倒退演算法,這對於失敗是間斷出現的情況很有幫助。
- 輕鬆進行驗證:用戶端程式庫可讓您使用免費取得的 API 金鑰輕鬆完成驗證。如果是 Google 地圖平台付費方案客戶,則可使用自己的用戶端 ID 和 Secret 進行驗證。
- POJO:Java 程式庫會針對每一個 API 回應傳回原生物件,Python 程式庫則會原封不動地傳回從 API 收到的架構。
- 非同步或同步:所有的要求都支援同步或非同步呼叫樣式。
條款及細則
Google 地圖網路服務的用戶端程式庫是依阿帕契 2.0 授權的條款進行授權。
用戶端程式庫是 Google 地圖網路服務的包裝函式;Google 地圖網路服務受到《Google 地圖平台服務條款》的規範。
重要注意事項:這些程式庫不在標準 Google 廢止政策或支援協議的涵蓋範圍內。
API 金鑰和用戶端 ID
每項 Google 地圖網路服務都需要 API 金鑰或用戶端 ID。如想瞭解 API 金鑰和用戶端 ID 的使用時機和取得方式,請參閱您目前採用的 API 適用的驗證指南:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[null,null,["上次更新時間:2024-09-05 (世界標準時間)。"],[[["Community-supported client libraries for Google Maps Services are available in Java, Python, Go, and Node.js, enabling server-side interaction with various Google Maps APIs like Directions, Geocoding, and Places."],["These open-source libraries, under the Apache 2.0 License, offer benefits such as automatic rate limiting, request retries, simplified authentication, and support for both synchronous and asynchronous calls."],["While providing convenient wrappers for Google Maps web services, these client libraries are not covered by standard Google support or deprecation policies and are subject to the Google Maps Platform Terms of Service."],["Accessing Google Maps web services requires an API key or client ID; refer to the authentication guide for your specific API for details on obtaining and using these credentials."]]],["Community-supported Java, Python, Go, and Node.js client libraries for Google Maps Services are available on GitHub under the Apache 2.0 License. These clients wrap APIs like Address Validation, Directions, and Places, offering features such as automatic rate limiting, retry on failure, and easy authentication via API keys or client IDs. They facilitate server-side interaction with Google Maps web services. The libraries support both synchronous and asynchronous requests.\n"]]