Click here to see your recently viewed pages and most viewed pages.

Easily access Google APIs from Python

The Google APIs Client Library for Python provides access to many Google APIs. It is designed for Python client-application developers and offers a way to access APIs that is simple, flexible, and powerful. See the navigation sidebar for a list of guides, references, and other information.

Logo for APIs

Making it simple to call Google APIs

Use the simple and clean library to make calls from Python to an API.

# List my public Google+ activities.
result = service.activities().list(userId='me', collection='public').execute()
tasks = result.get('items', [])
for task in tasks:
  print task['title']
Combination lock

Easy authentication

The easy-to-use authentication library can reduce the amount of code you need to write to handle OAuth 2.0. Sometimes as little as a couple of lines is all you need.

# Authorize server-to-server interactions from Google Compute Engine.
from oauth2client import gce

credentials = gce.AppAssertionCredentials(
http = credentials.authorize(httplib2.Http())
Google App Engine Logo

Runs on Google App Engine

App Engine-specific helpers make quick work of authenticated calls to APIs. No need to worry about exchanging code for tokens; get right down to writing the meat of your application.

# Restrict access to users that have granted access to Calendar information.
decorator = appengine.OAuth2DecoratorFromClientSecrets(

class MainHandler(webapp.RequestHandler):
  def get(self):
    http = decorator.http()
    request ='primary')
File download

Client library installation

Install the library using standard Python tools.

$ pip install --upgrade google-api-python-client

There are also custom installs optimized for Google App Engine.

Check out all the installation options.