Client Libraries

The Google APIs Client Libraries which are available in a number of popular programming languages, make it easy to use the API.

Client libraries by language

In the following tables, the first column shows each library's stage of development (note that some are in early stages), and links to documentation for the library. The second column links to available samples for each library.

Documentation Samples
Google API Client Library for Java Java samples
Google API Client Library for JavaScript JavaScript samples
Google API Client Library for .NET .NET samples
Google API Client Library for Objective-C for REST Objective-C samples
Google API Client Library for PHP () PHP samples
Google API Client Library for Python Python samples

These early-stage libraries are also available:

Documentation Samples
Google APIs Client Libraries for Dart (beta) Dart samples
Google API Client Library for Go (alpha) Go samples
Google API Client Library for Node.js (alpha) Node.js samples
Google API Client Library for Ruby (alpha) Ruby samples

Using discovery service

If you use the Python, JavaScript, or other client library that relies on Google Discovery Service, you need to provide the location of the discovery document for the Reporting API v4.

Python

from apiclient import discovery

...

# Build the Analytics Reporting API v4 authorized service object.
analyticsReporting = discovery.build(
  'analyticsreporting',
  'v4',
  http=http,
  discoveryServiceUrl='https://analyticsreporting.googleapis.com/$discovery/rest')

JavaScript

gapi.client.load(
  'https://analyticsreporting.googleapis.com/$discovery/rest',
  'v4'
).then(...)

The Java and PHP client libraries are pre-built, but you can use the discovery service and the Google APIs generator to generate them.