🏢 Ruby wrapper for the Demandbase API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
CHANGELOG.md
Gemfile
LICENSE.txt
README.md
Rakefile
VERSION
demandbase.gemspec

README.md

The Demandbase gem is a Ruby wrapper for the Demandbase real-time targeting and personalization platform's API.

Installation

Install the Demandbase wrapper with:

gem install demandbase

Configuraton

Set an environment variable called DEMANDBASE_RTID_KEY with the your RTID key value. You can sign up for a trial developer key here.

Usage

Domain Lookup

If everything's installed and configured you should be able to look up companies' information via their domain name as follows:

record = Demandbase::lookup_domain 'microsoft.com'
# => <Demandbase::Record:0x007fce82a46060>

record.company_name
# => "Microsoft Corporation"

record.is_academic?
# => false

record.is_government?
# => false

record.demandbase_sid
# => 457441

record.marketing_alias
# => "Microsoft"

record.industry
# => "Software & Technology"

record.sub_industry
# => "Software Applications"

record.employee_count
# => 94050

record.primary_sic
# => "7372"

record.street_address
# => "1 Microsoft Way"

record.city
# => "Redmond"

record.state
# => "WA"

record.zip
# => "98052"

record.country
# => "US"

record.country_name
# => "United States"

record.phone
# => "425-882-8080"

record.stock_ticker
# => "MSFT"

record.web_site
# => "microsoft.com"

record.annual_sales
# =>  73723000000

record.revenue_range
# =>  "Over $5B"

record.employee_range
# =>  "Enterprise"

record.b2b
# =>  true

record.b2c
# =>  true

record.traffic
# => "Very High"

record.latitude
# =>  47.6401

record.longitude
# =>  -122.13

record.fortune_1000
# =>  true

record.forbes_2000
# =>  true

IP Lookup

The IP lookup returns some additional information e.g.

record = Demandbase::lookup_ip '12.12.12.12'
# => <Demandbase::Record:0x007fce82a46060>

Lazy Lookup

If you have an IP, domain name, email address, or craptacular URL and just want to use that use lookup

ip_looking_thing = '12.12.12.12'
domain_looking_thing 'http://google.com'
url_looking_thing 'www.google.com/lol?seriously=true'
email_looking_thing 'willy@microsoft.com'

(Demandbase::lookup ip_looking_thing).class
# => Demandbase::IPRecord

(Demandbase::lookup domain_looking_thing).class
# => Demandbase::DomainRecord

(Demandbase::lookup url_looking_thing).class
# => Demandbase::DomainRecord

(Demandbase::lookup email_looking_thing).class
# => Demandbase::DomainRecord

DLC / Enhancements

  • Use the csi gem if you'd like to correlate SIC codes with NAICS codes.
  • Use the fortune-finder gem if you'd like to retrieve the ranking of a Fortune 500 company.
  • Use the forbes-finder gem if you'd like to retrieve the ranking of a Fortune 1000 company.

License

MIT.