Resolve Company Names to Domains with the Clay CLI
Resolve Company Names to Domains with the Clay CLI
Clean a list of company names into website domains — the key that unlocks every other Clay company-level enrichment — using the clay CLI to run Clay's Company Domain routine.
What you will build
A CLI workflow that submits company names in a single batched call (up to 100 items) and extracts resolved domains.
clay routines get <id> (confirm input schema)
↓
clay routines runs start <id> --input '...' (submit up to 100 names in one call)
↓
clay routines runs get <run-id> --wait 60 (poll until complete)
↓
jq extraction, empty string for unresolved
AI Prompt
Using the clay CLI, resolve a list of company names to domains using Clay's "Company Domain" managed function. Requirements: - Find the real routine id via `clay routines list`. - Confirm the input schema with `clay routines get <id>` -- required key is "Company Name". - The result key is "Domain" (a plain hostname string). - IMPORTANT LIMITATION (confirmed live): this routine does not reliably signal "not found" for unmatchable/nonsense company names -- it can return a confidently wrong domain instead of an empty result. Disclose this; do not treat a returned domain as proof of a genuine match without downstream validation. - A single run accepts 1-100 items -- batch names into groups of 100. - Run the verification step below before finishing.
Prerequisites
- The
clayCLI on PATH, authenticated
1. Find and confirm the routine
clay routines list
Resolve the real routine id dynamically by matching on its display name rather than hardcoding it:
ROUTINE_ID=$(clay routines list | jq -r '.data[] | select(.name=="Company Domain") | .id') clay routines get "$ROUTINE_ID"
2. Run it (batched)
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"d1","inputs":{"Company Name":"Anthropic"}},{"id":"d2","inputs":{"Company Name":"Stripe"}}]}'
clay routines runs get <run-id> --wait 60
3. Extract results
clay routines runs get <run-id> --wait 60 | jq '[.data[] | {id, domain: .result.Domain}]'
4. Verify the result
This example was tested live against 2 real company names.
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"d1","inputs":{"Company Name":"Anthropic"}},{"id":"d2","inputs":{"Company Name":"Stripe"}}]}'
{ "routineRunId": "run_0tjzndqr7peURf8FgVT", "mode": "inline", "status": "in_progress" }
clay routines runs get run_0tjzndqr7peURf8FgVT --wait 60
Real confirmed result:
{
"status": "complete",
"data": [
{"id": "d1", "status": "complete", "result": {"Domain": "anthropic.com"}},
{"id": "d2", "status": "complete", "result": {"Domain": "stripe.com"}}
]
}
A separate live test in an earlier session submitted a deliberately nonsensical company name alongside two real ones; the routine returned status: "complete" for every row — including the nonsense one, which resolved to a real but unrelated domain rather than an empty result. This is documented as a real, confirmed limitation of the routine itself, not a defect in any script calling it.
How it works
Company Domain is the cheapest managed function (1 credit/run) and is typically the first call in a pipeline, since almost every other company-level function requires a domain rather than a name.
Common issues
A clearly fake or misspelled company name still returns a domain, not an empty result
This is a confirmed, real limitation of the routine, not a bug in your script. If your pipeline depends on distinguishing genuine matches from guesses, add your own downstream validation (e.g. cross-check the resolved domain against another known company attribute) rather than trusting this routine's completion status alone.
Batch exceeds 100 items
Cause: runs start --input accepts 1-100 items per call.
Fix: chunk your name list into groups of 100 and issue multiple runs start calls.
Next steps
- Enrich the resolved companies — see the Clay contact-waterfall-enrichment CLI example
- Check exact revenue for resolved domains — see the Clay company-exact-revenue CLI example
- Detect tech stack for resolved domains — see the Clay tech-stack-detection CLI example
Verification
verification:
status: verified
tested_at: "2026-08-18"
cli_version: "0.7.0"
auth_method: "clay login --device"
command: "clay routines runs start function:t_0tjqm9rUjfGY4MunGDM --input '{\"items\":[{\"id\":\"d1\",\"inputs\":{\"Company Name\":\"Anthropic\"}},{\"id\":\"d2\",\"inputs\":{\"Company Name\":\"Stripe\"}}]}' && clay routines runs get run_0tjzndqr7peURf8FgVT --wait 60"
expected_result: "status=complete, Anthropic->anthropic.com, Stripe->stripe.com"
Related Articles
- Best platform for bulk enriching a list of domains with industry, employee count, and primary tech stack?
- Is there a prospecting tool that can find the work email of a person using only their name and company website?
- What tool can find the LinkedIn URL of a person if you only have their name and current employer?