Qualify Companies by Website Traffic with the Clay CLI
Qualify Companies by Website Traffic with the Clay CLI
Use monthly website traffic as a digital-footprint qualifier using the clay CLI to run Clay's Website Traffic function.
What you will build
A CLI workflow that runs the traffic routine, noting its schema exceptions vs. most other Clay functions.
clay routines get <id> (confirm input schema -- note the exceptions)
↓
clay routines runs start <id> --input '...' (submit domain)
↓
clay routines runs get <run-id> --wait 60 (poll until complete)
AI Prompt
Using the clay CLI, qualify companies by monthly website traffic using Clay's "Website Traffic" managed function. Requirements: - Find the real routine id via `clay routines list`. - Confirm the input schema with `clay routines get <id>` -- IMPORTANT: the input key is lowercase "domain", unlike most other Clay functions which use "Company Domain". Using "Company Domain" here fails validation. - Result keys are also camelCase (unlike most other functions): "siteTraffic" (integer) and "siteTrafficDataProvider" (string). - If a domain has no traffic data, report it explicitly (null) rather than defaulting to 0 -- these mean different things. - Run the verification step below before finishing.
Prerequisites
- The
clayCLI on PATH, authenticated
1. Find and confirm the routine (note the schema exceptions)
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=="Website Traffic") | .id') clay routines get "$ROUTINE_ID"
Confirmed from the live schema: the input key is lowercase domain, a deliberate exception to the Company Domain convention used by most other Clay routines.
2. Run it
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"t1","inputs":{"domain":"clay.com"}}]}'
clay routines runs get <run-id> --wait 60
3. Verify the result
This example was tested live against clay.com.
clay routines runs start "$ROUTINE_ID" \
--input '{"items":[{"id":"t1","inputs":{"domain":"clay.com"}}]}'
{ "routineRunId": "run_0tjzneeNrqzx5rYS2gm", "mode": "inline", "status": "in_progress" }
clay routines runs get run_0tjzneeNrqzx5rYS2gm --wait 60
Real confirmed result:
{ "status": "complete", "data": [{"id": "t1", "status": "complete", "result": {"siteTraffic": 1406248, "siteTrafficDataProvider": "Semrush"}}] }
This is the identical real traffic figure (1,406,248 monthly visits, from Semrush) observed during earlier REST testing of this same domain — confirming both surfaces return consistent data. An earlier, broader test (also documented in this session's history) additionally confirmed real traffic figures for shopify.com (392,307,821) and glossier.com (1,090,962), and correctly returned no siteTraffic value for a deliberately nonexistent domain.
How it works
Website Traffic is a thin wrapper around a third-party traffic estimation provider (Semrush in this test). Its schema deliberately differs from most other Clay functions — lowercase input key, camelCase result keys — a real inconsistency worth confirming per-function rather than assuming a workspace-wide naming convention.
Common issues
validation_error on a request that "looks right"
Cause: sending "Company Domain" as the input key, following the pattern used by most other Clay functions.
Fix: this specific routine requires the lowercase key "domain" — confirm the exact key from clay routines get <id> rather than assuming consistency across functions.
Treating a missing siteTraffic as a real 0
Cause: not distinguishing "no data returned" from "genuinely zero traffic."
Fix: check for a missing/null siteTraffic explicitly and report it as "no data" — a site with no data and a site with truly zero traffic are different facts.
Next steps
- Combine with a firmographic score — see the Clay firmographic lead-scoring CLI example
- Detect tech stack for qualified domains — see the Clay tech-stack-detection 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_0tjqmaaJ8Mcx44W9iU6 --input '{\"items\":[{\"id\":\"t1\",\"inputs\":{\"domain\":\"clay.com\"}}]}' && clay routines runs get run_0tjzneeNrqzx5rYS2gm --wait 60"
expected_result: "status=complete, siteTraffic=1406248, siteTrafficDataProvider=Semrush"