One call
GET /v1/companies/enrich, the record if it's recent and an enrichment if not.
GET /v1/companies/enrich?domain= is the simplest way to get a company: one request, and the
answer is the company's record.
curl "https://api.hydrantapi.com/v1/companies/enrich?domain=hvidbjergbank.dk" \
-H "Authorization: Bearer $HYDRANT_API_KEY"What it does
- We have a recent record. If something in our record of the company was fetched in the last 30 days, you get it at once, and it costs a read: 1 credit.
- We don't. The company is enriched now, as
POST /v1/enrichmentswould, and the call waits up to 30 seconds for it. Most companies take 20 to 30 seconds.
| Status | When | Cost |
|---|---|---|
200 with the record | It was recent, or the enrichment ended in time | 1 credit, or 10 |
202 with the enrichment | The enrichment is still running after 30 seconds | 10 credits, given back if it finds no company |
404 company_not_found | The enrichment found no company at the domain | Nothing |
503 enrichment_failed | The enrichment failed on our side; retry after Retry-After | Nothing |
400 invalid_parameter | The domain isn't one | Nothing |
The key needs the enrich scope, because the call may start an enrichment. fields= and
include=evidence work as they do on GET /v1/companies/{domain}.
A 202
A 202 carries the enrichment, with its status_url (also in the
Location header). Follow that, or call GET /v1/companies/enrich again: while the
enrichment runs, asking again for the domain gets the same one and isn't charged again. Once
it has ended, the record is recent, and the next call answers at once.
With a test key
A test key reads the sandbox: its companies come back however old their records
are, and any other domain is a 404.