How to enrich company data with an API
Call enrichment with a domain, store nulls on purpose, and keep the vendor's timestamp beside the value.
An enrichment API is a function from a key to a record. The engineering is ordinary, and the damage comes from treating it as a form filler. This is the pattern we would want a client of the planned Roboteer API to follow. The host is not live. Use the pattern with whatever vendor you already call, and use the example JSON on the API page only as a shape.
Keys and retries
Send a domain. If you only have a name, resolve the domain in a separate step you can inspect, because a bad domain poisons every field downstream. Treat 404 as "no record" and keep the input row. Treat 429 as backoff, not as a data result. Do not retry a 422. A validation error means the key should not have been sent, and retrying it will not make the person exist.
Make the job idempotent. The same domain in the same run should not create two CRM accounts because the worker crashed after the write and before the acknowledgement. Store the vendor's response body, or a hash of it, next to your write.
Nulls, status and time
Persist nulls. A missing employee count that you replace with zero will be summed by someone in finance. Persist the status if the vendor sends one. If they do not, record that the status was absent, so a later vendor that does send it can be distinguished. Persist last_observed. If you only store the date you called the API, you have measured your cron, and you will misread it as freshness.
The worked fictional payload on the API page uses northline.example for this reason. Copy the shape into a test double. Do not point a production job at api.roboteer.co.uk.
A small client checklist
- One parser for search hits and enrichment hits, if the vendor really uses one schema. Test it. Marketing pages lie about this more often than they lie about price.
- A dead-letter row for ambiguous matches, reviewed by a person, not auto-merged.
- A suppression list checked before display, not after a complaint.
- A cost log per successful field, so the invoice can be explained.
- Secrets in a secret store. Not in the ticket where someone pasted a curl command.
Agents
If an agent will call the same API, give it the tool and the nulls, and forbid it from filling gaps in prose. The longer version is on AI agents. The protocol-level version is MCP, which is specified and not deployed.
Questions
Can I test this against Roboteer?
No. There is no key and no server. The article is the pattern, not a quickstart for a live host.