Stay organized with collections
Save and categorize content based on your preferences.
If you don't want to write your own code to send HTTP requests and parse the
responses, then you must download a client
library.
How to set up a client library varies by programming language. In the following
section, select the language you're using for development.
If you want to use a language that isn't shown below, refer to the client
library documentation to see if there's a library
for your language.
Java
Using the Google APIs Client Library for Java requires that you download the core Java client library and the Google Drive Activity API Java library.
This page contains information about getting started with the Drive Activity API by using
the Google API Client Library for Java. For more information, see the following documentation:
This page contains information about getting started with the Drive Activity API by using
the Google API Client Library for Python (v1/v2). For more information, see the following documentation:
$ svn checkout http://google-api-php-client.googlecode.com/svn/trunk/ google-api-php-client-read-only$ cd google-api-php-read-only$ # Copy the src directory to your working directory.
You can now import the classes you need using the following statements:
require_once "../src/apiClient.php";
.NET
Using the Google APIs Client Library for .NET requires that you download the core .NET client library and the Google Drive Activity API .NET library. Download the files and add them as references to your project:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Install a client library\n\nIf you don't want to write your own code to send HTTP requests and parse the\nresponses, then you must download a [client\nlibrary](/workspace/drive/activity/v2/reference/rest).\n\nHow to set up a client library varies by programming language. In the following\nsection, select the language you're using for development.\n\nIf you want to use a language that isn't shown below, refer to the [client\nlibrary documentation](/workspace/drive/activity/v2/libraries) to see if there's a library\nfor your language.\n**Note:** One of the main tasks of the client libraries is converting between JSON and built-in objects. In the Java library, this is done by a set of classes provided by a JAR file. In Python, JSON is converted directly into a dictionary or hash. \n\n### Java\n\nUsing the [Google APIs Client Library for Java](https://developers.google.com/api-client-library/java/) requires that you download the core Java client library and the Google Drive Activity API Java library.\nThis page contains information about getting started with the Drive Activity API by using\nthe Google API Client Library for Java. For more information, see the following documentation:\n\n- Browse the [Javadoc reference for the Drive Activity API](https://googleapis.dev/java/google-api-services-driveactivity/latest/).\n- Read the [Developer's Guide for the Google API Client Library for Java](https://github.com/googleapis/google-api-java-client/).\n- Interact with this API in your browser using the [APIs Explorer for the Drive Activity API](https://developers.google.com/apis-explorer/#p/driveactivity/v2/).\n\nAdd the client library to your project\n--------------------------------------\n\nSelect your build environment (Maven or Gradle) from the following tabs:\n\n\nMaven\n\nAdd the following to your `pom.xml` file:\n\n```\nRefreshing Maven content...\n```\n\nSee [all versions available on the Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.apis%22%20AND%20a%3A%22google-api-services-driveactivity%22).\nGradle\n\nAdd the following to your `build.gradle` file:\n\n```\nRefreshing Gradle content...\n```\n\nSee [all versions available on the Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.google.apis%22%20AND%20a%3A%22google-api-services-driveactivity%22).\n\n### Python\n\nUsing the [Google APIs Client Library for Python](https://github.com/google/google-api-python-client) requires that you download and install the Python source.\nThis page contains information about getting started with the Drive Activity API by using\nthe Google API Client Library for Python (v1/v2). For more information, see the following documentation:\n\n- Browse the [PyDoc reference for the Drive Activity API](https://googleapis.github.io/google-api-python-client/docs/dyn/driveactivity_v2.html).\n- Read the [Developer's guide for the Google API Client Library for Python (v1/v2)](/api-client-library/python).\n- Interact with this API in your browser using the [APIs Explorer for the Drive Activity API](https://developers.google.com/apis-explorer/#p/driveactivity/v2/).\n\nSystem requirements\n-------------------\n\n- Operating systems:\n - Linux\n - macOS X\n - Windows\n- [The v1 client library requires Python 2.7 or higher. The v2 client library requires 3.7 or higher.](http://python.org/download/)\n\nInstall the client library\n--------------------------\n\nYou can either use a package manager or manually download and install the Python client library:\n\n### Managed install\n\nUse pip or setuptools to manage your installation. You might\nneed to run `sudo` first.\n\n- [pip](http://pypi.python.org/pypi/pip) (preferred): \n\n ```\n pip install --upgrade google-api-python-client\n ```\n- [Setuptools](http://pypi.python.org/pypi/setuptools): \n\n ```\n easy_install --upgrade google-api-python-client\n ```\n\n### Manual install\n\n1. [Download the latest client\n library for Python](https://pypi.python.org/pypi/google-api-python-client/).\n2. Unpack the code.\n3. Install: \n\n ```\n python setup.py install\n ```\n\n### App Engine\n\nBecause the Python client libraries aren't installed in the\n[App Engine Python runtime environment](https://cloud.google.com/appengine/docs/python/),\nyou must [copy them into your application](https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring) just like third-party libraries.\n\nTo do that, run the following commands: \n\n```bash\n$ hg clone https://google-api-python-client.googlecode.com/hg/ google-api-python-client\n$ cd google-api-python-client\n$ sudo python setup.py install\n```\n\nYou can now import the classes you need using the following statements: \n\n```python\nfrom apiclient.discovery import build\nfrom apiclient.oauth import OAuthCredentials\n\nimport httplib2\nimport oauth2 as oauth\n```\n\n### PHP\n\nUsing the [Google APIs Client Library for PHP](https://github.com/google/google-api-php-client) requires that you download and install the PHP source.\n\nTo do that, run the following commands: \n\n```php\n$ svn checkout http://google-api-php-client.googlecode.com/svn/trunk/ google-api-php-client-read-only\n$ cd google-api-php-read-only\n$ # Copy the src directory to your working directory.\n```\n\nYou can now import the classes you need using the following statements: \n\n```php\nrequire_once \"../src/apiClient.php\";\n```\n\n### .NET\n\nUsing the [Google APIs Client Library for .NET](http://www.nuget.org/packages/Google.Apis/) requires that you download the core .NET client library and the Google Drive Activity API .NET library. Download the files and add them as references to your project:\n\n- [Core client library](http://www.nuget.org/packages/Google.Apis/)\n- [Google Drive Activity API library](/api-client-library/dotnet/apis)\n\nYou can now import the classes you need using the following statements: \n\n```text\nusing Google.Apis.Authentication;\nusing Google.Apis.Authentication.OAuth2;\n```"]]