Pull company data from Clearbit

If you want to grab info about a company, Clearbit can help you.

It takes only 3 simple steps with dashdash:

  1. Grab a key
  2. Send the request with GET
  3. Parse the request with PARSE

Grab a key

Go to clearbit.com and open your account. Login, and you can find your secret API key here.

Send the request

A1 = sk_9f30e20d... 
A2 = wikipedia.org
A3 =GET("https://company.clearbit.com/v2/companies/find?domain="&A2,'{"Authorization":"Basic '&BASE64(A1&":")&'"}')

A1 is your key. A2 is the company you’re looking for. A3 is the request itself.

Parse the request

A4 = PARSE(A3, "metrics.alexaGlobalRank")

To see where wikipedia stands in the rank of most visited websites in the world.

Know more

  • The second argument is the header. We need to set it because Clearbit asks you to authorise the request through Basic Auth.
  • Basic Auth is a common method for authorization. It requires an header to be sent whose key is Authorization, and its value is Basic <base 64 of user:pass>. Clearbit defines your secret key as the username, and has no password. So all you need to do, really, is convert “username:” to base64. Note: base64 is not encryption. Do not share your key, encoded or not.
  • As dashdash supports any header through JSON, all you need is to send a JSON in the form {"field name":"value"}, in the case of Basic Auth, its {"Authorization":"Basic c2tfOWYzMGU..."} for my key (which I won’t share, where c2tfOWYzMGU... is the base64 version of my key and a semicolon joined together). The formula presented puts it all together nicely. Also check a post on delimiters if you’re wondering why the header starts and ends with single-quotes.

About Clearbit

  • Rate limiting: 600 requests per minute.
  • Free quota per user: 2500 free requests per month.