PHP code example of gmapsleadfinder / google-maps-scraper
1. Go to this page and download the library: Download gmapsleadfinder/google-maps-scraper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gmapsleadfinder / google-maps-scraper example snippets
use GmapsLeadFinder\GoogleMapsScraper\Client;
$client = new Client(); // reads GMF_API_KEY
$me = $client->me();
echo $me['plan'], ' ', $me['creditsRemaining'], "\n";
$rows = $client->scrape('dentists in Austin TX');
echo count($rows), "\n";
// Single-place reviews / photos (run sequentially — one in-flight job per user)
$reviews = $client->scrapeReviews('https://maps.google.com/?cid=…');
$photos = $client->scrapePhotos('ChIJ…'); // Place ID, URL, or business_id
echo count($reviews), ' ', count($photos), "\n";
bash
export GMF_API_KEY=gmf_your_key_here
bash
composer install
php examples/quickstart.php
php bin/gmaps-scraper me
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.