Skip to content

Commit 20035dc

Browse files
author
vs
committed
add coordinates, update links to API
1 parent 07e02e3 commit 20035dc

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

outscraper/api_client.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def google_search(self, query: Union[list, str], pages_per_query: int = 1, uule:
143143
Returns:
144144
list: json result
145145
146-
See: https://app.outscraper.com/api-docs#tag/Google-Search/paths/~1google-search-v2/get
146+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1google-search-v3/get
147147
'''
148148
queries = as_list(query)
149149
wait_async = async_request or (len(queries) > 1 or pages_per_query > 1)
@@ -176,7 +176,7 @@ def google_search_news(self, query: Union[list, str], pages_per_query: int = 1,
176176
Returns:
177177
list: json result
178178
179-
See: https://app.outscraper.com/api-docs#tag/Google-Search/paths/~1google-search-news/get
179+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1google-search-news/get
180180
'''
181181
response = requests.get(f'{self._api_url}/google-search-news', params={
182182
'query': as_list(query),
@@ -215,7 +215,7 @@ def google_maps_search_v1(self, query: Union[list, str], limit: int = 500, extra
215215
Returns:
216216
list: json result
217217
218-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1search/get
218+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1search/get
219219
'''
220220
response = requests.get(f'{self._api_url}/maps/search', params={
221221
'query': as_list(query),
@@ -234,11 +234,12 @@ def google_maps_search_v1(self, query: Union[list, str], limit: int = 500, extra
234234
raise Exception(f'Response status code: {response.status_code}')
235235

236236
def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_duplicates: bool = False,
237-
language: str = 'en', region: str = None, skip: int = 0, enrichment: list = None, fields: Union[list, str] = None,
237+
language: str = 'en', region: str = None, skip: int = 0, coordinates: str = None,
238+
enrichment: list = None, fields: Union[list, str] = None,
238239
async_request: bool = False, ui: bool = None, webhook: bool = None
239240
) -> Union[list, dict]:
240241
'''
241-
Get Google Maps Data V2 (speed optimized endpoint for real time data)
242+
Get Google Maps Data V3 (speed optimized endpoint for real time data)
242243
243244
Returns places from Google Maps based on a given search query (or many queries).
244245
The results from searches are the same as you would see by visiting a regular Google Maps site. However, in most cases, it's recommended to use locations inside queries (e.g., bars, NY, USA) as the IP addresses of Outscraper's servers might be located in different countries.
@@ -247,10 +248,11 @@ def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_dupl
247248
Parameters:
248249
query (list | str): parameter defines the query you want to search. You can use anything that you would use on a regular Google Maps site. Additionally, you can use google_id. The example of valid queries: Real estate agency, Rome, Italy, The NoMad Restaurant, NY, USA, restaurants, Brooklyn 11203, 0x886916e8bc273979:0x5141fcb11460b226, etc. Using a lists allows multiple queries (up to 50) to be sent in one request and save on network latency time.
249250
limit (int): parameter specifies the limit of places to take from one query search. The same as on Google Maps site, there are no more than 400 organizations per one query search. Use more precise categories (e.g., Asian restaurant, Italian restaurant) and/or locations (e.g., restaurants, Brooklyn 11211, restaurants, Brooklyn 11215) to overcome this limitation.
250-
skip (int): skip first N places, where N should be multiple to 20 (e.g. 0, 20, 40). It's commonly used in pagination.
251251
drop_duplicates (bool): parameter specifies whether the bot will drop the same organizations from different queries. Using the parameter combines results from each query inside one big array.
252252
language (str): parameter specifies the language to use for Google. Available values: "en", "de", "es", "es-419", "fr", "hr", "it", "nl", "pl", "pt-BR", "pt-PT", "vi", "tr", "ru", "ar", "th", "ko", "zh-CN", "zh-TW", "ja", "ach", "af", "ak", "ig", "az", "ban", "ceb", "xx-bork", "bs", "br", "ca", "cs", "sn", "co", "cy", "da", "yo", "et", "xx-elmer", "eo", "eu", "ee", "tl", "fil", "fo", "fy", "gaa", "ga", "gd", "gl", "gn", "xx-hacker", "ht", "ha", "haw", "bem", "rn", "id", "ia", "xh", "zu", "is", "jw", "rw", "sw", "tlh", "kg", "mfe", "kri", "la", "lv", "to", "lt", "ln", "loz", "lua", "lg", "hu", "mg", "mt", "mi", "ms", "pcm", "no", "nso", "ny", "nn", "uz", "oc", "om", "xx-pirate", "ro", "rm", "qu", "nyn", "crs", "sq", "sk", "sl", "so", "st", "sr-ME", "sr-Latn", "su", "fi", "sv", "tn", "tum", "tk", "tw", "wo", "el", "be", "bg", "ky", "kk", "mk", "mn", "sr", "tt", "tg", "uk", "ka", "hy", "yi", "iw", "ug", "ur", "ps", "sd", "fa", "ckb", "ti", "am", "ne", "mr", "hi", "bn", "pa", "gu", "or", "ta", "te", "kn", "ml", "si", "lo", "my", "km", "chr".
253253
region (str): parameter specifies the region to use for Google. Available values: "AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AG", "AR", "AM", "AU", "AT", "AZ", "BS", "BH", "BD", "BY", "BE", "BZ", "BJ", "BT", "BO", "BA", "BW", "BR", "VG", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "CF", "TD", "CL", "CN", "CO", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "EE", "ET", "FJ", "FI", "FR", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GT", "GG", "GY", "HT", "HN", "HK", "HU", "IS", "IN", "ID", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KW", "KG", "LA", "LV", "LB", "LS", "LY", "LI", "LT", "LU", "MG", "MW", "MY", "MV", "ML", "MT", "MU", "MX", "FM", "MD", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NZ", "NI", "NE", "NG", "NU", "MK", "NO", "OM", "PK", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RO", "RU", "RW", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SK", "SI", "SB", "SO", "ZA", "KR", "ES", "LK", "SH", "VC", "SR", "SE", "CH", "TW", "TJ", "TZ", "TH", "TL", "TG", "TO", "TT", "TN", "TR", "TM", "VI", "UG", "UA", "AE", "GB", "US", "UY", "UZ", "VU", "VE", "VN", "ZM", "ZW".
254+
skip (int): skip first N places, where N should be multiple to 20 (e.g. 0, 20, 40). It's commonly used in pagination.
255+
coordinates (str): parameter defines the coordinates of the location where you want your query to be applied. It has to be constructed in the next sequence: "@" + "latitude" + "," + "longitude" + "," + "zoom" (e.g. "@41.3954381,2.1628662,15.1z").
254256
enrichment (list): parameter defines enrichments you want to apply to the results. Available values: "domains_service", "emails_validator_service", "disposable_email_checker", "whatsapp_checker", "imessage_checker", "phones_enricher_service", "trustpilot_service", "companies_data".
255257
fields (list | str): parameter defines which fields you want to include with each item returned in the response. By default, it returns all fields.
256258
async_request (bool): parameter defines the way you want to submit your task to Outscraper. It can be set to `False` (default) to send a task and wait until you got your results, or `True` to submit your task and retrieve the results later using a request ID with `get_request_archive`. Each response is available for `2` hours after a request has been completed.
@@ -259,17 +261,18 @@ def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_dupl
259261
Returns:
260262
list: json result
261263
262-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1search-v2/get
264+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1search-v3/get
263265
'''
264266
queries = as_list(query)
265267
wait_async = async_request or (len(queries) > 10 and limit > 1)
266268

267-
response = requests.get(f'{self._api_url}/maps/search-v2', params={
269+
response = requests.get(f'{self._api_url}/maps/search-v3', params={
268270
'query': queries,
269271
'language': language,
270272
'region': region,
271273
'organizationsPerQueryLimit': limit,
272274
'skipPlaces': skip,
275+
'coordinates': coordinates,
273276
'dropDuplicates': drop_duplicates,
274277
'async': wait_async,
275278
'enrichment': as_list(enrichment) if enrichment else '',
@@ -300,7 +303,7 @@ def google_maps_directions(self, query: Union[list, str], departure_time: int =
300303
Returns:
301304
list: json result
302305
303-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1directions/get
306+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1directions/get
304307
'''
305308
response = requests.get(f'{self._api_url}/maps/directions', params={
306309
'query': as_list(query),
@@ -349,7 +352,7 @@ def google_maps_reviews_v2(self, query: Union[list, str], reviews_limit: int = 1
349352
Returns:
350353
list: json result
351354
352-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1reviews-v2/get
355+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1reviews-v3/get
353356
'''
354357
response = requests.get(f'{self._api_url}/maps/reviews-v2', params={
355358
'query': as_list(query),
@@ -405,7 +408,7 @@ def google_maps_reviews(self, query: Union[list, str], reviews_limit: int = 10,
405408
Returns:
406409
list: json result
407410
408-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1reviews-v3/get
411+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1reviews-v3/get
409412
'''
410413
queries = as_list(query)
411414
wait_async = async_request or reviews_limit > 499 or len(queries) > 10
@@ -448,7 +451,7 @@ def google_maps_photos(self, query: Union[list, str], photosLimit: int = 100, li
448451
Returns:
449452
list: json result
450453
451-
See: https://app.outscraper.com/api-docs#tag/Google-Maps/paths/~1maps~1photos/get
454+
See: https://app.outscraper.com/api-docs#tag/Google/paths/~1maps~1photos-v3/get
452455
'''
453456
response = requests.get(f'{self._api_url}/maps/photos-v3', params={
454457
'query': as_list(query),
@@ -513,7 +516,7 @@ def emails_and_contacts(self, query: Union[list, str], fields: Union[list, str]
513516
Returns:
514517
list: json result
515518
516-
See: https://app.outscraper.com/api-docs#tag/Emails-and-Contacts
519+
See: https://app.outscraper.com/api-docs#tag/Email-Related/paths/~1emails-and-contacts/get
517520
'''
518521
response = requests.get(f'{self._api_url}/emails-and-contacts', params={
519522
'query': as_list(query),
@@ -536,7 +539,7 @@ def phones_enricher(self, query: Union[list, str], fields: Union[list, str] = No
536539
Returns:
537540
list: json result
538541
539-
See: https://app.outscraper.com/api-docs#tag/Phones/paths/~1phones-enricher/get
542+
See: https://app.outscraper.com/api-docs#tag/Phone-Related/paths/~1phones-enricher/get
540543
'''
541544
response = requests.get(f'{self._api_url}/phones-enricher', params={
542545
'query': as_list(query),
@@ -552,6 +555,8 @@ def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Unio
552555
ui: bool = None, webhook: bool = None
553556
) -> Union[list, dict]:
554557
'''
558+
Amazon Products V2 (speed optimized)
559+
555560
Returns information about products on Amazon.
556561
557562
Parameters:
@@ -564,12 +569,12 @@ def amazon_products(self, query: Union[list, str], limit: int = 24, fields: Unio
564569
Returns:
565570
list: json result
566571
567-
See: https://app.outscraper.com/api-docs#tag/Amazon/paths/~1amazon~1products/get
572+
See: https://app.outscraper.com/api-docs#tag/Amazon/paths/~1amazon~1products-v2/get
568573
'''
569574
queries = as_list(query)
570575
wait_async = async_request or (len(queries) > 1 and limit > 1)
571576

572-
response = requests.get(f'{self._api_url}/amazon/products', params={
577+
response = requests.get(f'{self._api_url}/amazon/products-v2', params={
573578
'query': queries,
574579
'limit': limit,
575580
'async': wait_async,
@@ -636,7 +641,7 @@ def yelp_search(self, query: Union[list, str], limit: int = 100,
636641
Returns:
637642
list: json result
638643
639-
See: https://app.outscraper.com/api-docs#tag/Yelp/paths/~1yelp-search/get
644+
See: https://app.outscraper.com/api-docs#tag/Others/paths/~1yelp-search/get
640645
'''
641646
queries = as_list(query)
642647
wait_async = async_request or len(queries) > 10
@@ -672,7 +677,7 @@ def yelp_reviews(self, query: Union[list, str], limit: int = 100, sort: str = 'r
672677
Returns:
673678
list: json result
674679
675-
See: https://app.outscraper.com/api-docs#tag/Yelp/paths/~1yelp~1reviews/get
680+
See: https://app.outscraper.com/api-docs#tag/Reviews-and-Comments/paths/~1yelp~1reviews/get
676681
'''
677682
queries = as_list(query)
678683
wait_async = async_request or limit > 499 or len(queries) > 10
@@ -708,7 +713,7 @@ def tripadvisor_reviews(self, query: Union[list, str], limit: int = 100,
708713
Returns:
709714
list: json result
710715
711-
See: https://app.outscraper.com/api-docs#tag/Tripadvisor/paths/~1tripadvisor~1reviews/get
716+
See: https://app.outscraper.com/api-docs#tag/Reviews-and-Comments/paths/~1trustpilot~1reviews/get
712717
'''
713718
queries = as_list(query)
714719
wait_async = async_request or limit > 499 or len(queries) > 10

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def readme():
88

99
setup(
1010
name='outscraper',
11-
version='4.1.0',
11+
version='5.0.0',
1212
description='Python bindings for the Outscraper API',
1313
long_description=readme(),
1414
classifiers = ['Programming Language :: Python',

0 commit comments

Comments
 (0)