Google Site Search custom search PHP Wrapper Library

Installs: 17

Dependents: 0

Suggesters: 0

Stars: 18

Watchers: 3

Forks: 6

Open Issues: 0

v1.0.1 2013-09-17 19:54 UTC


Build Status

Search engine for websites using Google Custom Search Engine with a Google Site Search account.

Google Site Search API

To use the Google Site Search API, you have to obtain a search engine ID from Google.


This library uses PHP 5.3+.


It is recommended that you install the PHP Google Site Search library through composer.

    "require": {
        "gabrielbull/sitesearch": "dev-master"


The SiteSearch class allows you to search Google Custom Search Engine. All you have to provide is a search engine ID and a query.



$siteSearch = new SiteSearch($id);
$results = $siteSearch->search('kittens');

foreach($results as $result) {
    echo $result['title'];



foreach(SiteSearch::create($id)->search('cats') as $result) {
    echo $result['title'];


The search method parameters are:

  • value The search query.
  • start The offset of the first result to return.
  • limit The number of results to return.


The search results will contain the following parameters:

  • link The link of the page.
  • title The title of the page.
  • description The description of the page.
  • lang The language of the page.
  • image An image associated with the page (src).
  • thumbnail A thumbnail of the image (src, width and height).