Local Google Results Scraper – PHP Class Download


Local Google Results Scraper - PHP Class Download

PHP class to scrape native search outcomes from Google. Customise the situation, language, area, and machine kind.

Please word that this isn’t an utility. It is just code, and you need to know PHP to be able to use it.


  • Scrape native search outcomes from over 92,000 locations worldwide.
  • Disables & overrides Google’s computerized location detection.
  • Scrape limitless pages.
  • Set the language for search outcomes.
  • Simply swap between desktop, pill, or cell.
  • Use any Google area (google.com, google.nl, and so on)
  • Proxy assist – with non-compulsory person/go authentication
  • Quick & light-weight parsing – doesn’t use a DOM.
  • Composer-ready (PSR-4) model included.

API Documentation

Please seek advice from the Live Preview to see full API documentation and extra code examples. Or you’ll be able to search the accessible areas.

Instance code

    require "class.Google.php";

    $google = new GoogleSearch();
    $google->setLocation("big apple");
    $google->setQuery("close by eating places");
    $google->setDevice("cell"); // non-compulsory
    $google->setLanguage(new Language("es")); // non-compulsory
    $google->setProxy("", "person:go"); // non-compulsory

    $page1 = $google->subsequent();
    $page2 = $google->subsequent();

    whereas ($outcome = $page1->fetch_array()) {
        $title = $outcome["title"];
        $description = $outcome["description"];
        $web site = $outcome["site"];
        $area = $outcome["domain"];

        echo $title . " - ";
        echo $area . "<br>";


  • PHP 5.4 +
  • CURL


Model 1.12 (April 01, 2020)
- Schema replace (see under).

Model 1.09 (Feb 11, 2020)
- Schema replace (see under).

Model 1.08 (Feb 01, 2020)
- Schema replace (see under).

Model 1.07 (Sep 23, 2019)
- Now you can set location to null (or not specify it) to let Google routinely detect your location.

Model 1.06 (Jun 13, 2019)
- Schema replace (see under).

Model 1.04 (Oct 6, 2016)
- Mounted first merchandise in search outcomes being skipped when calling fetch_array or fetch_object.
- Up to date Google Maps snippets to match Google's newest structure modifications.

Model 1.03 (Aug 2, 2016)
- Added new location property to Google Place information, containing the place's tackle.
- Mounted Google redirection from google.com to native nation.
- Mounted uncommon lacking objects from the search outcomes.
- Mounted referrer not being set correctly when connecting to Google.

Model 1.02 (Aug 1, 2016)
- Added new "url" property to look outcomes, to get absolutely the URL of every outcome

Model 1.01
- New techiehut documentation.
- Mounted some domains not parsing accurately.
- Added new Location and Language lessons.
- Up to date composer (PSR-4) code to observe specs.

Model 1.0
- Preliminary launch

What’s a schema replace?

This script makes use of schemas to parse search outcome pages moderately than counting on DOM parsing. This makes the category exceptionally quicker and extra memory-efficient. Nonetheless, it additionally signifies that the category must be up to date each time Google modifications sure elements of their HTML, which is what I name a “schema replace.”


Be the first to comment

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.