Find Companies Actively Hiring for a Role with the Clay CLI
Find Companies Actively Hiring for a Role with the Clay CLI
Source companies currently hiring for a specific role using clay search query-mode — a cross-entity capability that lets a companies query filter on the company's own open job postings.
What you will build
A CLI workflow using the advanced-search (query-mode) grammar to filter companies on a nested job-postings condition.
clay search query-mode reference (confirm the query grammar)
↓
clay search query-mode create --query '<query>' (create, returns searchId)
↓
clay search query-mode run <searchId> --limit N (page while hasMore)
AI Prompt
Using the clay CLI, find companies currently hiring for a specific role via
query-mode search.
Requirements:
- Run `clay search query-mode reference` first and confirm the real query
grammar before writing any query string.
- The result entity must be "companies" -- "jobs" is not a valid standalone
result entity in query-mode. Express hiring criteria as a nested aggregate
instead: jobs.exists(job_still_open = true and job_title is_similar_to
("<role>")) inside a companies query.
- Combine with a real companies-side filter, e.g. estimated_employee_count.
- Create the search with `clay search query-mode create --query '<query>'`,
then page with `clay search query-mode run <searchId> --limit N` while
hasMore is true. Note the CLI's exhaustionReason field
(query_limit vs no_more_results) when hasMore becomes false.
- Run the verification step below before finishing.
Prerequisites
- The
clayCLI on PATH, authenticated jq
1. Confirm the query grammar
clay search query-mode reference
This returns the full advanced-search field reference and grammar, including confirmation that hiring criteria are expressed via jobs.exists(predicate) nested inside a companies query — not as a standalone jobs result entity.
2. Create the search
clay search query-mode create --query 'select from companies where jobs.exists(job_still_open = true and job_title is_similar_to ("software engineer")) and estimated_employee_count > 200'
Expected output:
{ "searchId": "search_XXXXXXXXXXXXXXXXXXXX", "sourceType": "companies" }
3. Page through results
clay search query-mode run <searchId> --limit 25
4. Verify the result
This example was tested live.
clay search query-mode create --query 'select from companies where jobs.exists(job_still_open = true and job_title is_similar_to ("software engineer")) and estimated_employee_count > 200'
{ "searchId": "search_0tjzn9rA26ihVt7KPWu", "sourceType": "companies" }
clay search query-mode run search_0tjzn9rA26ihVt7KPWu --limit 25
Real companies returned: Google, Amazon, LinkedIn, Microsoft, Deloitte, IBM, Tata Consultancy Services, Apple, Accenture, Tesla, Meta, Netflix, Wipro, EY, Oracle (15 of 25 shown) — the identical set of companies observed during earlier REST testing of the same query, confirming the CLI and REST surfaces return consistent results.
How it works
Clay's query-mode grammar supports cross-entity aggregates: a companies query can filter on jobs.exists(...)/jobs.count(...) even though jobs is never itself a valid top-level result entity. clay search query-mode run additionally reports an exhaustionReason (query_limit or no_more_results) once hasMore goes false — a CLI-only convenience not present in the raw REST response.
Common issues
validation_error (exit 2) attempting select from jobs where ...
Cause: jobs cannot be the result entity in a query-mode search — only people and companies select queries are supported.
Fix: nest job criteria via jobs.exists(...)/jobs.any(...) inside a companies (or people) query.
Different roles return overlapping companies
Not a bug: large, multi-department employers legitimately appear across many role searches (e.g. Amazon shows up for both "software engineer" and other roles). This reflects real hiring breadth, not a broken filter.
Next steps
- Filter by growth momentum instead of headcount — see the Clay growth-momentum TAM CLI example
- Enrich the resulting companies — see the Clay contact-waterfall-enrichment CLI example
- Score the resulting companies — see the Clay firmographic lead-scoring CLI example
Verification
verification: status: verified tested_at: "2026-08-18" cli_version: "0.7.0" auth_method: "clay login --device" command: "clay search query-mode create --query 'select from companies where jobs.exists(job_still_open = true and job_title is_similar_to (\"software engineer\")) and estimated_employee_count > 200' && clay search query-mode run search_0tjzn9rA26ihVt7KPWu --limit 25" expected_result: "sourceType=companies, real companies returned incl. Google, Amazon, LinkedIn, Microsoft, Deloitte, IBM, Tesla"