Skip to content

valdiearsanur/Google-Custom-Search-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install Composer

php -r "readfile('https://getcomposer.org/installer');" | php

install composer.json php composer.phar install

Google Custom Search

Google's documentation for the Custom Search JSON API can be found here: https://developers.google.com/custom-search/json-api/v1/overview

Credentials

Search Engine ID - On the Custom Search Engine Control Panel, create a new search engine for the site you would like to integrate. Once created, you can retrieve your Search Engine ID from the Setup tab.

API Key - If you're using the free option, visit the Google Developers Console and create a project for your search engine. Within your project, you’ll need to enable the Custom Search API from the APIs tab. Finally, on the Credentials tab, you will need to create a Public API access key by selecting the Create new Key option and choosing Server key. The API Key will now be available.

Usage

include 'goog/GoogleCustomSearch.php';

define("SEARCH_ENGINE_ID", "[paste search engine ID here]");
define("API_KEY", "[paste api key here]");

$search = new goog\GoogleCustomSearch(SEARCH_ENGINE_ID, API_KEY);
$results = $search->search('komputer');

echo json_encode($results);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages