Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Google Api Nodejs Client | 10,623 | 8,219 | 1,712 | 3 days ago | 218 | September 21, 2022 | 157 | apache-2.0 | TypeScript | |
Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included. | ||||||||||
Google Maps Services Python | 3,935 | 1,153 | 42 | 5 days ago | 42 | February 02, 2022 | 28 | apache-2.0 | Python | |
Python client library for Google Maps API Web Services | ||||||||||
Google Maps Services Js | 2,634 | 792 | 138 | 4 days ago | 24 | April 30, 2020 | 20 | apache-2.0 | TypeScript | |
Node.js client library for Google Maps API Web Services | ||||||||||
Google Maps Services Java | 1,599 | 880 | 26 | 19 days ago | 57 | June 03, 2022 | 23 | apache-2.0 | Java | |
Java client library for Google Maps API Web Services | ||||||||||
Google Api Dotnet Client | 1,193 | 1,528 | 713 | 2 days ago | 93 | March 28, 2022 | 14 | apache-2.0 | C# | |
Google APIs Client Library for .NET | ||||||||||
Google Cloud Dotnet | 858 | 44 | 114 | a day ago | 24 | June 07, 2022 | 5 | apache-2.0 | C# | |
Google Cloud Client Libraries for .NET | ||||||||||
Google Maps Services Go | 636 | 19 days ago | 14 | apache-2.0 | Go | |||||
Go client library for Google Maps API Web Services | ||||||||||
Google Ads Python | 364 | 2 | 17 | 11 days ago | 61 | June 17, 2022 | 5 | apache-2.0 | Python | |
Google Ads API Client Library for Python | ||||||||||
Google Ads Api | 182 | 9 | 18 days ago | 99 | November 08, 2022 | 23 | mit | TypeScript | ||
Google Ads API client library for Node.js | ||||||||||
Angular Google Gapi | 174 | 10 | 2 | 6 years ago | 6 | November 14, 2016 | 18 | JavaScript | ||
An AngularJS module for using all Google Apis and your Google Cloud Endpoints (Google App Engine) with OAuth. This module uses Google APIs Client Library for JavaScript, available for all GApis. |
Use Java? Want to geocode something? Looking for directions?
Maybe matrices of directions? This library brings the Google Maps API Web
Services to your server-side Java application.
The Java Client for Google Maps Services is a Java Client library for the following Google Maps APIs:
Keep in mind that the same terms and conditions apply to usage of the APIs when they're accessed through this library.
The Java Client for Google Maps Services is designed for use in server applications. This library is not intended for use inside of an Android app, due to the potential for loss of API keys.
If you are building a mobile application, you will need to introduce a proxy server to act as intermediary between your mobile application and the Google Maps API Web Services. The Java Client for Google Maps Services would make an excellent choice as the basis for such a proxy server.
Please see Making the most of the Google Maps Web Service APIs for more detail.
Looking for our Android Maps or Places SDKs?
This library is community supported. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will try to support, through Stack Overflow, the public and protected surface of the library and maintain backwards compatibility in the future; however, while the library is in version 0.x, we reserve the right to make backwards-incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), our intention is to deprecate and give developers a year to update their code.
If you find a bug, or have a feature suggestion, please log an issue. If you'd like to contribute, please read How to Contribute.
Each Google Maps Web Service request requires an API key. API keys are generated in the 'Credentials' page of the 'APIs & Services' tab of Google Cloud console.
For even more information on getting started with Google Maps Platform and generating/restricting an API key, see Get Started with Google Maps Platform in our docs.
Important: This key should be kept secret on your server.
You can add the library to your project via Maven or Gradle.
Note: Since 0.1.18 there is now a dependency on SLF4J. You need to add
one of the adapter dependencies that makes sense for your logging setup. In the configuration
samples below we are integrating
slf4j-nop,
but there are others like
slf4j-log4j12
and slf4j-jdk14
that will make more sense in other configurations. This will stop a warning message being emitted
when you start using google-maps-services
.
<dependency>
<groupId>com.google.maps</groupId>
<artifactId>google-maps-services</artifactId>
<version>(insert latest version)</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
</dependency>
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.maps:google-maps-services:(insert latest version)'
implementation 'org.slf4j:slf4j-simple:1.7.25'
}
You can find the latest version at the top of this README or by searching Maven Central or Gradle, Please.
View the javadoc.
Additional documentation for the included web services is available at https://developers.google.com/maps/.
This example uses the Geocoding API with an API key:
GeoApiContext context = new GeoApiContext.Builder()
.apiKey("AIza...")
.build();
GeocodingResult[] results = GeocodingApi.geocode(context,
"1600 Amphitheatre Parkway Mountain View, CA 94043").await();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
System.out.println(gson.toJson(results[0].addressComponents));
The GeoApiContext
is designed to be a Singleton
in your application. Please instantiate one on application startup, and continue to use it for the
life of your application. This will enable proper QPS enforcement across all of your requests.
At the end of the execution, call the shutdown()
method of GeoApiContext
,
otherwise the thread will remain instantiated in memory.
For more usage examples, check out the tests.
You can use this client library on Google App Engine with a single code change.
new GeoApiContext.Builder(new GaeRequestHandler.Builder())
.apiKey("AIza...")
.build();
The new GaeRequestHandler.Builder()
argument to GeoApiContext.Builder
's requestHandlerBuilder
tells the Java Client for Google Maps Services to utilise the appropriate calls for making HTTP
requests from Google App Engine, instead of the default OkHttp3
based strategy.
Never sleep between requests again! By default, requests are sent at the expected rate limits for
each web service, typically 50 queries per second for free users. If you want to speed up or slow
down requests, you can do that too, using new GeoApiContext.Builder().queryRateLimit(qps).build()
.
Note that you still need to manually handle the delay between the initial request and successive pages when you're paging through multiple result sets.
Automatically retry when intermittent failures occur. That is, when any of the retriable 5xx errors are returned from the API.
To alter or disable automatic retries, see these methods in GeoApiContext
:
.disableRetries()
.maxRetries()
.retryTimeout()
.setIfExceptionIsAllowedToRetry()
Native objects for each of the API responses.
All requests support synchronous or asynchronous calling style.
GeocodingApiRequest req = GeocodingApi.newRequest(context).address("Sydney");
// Synchronous
try {
req.await();
// Handle successful request.
} catch (Exception e) {
// Handle error
}
req.awaitIgnoreError(); // No checked exception.
// Async
req.setCallback(new PendingResult.Callback<GeocodingResult[]>() {
@Override
public void onResult(GeocodingResult[] result) {
// Handle successful request.
}
@Override
public void onFailure(Throwable e) {
// Handle error.
}
});
Note: You will need an API key or Client ID to run the tests.
# Compile and package the project
$ ./gradlew jar
# Run the tests
$ ./gradlew test