A PHP client library for accessing Google APIs. This project is a fork of the official Google API PHP Client.
- Simplified access to various Google APIs.
- Lightweight and efficient design for PHP developers.
- Extensively documented for ease of use.
Ensure you have the following installed:
- PHP 7.4 or higher
- Composer dependency manager
Install the library using Composer:
composer require google/apiclient
Here is an example of how to use this client:
<?php
require_once 'vendor/autoload.php';
$client = new Google_Client();
$client->setApplicationName('My Application');
$client->setDeveloperKey('YOUR_API_KEY');
// Example: Accessing the YouTube API
$service = new Google_Service_YouTube($client);
$response = $service->search->listSearch('id,snippet', [
'q' => 'Google Developers',
'maxResults' => 10,
]);
foreach ($response['items'] as $item) {
echo $item['snippet']['title'], "\n";
}
Complete documentation can be found on the official site.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Special thanks to the Google APIs team for the original implementation of this library.