Skip to main content
Start a Clay search from a source type and a set of structured filter fields. Discover the available fields with clay search fields. The command returns a search id — page through results with clay search next.
clay search create --source-type <type> --filters '<json>'

Flags

FlagDescription
--source-type <type>What to search for. One of people or companies.
--filters <json>JSON object whose keys are filter field names for the given source type. Run clay search fields to list valid fields and values.

Output

{
  "searchId": "search_abc123"
}
FieldTypeDescription
searchIdstringPass to clay search next to page through results.

Errors

CodeExitNotes
validation_error2--filters is not a JSON object, a filter field or value is invalid, or the workspace’s usage quota would be exceeded.
auth_forbidden3The API key lacks access, or the public-API beta is not enabled for the workspace.
not_found6Workspace not found.

Examples

clay search create --source-type people --filters '{"job_title_keywords":["growth engineer"],"location_cities_include":["San Francisco"]}'
clay search fields --source-type companies | jq '.fields[].name'
clay search create --source-type companies --filters '{"industries":["Software Development"]}' | jq -r '.searchId'