Skip to content

Commit 0b36d45

Browse files
authored
added contacts and leads, examples (#6)
* added contacts and leads, examples * bump version to 0.3.3
1 parent 6b0c2e4 commit 0b36d45

3 files changed

Lines changed: 59 additions & 1 deletion

File tree

‎examples/Contacts And Leads.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Emails And Contacts Scraper With Python
2+
3+
Allows finding email addresses, social links, and phones from domains via [Outscraper API](https://app.outscraper.cloud/api-docs#tag/Email-Related/paths/~1contacts-and-leads/get).
4+
5+
## Installation
6+
7+
Install the gem and add to the application's Gemfile by executing:
8+
```bash
9+
bundle add outscraper
10+
```
11+
12+
If bundler is not being used to manage dependencies, install the gem by executing:
13+
```bash
14+
gem install outscraper
15+
```
16+
17+
[Link to the Ruby package page](https://rubygems.org/gems/outscraper)
18+
19+
## Initialization
20+
```ruby
21+
require 'Outscraper'
22+
23+
client = Outscraper::Client.new('SECRET_API_KEY')
24+
```
25+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
26+
27+
## Usage
28+
29+
```ruby
30+
# Search contacts from a website:
31+
results = client.contacts_and_leads('outscraper.com')
32+
```

‎lib/outscraper.rb‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,32 @@ def google_play_reviews(query, reviews_limit: 100, sort: 'most_relevant', cutoff
122122
}).parsed_response['data']
123123
end
124124

125+
def contacts_and_leads(
126+
query,
127+
fields: nil,
128+
async_request: true,
129+
preferred_contacts: nil,
130+
contacts_per_company: 3,
131+
emails_per_contact: 1,
132+
skip_contacts: 0,
133+
general_emails: false,
134+
ui: false,
135+
webhook: nil
136+
)
137+
response = self.class.get('/contacts-and-leads', query: {
138+
query: query,
139+
fields: fields ? Array(fields) : nil,
140+
async: ui ? true : async_request,
141+
preferred_contacts: preferred_contacts ? Array(preferred_contacts) : nil,
142+
contacts_per_company: contacts_per_company,
143+
emails_per_contact: emails_per_contact,
144+
skip_contacts: skip_contacts,
145+
general_emails: general_emails,
146+
ui: ui,
147+
webhook: webhook
148+
}).parsed_response['data']
149+
end
150+
125151
def emails_and_contacts(query)
126152
response = self.class.get("/emails-and-contacts", 'query': {
127153
query: query,

‎lib/outscraper/version.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Outscraper
4-
VERSION = "0.3.2"
4+
VERSION = "0.3.3"
55
end

0 commit comments

Comments
 (0)