dev-master
9999999-dev https://github.com/gavroche/php-sitesearchGoogle Site Search custom search PHP Wrapper Library
MIT
by Gabriel Bull
api search google engine custom site
Wallogit.com
2017 © Pedro Peláez
Google Site Search custom search PHP Wrapper Library
Search engine for websites using Google Custom Search Engine with a Google Site Search account., (*2)
To use the Google Site Search API, you have to obtain a search engine ID from Google., (*3)
This library uses PHP 5.3+., (*4)
It is recommended that you install the PHP Google Site Search library through composer., (*5)
{
"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., (*6)
$id = "YOUR_SEARCH_ENGINE_ID";
$siteSearch = new SiteSearch($id);
$results = $siteSearch->search('kittens');
foreach($results as $result) {
echo $result['title'];
}
or:, (*7)
$id = "YOUR_SEARCH_ENGINE_ID";
foreach(SiteSearch::create($id)->search('cats') as $result) {
echo $result['title'];
}
The search method parameters are:, (*8)
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:, (*9)
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).Google Site Search custom search PHP Wrapper Library
MIT
api search google engine custom site