Skip to content

Commit 24cda98

Browse files
authored
Support "search_type" parameter, and allow setting custom parameters (#6)
1 parent 3e5cbb5 commit 24cda98

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/LaravelScrapingBeeGoogleSearch.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ public function search(string $query): self
5555
return $this;
5656
}
5757

58+
/**
59+
* https://www.scrapingbee.com/documentation/google/#search_type
60+
*/
61+
public function searchType(string $type): self
62+
{
63+
$this->params['search_type'] = $type;
64+
65+
return $this;
66+
}
67+
5868
/**
5969
* https://www.scrapingbee.com/documentation/google/#country_code
6070
*/
@@ -115,6 +125,17 @@ public function addHtml(): self
115125
return $this;
116126
}
117127

128+
/*
129+
* If the API hasn't caught up and you need to support a new ScrapingBee parameter,
130+
* you can set it using this method.
131+
*/
132+
public function setParam(string $key, mixed $value): self
133+
{
134+
$this->params[$key] = $value;
135+
136+
return $this;
137+
}
138+
118139
private function reset(): self
119140
{
120141
$this->params = [];

0 commit comments

Comments
 (0)