diff --git a/README.md b/README.md index fff3576..d35a1f1 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,6 @@ require_once('/path/to/outscraper-php/init.php'); Scrape Google Mpas results bu query "asian restaurants Berlin, Germany". ```php -require_once __DIR__ . '/vendor/autoload.php'; // change path as needed - $client = new ApiClient("your API_KEY from https://app.outscraper.com/profile"); $result = $client->google_maps_search(['asian restaurants Berlin, Germany'], 'en', 'DE'); @@ -46,8 +44,6 @@ print_r($result); Scrape Google Mpas reviews from Statue of Liberty National Monument. ```php -require_once __DIR__ . '/vendor/autoload.php'; // change path as needed - $result = $client->google_maps_reviews([ 'https://www.google.com/maps/place/Statue+of+Liberty+National+Monument/@40.6892494,-74.0466891,17z/data=!3m1!4b1!4m5!3m4!1s0x89c25090129c363d:0x40c6a5770d25022b!8m2!3d40.6892494!4d-74.0445004' ], limit: 10, sort: 'newest'); @@ -58,8 +54,6 @@ print_r($result); Scrape Emails & Contacts from domains. ```php -require_once __DIR__ . '/vendor/autoload.php'; // change path as needed - $result = $client->emails_and_contacts([ 'outscraper.com' ]); diff --git a/outscraper.php b/outscraper.php index 996dabd..1d0f410 100644 --- a/outscraper.php +++ b/outscraper.php @@ -10,7 +10,7 @@ * @link https://github.com/outscraper/outscraper-php */ class ApiClient { - public $version = "1.5.0"; + public $version = "1.5.1"; private $api_url = "https://api.app.outscraper.com"; private $api_headers; private $max_ttl = 60 * 60; @@ -256,10 +256,11 @@ public function google_maps_reviews_v3( "cutoff" => $cutoff, "cutoffRating" => $cutoff_rating, "reviewsQuery" => $reviews_query, - "sort" => $sort + "sort" => $sort, + "async" => FALSE, )); $result = $this->make_get_request("maps/reviews-v3?{$params}"); - return $this->wait_request_archive($result["id"]); + return $result["data"]; } /** @@ -272,9 +273,10 @@ public function google_maps_reviews_v3( public function emails_and_contacts(string|array $query) : array { $params = http_build_query(array( "query" => $this->to_array($query), + "async" => FALSE, )); $result = $this->make_get_request("emails-and-contacts?{$params}"); - return $this->wait_request_archive($result["id"]); + return $result["data"]; } /** @@ -287,9 +289,10 @@ public function emails_and_contacts(string|array $query) : array { public function phones_enricher(string|array $query) : array { $params = http_build_query(array( "query" => $this->to_array($query), + "async" => FALSE, )); $result = $this->make_get_request("phones-enricher?{$params}"); - return $this->wait_request_archive($result["id"]); + return $result["data"]; } }