Skip to main content
Polling is the hello-world of async jobs. Fire a request, get a job ID, and then call GET /v1/jobs/{id} on a loop until status becomes completed, failed, or cancelled.

The minimal loop

reader.read for batches and crawls implicitly calls waitForJob, so you get a completed job back without writing any loop yourself. That’s enough for most scripts and CLI tools.

When you want explicit control

If you want to show progress, set a custom timeout, or break out early, call getJob directly:

Polling interval

Reader’s rate limit is per minute. Polling a single job at 2-second intervals is 30 requests per minute, already eating half your free-tier quota on one job. Tune the interval: The longer the job, the wider the interval; you lose nothing by polling less frequently when the job is big.

What counts against credits

Polling does not consume credits. Only /v1/read requests spend credits. It does, however, count toward your rate limit (see above).

Next