Skip to content

Commit

Permalink
Fix docs, improve speed for fast endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-stack committed Jul 19, 2022
1 parent 5c2daf3 commit 8ad7289
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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');
Expand All @@ -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'
]);
Expand Down
13 changes: 8 additions & 5 deletions outscraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"];
}

/**
Expand All @@ -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"];
}

/**
Expand All @@ -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"];
}
}

Expand Down

0 comments on commit 8ad7289

Please sign in to comment.