Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/Contacts And Leads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Emails And Contacts Scraper With Python

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).

## Installation

Install the gem and add to the application's Gemfile by executing:
```bash
bundle add outscraper
```

If bundler is not being used to manage dependencies, install the gem by executing:
```bash
gem install outscraper
```

[Link to the Ruby package page](https://rubygems.org/gems/outscraper)

## Initialization
```ruby
require 'Outscraper'

client = Outscraper::Client.new('SECRET_API_KEY')
```
[Link to the profile page to create the API key](https://app.outscraper.com/profile)

## Usage

```ruby
# Search contacts from a website:
results = client.contacts_and_leads('outscraper.com')
```
26 changes: 26 additions & 0 deletions lib/outscraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,32 @@ def google_play_reviews(query, reviews_limit: 100, sort: 'most_relevant', cutoff
}).parsed_response['data']
end

def contacts_and_leads(
query,
fields: nil,
async_request: true,
preferred_contacts: nil,
contacts_per_company: 3,
emails_per_contact: 1,
skip_contacts: 0,
general_emails: false,
ui: false,
webhook: nil
)
response = self.class.get('/contacts-and-leads', query: {
query: query,
fields: fields ? Array(fields) : nil,
async: ui ? true : async_request,
preferred_contacts: preferred_contacts ? Array(preferred_contacts) : nil,
contacts_per_company: contacts_per_company,
emails_per_contact: emails_per_contact,
skip_contacts: skip_contacts,
general_emails: general_emails,
ui: ui,
webhook: webhook
}).parsed_response['data']
end

def emails_and_contacts(query)
response = self.class.get("/emails-and-contacts", 'query': {
query: query,
Expand Down
2 changes: 1 addition & 1 deletion lib/outscraper/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Outscraper
VERSION = "0.3.2"
VERSION = "0.3.3"
end