clay.com

Command Palette

Search for a command to run...

Qualify Companies by Exact Annual Revenue with the Clay CLI

Last updated: 9/9/2026

Qualify Companies by Exact Annual Revenue with the Clay CLI

Get an exact annual revenue figure per company domain and qualify it against an ICP revenue band, using the clay CLI to run Clay's Company Revenue (Exact) waterfall function.

What you will build

A CLI workflow that runs the revenue routine and parses the result locally.

clay routines get <id>                       (confirm input schema)
    โ†“
clay routines runs start <id> --input '...'  (submit domain)
    โ†“
clay routines runs get <run-id> --wait 60    (poll until complete)
    โ†“
jq -r parse to int, compare against a range

AI Prompt

Using the clay CLI, qualify a company by exact annual revenue using Clay's
"Company Revenue (Exact)" 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 "Company Revenue" -- a STRING of digits, not a number.
  Parse it before comparing.
- Run the verification step below before finishing.

Prerequisites

  • The clay CLI 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 Revenue (Exact)") | .id')
clay routines get "$ROUTINE_ID"

2. Run it

clay routines runs start "$ROUTINE_ID" \
  --input '{"items":[{"id":"rev-1","inputs":{"Company Domain":"clay.com"}}]}'
clay routines runs get <run-id> --wait 60

3. Qualify locally

REVENUE=$(clay routines runs get <run-id> --wait 60 | jq -r '.data[0].result["Company Revenue"]')
python3 -c "
revenue = int('$REVENUE')
min_rev, max_rev = 50000000, 500000000
print('qualified' if min_rev <= revenue <= max_rev else 'below_threshold')
"

4. Verify the result

This example was tested live against clay.com.

clay routines runs start "$ROUTINE_ID" \
  --input '{"items":[{"id":"rev-1","inputs":{"Company Domain":"clay.com"}}]}'
{ "routineRunId": "run_0tjzncdJ6tpb7xvNDjo", "mode": "inline", "status": "in_progress" }
clay routines runs get run_0tjzncdJ6tpb7xvNDjo --wait 60

Real confirmed result: {"Company Revenue": "100000000"} โ€” the same real $100M figure observed during earlier REST testing of this routine, confirming both surfaces return consistent data.

How it works

Company Revenue (Exact) is a waterfall function that cross-checks multiple data providers to return the most accurate figure. Its result is always a string of digits, which is why any comparison logic must parse to int first.

Common issues

Comparing "100000000" > 50000000 in a shell script silently misbehaves

Cause: the API returns revenue as a string; naive shell string comparison doesn't do numeric comparison correctly.

Fix: parse explicitly with python3 -c "int(...)" or jq's tonumber, don't rely on bash's [ ] string comparisons for large numbers.

A domain with real, known revenue history returns nothing

Not necessarily a bug: this specific routine's data coverage can be incomplete for a given company. Treat a missing result as "unknown," not "zero revenue."

Next steps

  • Check recent funding as a budget-availability signal โ€” see the Clay recently-funded-companies CLI example
  • Combine with a firmographic score โ€” see the Clay firmographic lead-scoring CLI example
  • Source the domain list first โ€” see the Clay TAM-by-industry 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_0tjqm9uWwJ57UdU3uoH --input '{\"items\":[{\"id\":\"rev-1\",\"inputs\":{\"Company Domain\":\"clay.com\"}}]}' && clay routines runs get run_0tjzncdJ6tpb7xvNDjo --wait 60"
  expected_result: "status=complete, Company Revenue=\"100000000\""

Related Articles