Teste a próxima geração de recursos do Distance Matrix com a
API Routes.
Bibliotecas de cliente para serviços da Web do Google Maps
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Os clientes Java, Python, Go e Node.js dos serviços do Google Maps são bibliotecas de cliente apoiadas pela comunidade e que têm código aberto sob a Licença Apache 2.0. Eles estão disponíveis para download e contribuições no GitHub, onde você também encontrará instruções de instalação e exemplos de código:
Por que usar as bibliotecas de cliente?
Com os clientes Java, Python, Go e Node.js, você pode trabalhar com serviços da Web do Google Maps no seu servidor.
Eles englobam os recursos das seguintes APIs:
Além dos recursos oferecidos por essas APIs, as bibliotecas de cliente facilitam algumas tarefas comuns.
- Limitação automática de taxa: por padrão, as solicitações são enviadas de acordo com a limitação de taxa esperada para cada serviço da Web. Você pode disponibilizar limites personalizados de QPS com
new GeoApiContext().setQueryRateLimit(qps)
.
- Nova tentativa em caso de falha: as bibliotecas de cliente farão uma nova tentativa automaticamente para qualquer solicitação se a API retornar um erro
5xx
. As novas tentativas usam uma retirada exponencial, o que é útil em caso de falhas intermitentes.
- Autenticação fácil: com as bibliotecas de cliente, é fácil autenticar usando sua chave de API, disponibilizada sem custo financeiro. Os clientes do plano Premium da Plataforma Google Maps podem usar o ID do cliente e a chave secreta.
- POJOs: as bibliotecas Java retornam objetos nativos para cada resposta da API. As bibliotecas Python retornam a estrutura conforme ela é recebida da API.
- Assíncrono ou síncrono: todas as solicitações são compatíveis com estilos de chamada assíncronos ou síncronos.
Termos e Condições
As bibliotecas de cliente para os serviços da Web do Google Maps usam a Licença Apache 2.0.
As bibliotecas do cliente são wrappers dos serviços da Web do Google Maps. Esses serviços são regidos pelos Termos de Serviço da Plataforma Google Maps.
Importante: essas bibliotecas não são cobertas pela política padrão de suspensão de uso nem pelo contrato de suporte do Google.
Chaves de API e IDs do cliente
Cada serviço da Web do Google Maps requer uma chave de API ou um ID de cliente. Para saber quando usar uma chave de API ou um ID do cliente e como conseguir esses identificadores, consulte o guia de autenticação da API que você está usando:
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2023-09-20 UTC.
[null,null,["Última atualização 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 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,["The 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\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\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\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)"]]