Skip to content

Documentation · Jobs and results

Jobs and results

Every search runs as a background job. Here is how to follow it, get its images back and retry safely.

Jobs and statuses

A search is a background job. Check GET /v1/jobs/JOB_ID, wait for it, or use a webhook; see Getting results. A job is always in one of these states:

StatusMeaning
queuedAccepted and waiting for the worker.
runningPages are being fetched; results appear as they are found.
completeEvery query found what it asked for.
partialFinished with fewer images than requested. Check each query’s reason.
cancelledStopped before it finished. Results found so far are kept.

Each query in a job reports a reason when it stops:

ReasonWhat happened
requested_count_reachedAll requested images were found.
source_exhausted_or_no_new_matchesThe source ran out of new matching images.
daily_page_quotaStopped at the project’s daily page limit. It resets at 00:00 UTC.
provider_failedThe image source kept failing for this query.
key_revoked_or_expiredThe API key was revoked or expired during the job.
user_cancelledThe job was cancelled.

Getting results

Each project chooses how its searches return results, in the project’s Delivery tab in the workspace. You can change it at any time.

ModeWhat happensBest for
Check back (default)The search returns 202 with a job ID straight away. Check GET /v1/jobs/JOB_ID until it finishes. Add ?wait=10 to each check and it waits up to 10 seconds for the job, so you need far fewer requests.Large searches and batch jobs.
Wait for resultsThe search call stays open until the job finishes, up to the project’s limit (3, 5 or 10 seconds), then returns 200 with status, job and the first page of images. If it’s still running, you get the usual 202 and can wait on the job.Small searches someone is waiting on.
WebhookThe search returns 202 straight away, and Pluko sends a signed job.finished event to your URL when the job ends. See Webhooks.Backends that shouldn’t wait or check back.

A single request can override its project: send Prefer: wait=5 to wait up to 5 seconds (10 at most), or Prefer: respond-async to return straight away. Responses that waited include a Preference-Applied header. Waits are always short, so a large search never holds a connection open; it carries on as a normal job.

Reading results

Read GET /v1/jobs/JOB_ID/results?limit=100&after=0. A page holds up to 100 images. Pass next_cursor as after to read the next page.

When next_cursor is null you have reached the end of the results available right now. If the job is still running, wait and continue from poll_after to fetch only new results without reading earlier rows again.

Retries and idempotency

Add a unique Idempotency-Key header when you create a job. Retrying with the same key and identical input returns the original job instead of starting a second one. Reusing the key with different input returns 409 IDEMPOTENCY_CONFLICT.

Was this page helpful?

Tell us what’s missing. We read every note.