Skip to content

Commit d9265a6

Browse files
author
vlad-outscraper
committed
add enrichemnts
1 parent 3ccef4a commit d9265a6

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

examples/Enrichments.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Using Enrichments Python
2+
3+
Using enrichments with [Outscraper API](https://app.outscraper.com/api-docs#tag/Google-Maps).
4+
5+
## Installation
6+
7+
Python 3+
8+
```bash
9+
pip install outscraper
10+
```
11+
12+
[Link to the Python package page](https://pypi.org/project/outscraper/)
13+
14+
## Initialization
15+
```python
16+
from outscraper import ApiClient
17+
18+
client = ApiClient(api_key='SECRET_API_KEY')
19+
```
20+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
21+
22+
## Usage
23+
24+
```python
25+
# Enriching data from Google Maps with Emails & Contacts Scraper (domains_service) and validating emails with Email Validator (emails_validator_service):
26+
results = client.google_maps_search('bars ny usa', enrichment=['domains_service', 'emails_validator_service'])
27+
```

outscraper/api_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def google_maps_search_v1(self, query: list, limit: int = 500, extract_contacts:
206206
raise Exception(f'Response status code: {response.status_code}')
207207

208208
def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_duplicates: bool = False,
209-
language: str = 'en', region: str = None, skip: int = 0, fields: list = None, async_request: bool = False
209+
language: str = 'en', region: str = None, skip: int = 0, enrichment: list = None, fields: list = None, async_request: bool = False
210210
) -> Union[list, dict]:
211211
'''
212212
Get Google Maps Data V2 (speed optimized endpoint for real time data)
@@ -222,6 +222,7 @@ def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_dupl
222222
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.
223223
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".
224224
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".
225+
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".
225226
fields (list): parameter defines which fields you want to include with each item returned in the response. By default, it returns all fields.
226227
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.
227228
@@ -241,6 +242,7 @@ def google_maps_search(self, query: Union[list, str], limit: int = 20, drop_dupl
241242
'skipPlaces': skip,
242243
'dropDuplicates': drop_duplicates,
243244
'async': wait_async,
245+
'enrichment': as_list(enrichment) if enrichment else '',
244246
'fields': ','.join(fields) if fields else '',
245247
}, headers=self._api_headers)
246248

0 commit comments

Comments
 (0)