The following script is provided by google api php client
<?php
require_once 'src/Google_Client.php';
require_once 'src/contrib/Google_CustomsearchService.php';
session_start();
$client = new Google_Client();
$client->setApplicationName('Google CustomSearch PHP Starter Application');
$client->setDeveloperKey('API KEY');
$search = new Google_CustomsearchService($client);
try{
$result = $search->cse->listCse('burrito', array('cx' => 'SEARCH ENGINE ID'));
print "<pre>" .print_r($result, true) . "</pre>";
}catch(Exception $e)
{
echo("<pre>".print_r($e,true)."</pre>");
}
?>
When The script is executed the following error is displayed even when custom search
is enabled in the services
tab.
Google_ServiceException Object
(
[errors:protected] => Array
(
[0] => Array
(
[domain] => usageLimits
[reason] => accessNotConfigured
[message] => Access Not Configured
)
)