Featured Products
- Home
- PHP Scripts
- Local Google Results Scraper - PHP Class
Local Google Results Scraper - PHP Class
By : techiehut Published on Tuesday, July 26, 2016,09:48:13 in PHP Scripts

PHP class to scrape local search results from Google. Customize the location, language, domain, and device type.
Features
API Documentation
Please refer to the Live Preview to see full API documentation and more code examples. Or you can search the available locations.Example code

<?php require "class.Google.php"; $google = new GoogleSearch(); $google->setLocation("new york"); $google->setQuery("nearby restaurants"); $google->setDevice("mobile"); // optional $google->setLanguage(new Language("es")); // optional $google->setProxy("123.211.1.13:8080", "user:pass"); // optional $page1 = $google->next(); $page2 = $google->next(); while ($result = $page1->fetch_array()) { $title = $result["title"]; $description = $result["description"]; $site = $result["site"]; $domain = $result["domain"]; echo $title . " - "; echo $domain . "<br>"; } ?>
Requirements
Changelog
Version 1.0.2 (Aug 1, 2016) - Added new "url" property to search results, to get the absolute URL of each result Version 1.01 - New techiehut documentation. - Fixed some domain names not parsing correctly. - Added new Location and Language classes. - Updated composer (PSR-4) code to follow specifications. Version 1.0 - Initial release