How to call any API from Clay, one row at a time (with a real example)
Clay has a lot of data providers built in. But sooner or later, the data you need sits behind an API that is not in the list: a niche industry database, your own backend, a public endpoint you found in someone's docs.
This post shows how to turn any HTTP API into a Clay column, using a small Apify Actor I built for that job, HTTP Request. We will build a real column as an example: which email provider does each company use? (Google Workspace, Microsoft 365, something else). That is a useful signal for sales teams selling anything that plugs into email, and it costs nothing in API keys: the answer is public, in the company's DNS records.
The idea
For each row of your Clay table, Clay starts a run of the Actor with a small JSON input that describes one HTTP call. The Actor makes the call, retries it if the API answers 429 or 5xx, and returns one row with:
-
statusCodeandok -
body: the answer, already parsed when it is JSON -
errorTypewhen there was no answer at all (dns_error,timeout...)
You then map fields of body to new Clay columns.
Step 1: connect Apify to Clay
- Create a free Apify account and copy your API token from Settings > API & Integrations.
- In your Clay table, click Add enrichment, search for Apify and pick Run Apify Actor.
- Paste the token to connect your account, then choose the Actor
data_xplorer/http-request.
Step 2: describe the call
Our table has a Domain column. Google publishes a free DNS over HTTPS endpoint that returns the MX records (the mail servers) of any domain as JSON:
https://dns.google/resolve?name=apify.com&type=MX In the Input Data box, write the call and insert the Domain column where the domain goes (type / in Clay to pick a column):
{ "url": "https://dns.google/resolve", "params": { "name": "/Domain", "type": "MX" } } Run the column on two or three rows first. Each run returns one row, and body.Answer holds the mail servers:
| Domain | Mail servers (body.Answer[].data) | Provider |
|---|---|---|
| apify.com | alt1.aspmx.l.google.com. ... | Google Workspace |
| github.com | github-com.mail.protection.outlook.com. | Microsoft 365 |
Step 3: turn the answer into a clean column
Add a Clay formula column on top of the result:
- contains
google.comorgooglemail.com: Google Workspace - contains
outlook.com: Microsoft 365 - empty: no email on this domain
- anything else: other (often a security gateway such as Mimecast or Proofpoint, which is a signal in itself)
That is it: a new enrichment column, built on an API Clay knows nothing about.
Using an API that needs a key
Most APIs want a key in a header. Same pattern:
{ "url": "https://api.example.com/v1/companies", "params": { "domain": "/Domain" }, "headers": { "X-API-Key": "YOUR_API_KEY" } } The key reaches the API untouched, and it is masked ([REDACTED]) in the stored results, so you can share runs without leaking it.
Shortcut: paste the curl command from the docs
Nearly every API documentation shows its examples as curl commands. You do not have to translate them into JSON: paste the command as is, and insert your column inside it.
{ "curl": "curl 'https://api.example.com/v1/companies?domain=/Domain' -H 'X-API-Key: YOUR_API_KEY'" } The address, method, headers and body are read from the command. The same works for POST requests with a JSON body (-X POST -H 'Content-Type: application/json' -d '{...}'), and for what your browser gives you with Copy as cURL in the developer tools.
Why not just call the API directly?
For a handful of calls, you can. Where the Actor helps:
- Rate limits: a 429 or a 503 is retried with growing pauses, following the
Retry-Afterheader when the API sends one, instead of leaving an error in your table. - Clear failures: a row that fails tells you why (
dns_errorfor a dead domain,timeout,tls_error), so you can filter those rows out. - Country: with Apify Proxy, the call can come from a chosen country, for APIs that answer differently by location.
- Same tool everywhere: the exact same input works from n8n, Make, Zapier, Python or an AI agent. When the list grows to thousands of rows, you can export it and run it as one batch instead of one run per row.
- You only pay for answers: a call that gets no HTTP response (unknown domain, timeout) is not billed as a response.
Tips from testing
- Start from the JSON of the Actor's Input tab on Apify (switch it to JSON view), make it work in Clay with fixed values, then replace them with columns.
- A Clay error about parsing JSON almost always means a quote problem around an inserted value.
- Set a run condition on the column (only when Domain is not empty), so empty rows do not start a run.
Going further
- The Python script, a Clay guide and an n8n template are in this repository: dataxplore19/http-request-api-python.
- The Actor page has the full list of options (redirects, response size, webhooks, proxy): HTTP Request on Apify.
Disclosure: I built the HTTP Request Actor. Links to apify.com in this post are referral links: if you create an Apify account through them, I may earn a commission at no cost to you.