PHPackages                             bluora/php-google-books-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bluora/php-google-books-api

ActiveLibrary[API Development](/categories/api)

bluora/php-google-books-api
===========================

Provides an interface to the Google Books API

35671[1 issues](https://github.com/bluora/php-google-books-api/issues)PHP

Since Aug 18Pushed 8y agoCompare

[ Source](https://github.com/bluora/php-google-books-api)[ Packagist](https://packagist.org/packages/bluora/php-google-books-api)[ RSS](/packages/bluora-php-google-books-api/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Google Books API for PHP
========================

[](#google-books-api-for-php)

An easy to use php client for using Google Books API.

Requirements
------------

[](#requirements)

- [PHP](https://php.net) 5.5+
- [Google API](https://console.developers.google.com) Service account key

Installation
------------

[](#installation)

```
$ composer require bluora/php-google-books-api dev-master
```

You can also add this package to your `composer.json` file:

`"bluora/php-google-books-api": "dev-master"`

Then run `composer update` to download the package to your vendor directory.

Configuration
-------------

[](#configuration)

There are several ways to set the Google API Service account key.

Using your envionrment file, using `putenv` in a config file, or at time of use of the GoogleBookApi class instantiation.

.env file

```
GOOGLE_BOOKS_API_KEY="xxx...xxx"

```

PHP Configuration

```
putenv('GOOGLE_BOOKS_API_KEY=xxx...xxx'));
```

```
$lookup = new GoogleBooksApi(['key' => 'xxx...xxx']);
```

Usage
-----

[](#usage)

### Basic

[](#basic)

Let's get `The Google story` using it's ISBN.

NOTE: The returned value will be null if the query can't find the record.

```
$book = (new GoogleBooksApi())
    ->isbn('9780553804577')->first();
```

An associative array of values is returned. The contents of the book data is different based on the geolocation of your the host's IP address.

This package implements Iterator and Countable so it provides both count and the ability to treat it as an array using a foreach.

NOTE: Before returning a result, `count` will load the first `page` of results.

```
$books = (new GoogleBooksApi())
    ->search('google');

echo 'Total books in result: ' . count($books) . '; Total pages: '.$lookup->totalPages();
```

Would output:

```
Total books in result: 511; Total pages: 52

```

As it implements `Interator`, calling `foreach` will load new books as it reaches the end of the current results.

If you only want to load a certain number of books, then use `limit` to only load more pages of books.

NOTE: Setting the limit will automatically set the number of records per page up to an API maximum of 40. After 40, it will request the remaining values in further API calls.

```
$books = (new GoogleBooksApi())
    ->search('google')
    ->limit(12);

echo 'Total: '.count($lookup)."; Pages: ".$lookup->totalPages()."\n";

foreach ($lookup as $key => $book) {
    echo $key." - ".$book['title']."\n";
}
```

Would output:

```
Total: 511; Pages: 43
0 - The Google Legacy
1 - Google
2 - The Google Model
3 - Google Chrome
4 - Using Google AdWords and AdSense
5 - Making Google Adsense Work for the 9 to 5 Professional - Tips and Strategies to Earn More from Google Adsense
6 - Google Search & Rescue For Dummies
7 - Using Google and Google Tools in the Classroom, Grades 5 & Up
8 - Programming Google App Engine
9 - Python for Google App Engine
10 - Google and the Law
11 - Planet Google

```

You can call `all` to get the complete array of results.

```
$books = (new GoogleBooksApi())
    ->search('google')
    ->limit(12)
    ->all();

foreach ($books as $key => $book) {
    echo $key." - ".$book['title']."\n";
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5270e3a3d1add4e39f12dfde3ce549999a26f759d7128056083ab07f475259f2?d=identicon)[bluora](/maintainers/bluora)

---

Top Contributors

[![RoccoHoward](https://avatars.githubusercontent.com/u/227896?v=4)](https://github.com/RoccoHoward "RoccoHoward (8 commits)")[![rubencougil](https://avatars.githubusercontent.com/u/1073799?v=4)](https://github.com/rubencougil "rubencougil (1 commits)")

### Embed Badge

![Health badge](/badges/bluora-php-google-books-api/health.svg)

```
[![Health](https://phpackages.com/badges/bluora-php-google-books-api/health.svg)](https://phpackages.com/packages/bluora-php-google-books-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
