Skip to content

Commit 20eb7a4

Browse files
author
vlad-outscraper
committed
add domains and contacts
1 parent e0c97f9 commit 20eb7a4

File tree

3 files changed

+158
-1
lines changed

3 files changed

+158
-1
lines changed

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ result = api_client.google_play_reviews(
8080
'com.facebook.katana', reviewsLimit=20, language='en')
8181
```
8282

83+
## Emails & Contacts Scraper
84+
85+
```python
86+
from outscraper import ApiClient
87+
88+
api_client = ApiClient(api_key='SECRET_API_KEY')
89+
result = api_client.emails_and_contacts(['outscraper.com'])
90+
```
91+
8392
## Responses examples
8493

8594
Google Maps (Places) response example:
@@ -320,3 +329,62 @@ Google Play Reviews response example:
320329
]
321330
]
322331
```
332+
333+
Emails & Contacts Scraper response example:
334+
```json
335+
[
336+
{
337+
"query": "outscraper.com",
338+
"domain": "outscraper.com",
339+
"emails": [
340+
{
341+
"value": "[email protected]",
342+
"sources": [
343+
{
344+
"ref": "https://outscraper.com/",
345+
"extracted_on": "2021-09-27T07:45:30.386000",
346+
"updated_on": "2021-11-18T12:59:15.602000"
347+
},
348+
...
349+
]
350+
},
351+
{
352+
"value": "[email protected]",
353+
"sources": [
354+
{
355+
"ref": "https://outscraper.com/privacy-policy/",
356+
"extracted_on": "2021-11-18T12:51:39.716000",
357+
"updated_on": "2021-11-18T12:51:39.716000"
358+
}
359+
]
360+
}
361+
],
362+
"phones": [
363+
{
364+
"value": "12812368208",
365+
"sources": [
366+
{
367+
"ref": "https://outscraper.com/",
368+
"extracted_on": "2021-11-18T12:59:15.602000",
369+
"updated_on": "2021-11-18T12:59:15.602000"
370+
},
371+
...
372+
]
373+
}
374+
],
375+
"socials": {
376+
"facebook": "https://www.facebook.com/outscraper/",
377+
"github": "https://github.com/outscraper",
378+
"linkedin": "https://www.linkedin.com/company/outscraper/",
379+
"twitter": "https://twitter.com/outscraper",
380+
"whatsapp": "https://wa.me/12812368208",
381+
"youtube": "https://www.youtube.com/channel/UCDYOuXSEenLpt5tKNq-0l9Q"
382+
},
383+
"site_data": {
384+
"description": "Scrape Google Maps Places, Business Reviews, Photos, Play Market Reviews, and more. Get any public data from the internet by applying cutting-edge technologies.",
385+
"generator": "WordPress 5.8.2",
386+
"title": "Outscraper - get any public data from the internet"
387+
}
388+
}
389+
]
390+
```

README.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ Scrape Google Play Reviews
9595
result = api_client.google_play_reviews(
9696
'com.facebook.katana', reviewsLimit=20, language='en')
9797
98+
Emails & Contacts Scraper
99+
-------------------------
100+
101+
.. code:: python
102+
103+
from outscraper import ApiClient
104+
105+
api_client = ApiClient(api_key='SECRET_API_KEY')
106+
result = api_client.emails_and_contacts(['outscraper.com'])
107+
98108
Responses examples
99109
------------------
100110

@@ -338,3 +348,63 @@ Google Play Reviews response example:
338348
]
339349
]
340350
351+
Emails & Contacts Scraper response example:
352+
353+
.. code:: json
354+
355+
[
356+
{
357+
"query": "outscraper.com",
358+
"domain": "outscraper.com",
359+
"emails": [
360+
{
361+
"value": "[email protected]",
362+
"sources": [
363+
{
364+
"ref": "https://outscraper.com/",
365+
"extracted_on": "2021-09-27T07:45:30.386000",
366+
"updated_on": "2021-11-18T12:59:15.602000"
367+
},
368+
...
369+
]
370+
},
371+
{
372+
"value": "[email protected]",
373+
"sources": [
374+
{
375+
"ref": "https://outscraper.com/privacy-policy/",
376+
"extracted_on": "2021-11-18T12:51:39.716000",
377+
"updated_on": "2021-11-18T12:51:39.716000"
378+
}
379+
]
380+
}
381+
],
382+
"phones": [
383+
{
384+
"value": "12812368208",
385+
"sources": [
386+
{
387+
"ref": "https://outscraper.com/",
388+
"extracted_on": "2021-11-18T12:59:15.602000",
389+
"updated_on": "2021-11-18T12:59:15.602000"
390+
},
391+
...
392+
]
393+
}
394+
],
395+
"socials": {
396+
"facebook": "https://www.facebook.com/outscraper/",
397+
"github": "https://github.com/outscraper",
398+
"linkedin": "https://www.linkedin.com/company/outscraper/",
399+
"twitter": "https://twitter.com/outscraper",
400+
"whatsapp": "https://wa.me/12812368208",
401+
"youtube": "https://www.youtube.com/channel/UCDYOuXSEenLpt5tKNq-0l9Q"
402+
},
403+
"site_data": {
404+
"description": "Scrape Google Maps Places, Business Reviews, Photos, Play Market Reviews, and more. Get any public data from the internet by applying cutting-edge technologies.",
405+
"generator": "WordPress 5.8.2",
406+
"title": "Outscraper - get any public data from the internet"
407+
}
408+
}
409+
]
410+

outscraper/api_client.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .utils import as_list
55

66

7-
VERSION = '1.1.0'
7+
VERSION = '1.1.1'
88

99

1010
class ApiClient(object):
@@ -240,3 +240,22 @@ def google_play_reviews(self, query: list, reviewsLimit: int = 100, sort: str =
240240
return self._wait_request_archive(response.json()['id']).get('data', [])
241241

242242
raise Exception(f'Response status code: {response.status_code}')
243+
244+
def emails_and_contacts(self, query: list) -> list:
245+
'''
246+
Return email addresses, social links and phones from domains in seconds.
247+
248+
Parameters:
249+
query (list | str): Domains or links (e.g., outscraper.com).
250+
251+
Returns:
252+
list: json result
253+
'''
254+
response = requests.get(f'{self._api_url}/emails-and-contacts', params={
255+
'query': as_list(query),
256+
}, headers=self._api_headers)
257+
258+
if 199 < response.status_code < 300:
259+
return self._wait_request_archive(response.json()['id']).get('data', [])
260+
261+
raise Exception(f'Response status code: {response.status_code}')

0 commit comments

Comments
 (0)