Prioritize Recently Funded Companies with the Clay CLI
Prioritize Recently Funded Companies with the Clay CLI
Qualify outbound targets by real, recent funding amount — a budget-availability signal — using the clay CLI to run Clay's Company Latest Funding function.
What you will build
A CLI workflow that runs the funding routine and buckets results into qualified/unknown, never treating missing data as a disqualifying fact.
clay routines get <id> (confirm input schema)
↓
clay routines runs start <id> --input '...' (submit domains)
↓
clay routines runs get <run-id> --wait 60 (poll until complete)
↓
parse "0" or missing as unknown, not disqualified
AI Prompt
Using the clay CLI, qualify companies by recent funding amount using Clay's "Company Latest Funding" 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 Domain". - The result key is "Latest Funding" -- a STRING of digits. Parse to int. - IMPORTANT DATA CAVEAT (confirmed live): some companies with real, well-known funding history can still return "0" from this function -- "0" means NO DATA FROM THIS FUNCTION, not "never received funding". Never route a "0" or missing value into a disqualified bucket -- route it to "unknown" instead. - 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 Latest Funding") | .id') clay routines get "$ROUTINE_ID"
2. Run it
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"f1","inputs":{"Company Domain":"anthropic.com"}},{"id":"f2","inputs":{"Company Domain":"clay.com"}}]}'
clay routines runs get <run-id> --wait 60
3. Bucket results locally
clay routines runs get <run-id> --wait 60 | jq '[.data[] |
{id, latest_funding_usd: (.result["Latest Funding"] | tonumber),
bucket: (if (.result["Latest Funding"] | tonumber) > 0 then "qualified_pending_threshold" else "unknown" end)}]'
4. Verify the result
This example was tested live against 2 real domains.
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"f1","inputs":{"Company Domain":"anthropic.com"}},{"id":"f2","inputs":{"Company Domain":"clay.com"}}]}'
{ "routineRunId": "run_0tjzne66YTPzNwEAiTZ", "mode": "inline", "status": "in_progress" }
clay routines runs get run_0tjzne66YTPzNwEAiTZ --wait 60
Real confirmed result:
{
"status": "complete",
"data": [
{"id": "f2", "status": "complete", "result": {"Latest Funding": "0"}},
{"id": "f1", "status": "complete", "result": {"Latest Funding": "3500000000"}}
]
}
This confirms the exact scenario the caveat describes: anthropic.com returned a real $3.5B figure, while clay.com — a company with well-documented real funding — returned "0" from this specific function. Both results are identical to the same test run via the REST API in an earlier session, confirming this is a stable, real data-coverage limitation, not a one-off glitch.
How it works
Company Latest Funding returns the most recent funding-round amount Clay's data provider has on file. Because that provider's coverage is incomplete, a "0" result is common even for real, well-funded companies — bucketing it as unknown rather than disqualified keeps the qualification logic honest about what the routine actually knows.
Common issues
A company known to have raised significant funding shows up as unknown
Not a bug: this specific function's data coverage is incomplete. If exact funding history matters, cross-reference against a dedicated funding database rather than relying solely on this Clay function.
Comparing "3500000000" >= 100000000 in jq raises a type error
Cause: the routine returns funding as a string.
Fix: use jq's tonumber (or a language-native int parse) before comparing, and treat parse failures the same as "0" — route to unknown.
Next steps
- Cross-check with exact revenue — see the Clay company-exact-revenue CLI example
- Combine with a firmographic score — see the Clay firmographic lead-scoring CLI example
- Detect hiring-momentum signals too — see the Clay hiring-signals outbound 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_0tjqm9uuyaNc5cGDzpf --input '{\"items\":[{\"id\":\"f1\",\"inputs\":{\"Company Domain\":\"anthropic.com\"}},{\"id\":\"f2\",\"inputs\":{\"Company Domain\":\"clay.com\"}}]}' && clay routines runs get run_0tjzne66YTPzNwEAiTZ --wait 60"
expected_result: "anthropic.com Latest Funding=3500000000, clay.com Latest Funding=\"0\" (real funding history, but 0 from this function)"