Queues & schedules

Group many extractions into a named queue, then run it on demand or on a timer. Queues and schedules are managed in the dashboard console and over the /v1/data/my endpoints.

Queues

A queue is a named, ordered list of scrape items. Each item names a platform, an action, and its parameters. Add up to 1000 items to a queue, and keep up to 100 queues per account.

OperationDescription
POST /v1/data/my/queuesCreate a named queue. Also list, get, patch, and delete under the same path.
POST /v1/data/my/queues/{id}/itemsAdd items to a queue, up to 1000 items.
POST /v1/data/my/queues/{id}/runRun every item in the queue now.
GET /v1/data/my/queues/{id}/runsRun history for the queue, with the credit rollup per run.

Running a queue turns every item into a job. Each item is billed as its own flat-price run, and the queue run reports a rollup of all the job credits it consumed.

queue.sh
# Add items to a queue (up to 1000 per queue)
curl -s -X POST https://api.capzy.ai/v1/data/my/queues/QUEUE_ID/items \
  -H 'X-API-Key: capzy_data_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
      { "platform": "amazon", "action": "search", "params": { "query": "usb c cable" } },
      { "platform": "amazon", "action": "search", "params": { "query": "hdmi 2.1 cable" } }
    ]
  }'

# Run the whole queue now
curl -s -X POST https://api.capzy.ai/v1/data/my/queues/QUEUE_ID/run \
  -H 'X-API-Key: capzy_data_YOUR_KEY'
One item, one job
Every queue item is a single billed job. A queue run's cost is simply the sum of its items. Failed items are free, so a partially failing run only bills the items that succeeded.

Schedules

A schedule fires a queue or a saved task automatically. Choose one of two modes:

  • interval run every N seconds.
  • cron run on a cron expression, evaluated in the timezone you set.
OperationDescription
POST /v1/data/my/schedulesCreate a schedule bound to a queue or task. Also list, patch, and delete.
POST /v1/data/my/schedules/{id}/runFire the schedule once, immediately, without waiting for its next trigger.
schedule.json
# Interval: run a queue every hour
{ "mode": "interval", "seconds": 3600, "queueId": "QUEUE_ID" }

# Cron: run at 6am New York time each weekday
{ "mode": "cron", "cron": "0 6 * * 1-5", "timezone": "America/New_York", "queueId": "QUEUE_ID" }
Auto-pause after repeated failures
A schedule that fails 5 times in a row is paused automatically so it stops burning attempts. Fix the underlying issue, then re-enable it in the console. You can keep up to 50 schedules per account.

Managed in the console

Queues and schedules are session-authenticated features of the dashboard. Build and monitor them under the Data API section, or drive them programmatically over the /v1/data/my/queues and /v1/data/my/schedules endpoints. Run history and per-run credit rollups are visible in both places.

Next