Skip to main content
Return the next page of records for an existing search, advancing the iterator. Create the search first with clay search create.
clay search next <searchId> [--limit <n>]
A search is a forward-only iterator: each call returns the next records and advances it. Repeat clay search next <searchId> while hasMore is true. There is no cursor — the iterator position is server-side and cannot be replayed.

Arguments

ArgumentDescription
searchIdSearch id returned by clay search create, e.g. search_abc123. Required.

Flags

FlagDescription
--limit <n>Max records to return. 1-500. Defaults to 20.

Output

{
  "data": [{ "<field>": "..." }],
  "hasMore": true
}
FieldTypeDescription
dataobject[]The next page of records. Each record’s fields depend on the source type.
hasMorebooleanWhether more records remain. Call again while true.

Errors

CodeExitNotes
validation_error2--limit is not an integer in 1-500, or exceeds your plan’s per-request, per-search, or period limit.
not_found6No search with that id, or it has expired.
auth_forbidden3The API key lacks access, or the public-API beta is not enabled for the workspace.

Examples

clay search next search_abc123
clay search next search_abc123 --limit 50 | jq '.data | length'
clay search create --source-type people --filters '{"job_title_keywords":["growth engineer"]}' | jq -r '.searchId' | xargs clay search next