If you want to grab info about a company, Clearbit can help you.
It takes only 3 simple steps with dashdash:
- Grab a key
- Send the request with GET
- 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 isBasic <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, wherec2tfOWYzMGU...
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’s Enrichment API
-
Rate limiting: 600 requests per minute.
-
- $99 / 1000 requests per month
- $199 / 2500 requests per month
Check out the full API Documentation here.