PHPackages                             jfkz/google-custom-search-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. jfkz/google-custom-search-api

ActiveLibrary[API Development](/categories/api)

jfkz/google-custom-search-api
=============================

Google Custom Search api

0.3(6y ago)0488PHP

Since Nov 5Pushed 6y agoCompare

[ Source](https://github.com/jfkz/google-apis-php-clients)[ Packagist](https://packagist.org/packages/jfkz/google-custom-search-api)[ RSS](/packages/jfkz-google-custom-search-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Google APIs PHP Clients
=======================

[](#google-apis-php-clients)

The aim of this project is to create a well structured PHP library for accessing Google APIs available through the [Google APIs console](https://code.google.com/apis/console/).

Currently the library enables you to interact programmatically with the following Google APIs,

- [Google Custom Search API v1](https://code.google.com/apis/customsearch/v1/overview.html)
- [Google Translate API v2](http://code.google.com/apis/language/translate/overview.html) *(Paid service only as of Dec 1st, 2011)*
- (More coming soon)

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

[](#requirements)

- The library is only supported on PHP 5.3.0 and up.
- It has been assumed an autoloader will be present. If you require one, you can find one [here](http://groups.google.com/group/php-standards/web/psr-0-final-proposal).
- Each API requires an API key, which you can get from the [Google APIs console](https://code.google.com/apis/console/).

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

[](#installation)

Simply download the library and add the `src` folder to your project.

Usage
-----

[](#usage)

**Note:** More extensive documentation will be made available at a later date.

### Custom Search API

[](#custom-search-api)

**Note:** As well as an API key, the [Google Custom Search API v1](https://code.google.com/apis/customsearch/v1/overview.html) also requires either a [Google Custom Search](http://www.google.com/cse/) ID or specification URL.

The following makes a simple [Google Custom Search API v1](https://code.google.com/apis/customsearch/v1/overview.html) request,

```
$apiClient = new \Google\Api\CustomSearch();
$apiClient->setApiKey('INSERT_YOUR_API_KEY_HERE');
$apiClient->setCustomSearchEngineId('INSERT_YOUR_CUSTOM_SEARCH_ENGINE_ID_HERE');
$apiClient->setQuery('flowers');

$response = $apiClient->executeRequest();

```

To get the results from the `$response`,

```
if ($response->isSuccess())
{
    foreach($response->getData()->getItems() as $item)
    {
        echo $item->getHtmlTitle(), ' - ', $item->getDisplayLink(), '';
    }
}

```

### Translate API

[](#translate-api)

The following makes a simple [Google Translate API v2](http://code.google.com/apis/language/translate/overview.html) request,

```
$apiClient = new \Google\Api\Translate();
$apiClient->setApiKey('INSERT_YOUR_API_KEY_HERE');
$apiClient->addSourceText('The quick brown fox jumps over the lazy dog.');
$apiClient->setTargetLanguage('fr');

$response = $apiClient->executeRequest();

```

To get the translations from the `$response`,

```
if ($response->isSuccess())
{
    foreach($response->getData()->getTranslations() as $translation)
    {
        echo $translation->getTranslatedText(), '';
    }
}

```

Testing
-------

[](#testing)

To run the tests, make sure you have PHPUnit 3.6.0 and up installed, and just run the following in the project root,

```
phpunit

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.8% 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b0c4fc6a7297b413a04efd92d894942920bd2ed0110fb67308606410cf52855?d=identicon)[jfkz](/maintainers/jfkz)

---

Top Contributors

[![stephenmelrose](https://avatars.githubusercontent.com/u/210524?v=4)](https://github.com/stephenmelrose "stephenmelrose (43 commits)")[![jfkz](https://avatars.githubusercontent.com/u/328452?v=4)](https://github.com/jfkz "jfkz (3 commits)")[![orvice](https://avatars.githubusercontent.com/u/1532235?v=4)](https://github.com/orvice "orvice (2 commits)")[![davidebuldrini](https://avatars.githubusercontent.com/u/3622217?v=4)](https://github.com/davidebuldrini "davidebuldrini (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jfkz-google-custom-search-api/health.svg)

```
[![Health](https://phpackages.com/badges/jfkz-google-custom-search-api/health.svg)](https://phpackages.com/packages/jfkz-google-custom-search-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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