Попробуйте новое поколение функций Directions с
API Routes .
Клиентские библиотеки для веб-сервисов Google Карт
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Клиенты для Java, Python, Go и Node.js для сервисов Google Карт – это клиентские библиотеки, поддерживаемые сообществом, на базе ПО с открытым исходным кодом, которые предоставляются согласно лицензии Apache 2.0. Их можно скачать и дополнить на сайте GitHub по указанным ниже ссылкам. Также там опубликованы образцы кода и инструкции по установке.
Зачем нужны клиентские библиотеки?
Клиенты для Java, Python, Go и Node.js для веб-сервисов Google Карт позволяют использовать эти веб-сервисы на вашем сервере.
Они охватывают функции следующих API:
Помимо поддержки функций API, клиентские библиотеки позволяют оптимизировать некоторые стандартные задачи.
- Автоматическое ограничение частоты запросов. По умолчанию запросы отправляются каждому веб-сервису в соответствии с установленной частотой. Вы можете указать собственные лимиты для количества запросов в секунду с помощью метода
new GeoApiContext().setQueryRateLimit(qps)
.
- Повтор при сбое. Клиентские библиотеки автоматически отправят повторный запрос, если API вернет ошибку
5xx
. При повторе используется экспоненциальная задержка, позволяющая снизить нагрузку на сервис в случае перемежающихся сбоев.
- Простая аутентификация. Клиентские библиотеки позволяют легко выполнять аутентификацию с помощью бесплатного ключа API. Клиенты плана Premium платформы Google Карт могут использовать идентификатор клиента или секрет.
- Простые объекты на языке Java. Библиотеки на Java возвращают исходные объекты для каждого ответа API, а библиотеки на Python – структуру в том виде, в котором она получена от API.
- Асинхронный или синхронный вызов. Все запросы поддерживают синхронный и асинхронный способы вызова.
Условия использования
Клиентские библиотеки для веб-сервисов Google Карт предоставляются согласно лицензии Apache 2.0.
Клиентские библиотеки являются оболочками для веб-сервисов Google Карт. Работа с веб-сервисами регулируется Условиями использования платформы Google Карт.
Важно. На эти библиотеки не распространяется действие стандартных правил прекращения поддержки или соглашения о поддержке Google.
Ключи API и идентификаторы клиента
Для работы с любым веб-сервисом Google Карт требуется ключ API или идентификатор клиента. Информация о том, когда надо использовать ключ API или идентификатор клиента и как получить их, доступна в руководстве по аутентификации для каждого API:
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2023-09-20 UTC.
[null,null,["Последнее обновление: 2023-09-20 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 Directions, Geocoding, and Places.\u003c/p\u003e\n"],["\u003cp\u003eThese open-source libraries, under the Apache 2.0 License, simplify development with features such as automatic rate limiting, retry mechanisms, and easy authentication.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries provide synchronous and asynchronous calling styles while adhering to the Google Maps Platform Terms of Service.\u003c/p\u003e\n"],["\u003cp\u003eThey are not covered by Google's standard deprecation policy or support agreement and require an API key or client ID for usage, obtainable through API-specific authentication guides.\u003c/p\u003e\n"]]],["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"],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)"]]