googleapis /google-api-php-client

A PHP client library for accessing Google APIs

★ 9,812⑂ 3,531👁 552⑃ 784● 1,836▤ 81
9,812
stars
+0+1+-1
3,531
forks
552
watchers
784
prs
1,836
issues
81
releases
–
discussions

README

!

 Google APIs Client Library for PHP 

NOTE: please check to see if the package you'd like to install is available in our
list of Google cloud packages first, as
these are the recommended libraries.


  Reference Docshttps://googleapis.github.io/google-api-php-client/
  LicenseApache 2.0


The Google API Client Library enables you to work with Google APIs such as Gmail, Drive or YouTube on your server.

These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

 Google Cloud Platform

For Google Cloud Platform APIs such as [Datastore][cloud-datastore], [Cloud Storage][cloud-storage], [Pub/Sub][cloud-pubsub], and [Compute Engine][cloud-compute], we recommend using the Google Cloud client libraries. For a complete list of supported Google Cloud client libraries, see googleapis/google-cloud-php.

[cloud-datastore]: https://github.com/googleapis/google-cloud-php-datastore
[cloud-pubsub]: https://github.com/googleapis/google-cloud-php-pubsub
[cloud-storage]: https://github.com/googleapis/google-cloud-php-storage
[cloud-compute]: https://github.com/googleapis/google-cloud-php-compute

 Requirements 
 PHP 8.0 or higher

 Developer Documentation 

The docs folder provides detailed guides for using this library.

 Installation 

You can use Composer or simply Download the Release

 Composer

The preferred method is via composer. Follow the
installation instructions if you do not already have
composer installed.

Once composer is installed, execute the following command in your project root to install this library:

sh
composer require google/apiclient


If you're facing a timeout error then either increase the timeout for composer by adding the env flag as COMPOSER_PROCESS_TIMEOUT=600 composer install or you can put this in the config section of the composer schema:

{
    "config": {
        "process-timeout": 600
    }
}


Finally, be sure to include the autoloader:

php
require_once '/path/to/your-project/vendor/autoload.php';


This library relies on google/apiclient-services. That library provides up-to-date API wrappers for a large number of Google APIs. In order that users may make use of the latest API clients, this library does not pin to a specific version of google/apiclient-services. In order to prevent the accidental installation of API wrappers with breaking changes, it is highly recommended that you pin to the latest version yourself prior to using this library in production.

 Cleaning up unused services

There are over 200 Google API services. The chances are good that you will not
want them all. In order to avoid shipping these dependencies with your code,
you can run the Google\Task\Composer::cleanup task and specify the services
you want to keep in composer.json:

json
{
    "require": {
        "google/apiclient": "^2.15.0"
    },
    "scripts": {
        "p

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON