diff --git a/examples/Contacts And Leads.md b/examples/Contacts And Leads.md new file mode 100644 index 0000000..2eed3f3 --- /dev/null +++ b/examples/Contacts And Leads.md @@ -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') +``` diff --git a/lib/outscraper.rb b/lib/outscraper.rb index 0ecdfad..d5974b2 100644 --- a/lib/outscraper.rb +++ b/lib/outscraper.rb @@ -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, diff --git a/lib/outscraper/version.rb b/lib/outscraper/version.rb index 7222609..39d13fc 100644 --- a/lib/outscraper/version.rb +++ b/lib/outscraper/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Outscraper - VERSION = "0.3.2" + VERSION = "0.3.3" end