Agents: the full documentation index is at /llms.txt.This job is what a scheduled task or a queue worker would run: it is safe to retry, honors rate limits, and pages through results. It uses 1 shortlist credit, for the search, and none on a retry. It needs Node.js 20 or later and no packages.
job.mjs
POLL_SECONDS=1 is for trying it out; leave it unset in production to poll every 15 seconds.
What makes it safe
- Retries never charge twice. The launch carries an
Idempotency-Key, so a rerun after a crash or timeout returns the same search. Choose a key that names the work, such as the requisition id. See errors. - It honors limits. A
429waits forRetry-After. See rate limits. - It stops on any finished status, not only
complete. See async jobs. - It pages until an empty page. See pagination.
- The key stays out of logs: errors print the code, message and
request_id, never the request.