PHP SDK
Last updated
composer require serphouse/serphouse-phprequire 'vendor/autoload.php';
use Serphouse\SERPHouseClient;
$client = new SERPHouseClient('YOUR_API_KEY');$response = $client->serpApi->live([
'data' => [
'q' => 'apple',
'domain' => 'google.com',
'lang' => 'en',
'device' => 'desktop',
'serp_type' => 'web',
'loc' => 'Texas, United States',
'page' => 1,
'num_result' => 10,
]
]);$response = $client->serpApi->schedule([
'data' => [
[
'q' => 'Coffee',
'domain' => 'google.com',
'lang' => 'en',
'device' => 'desktop',
'serp_type' => 'web',
'loc' => 'Texas, United States',
'postback_url' => '...',
'pingback_url' => '...',
]
]
]);$response = $client->serpApi->check($searchId);$response = $client->serpApi->get($searchId);$response = $client->serpApi->get($searchId, 'html');$response = $client->domains->list();$response = $client->languages->list();$response = $client->languages->list([
'type' => 'bing'
]);$response = $client->location->search([
'q' => 'Texas'
]);$response = $client->account->fetch();$response->getStatusCode();$response->getResponse();$response->getErrorMessage();try {
$response = $client->serpApi->live(...);
} catch (SERPHouseUnauthorizedException $e) {
}
catch (SERPHouseRateLimitExceededException $e) {
}
catch (SERPHouseServerErrorException $e) {
}