Skip to content
Docs
Async jobs

Create a schedule

Store a job template and cadence. Each due slot becomes a normal async job (same metering, retries, webhook and optional S3/GCS delivery).

POST/v1/async/schedules
FreeAsync jobs, destinations, schedules and the callback secret are not changed from the docs; call this with your own key.

Request

POSThttps://api.scrapercompany.com/v1/async/schedules

Authenticate with your API key in the x-api-key header (see Authentication).

Body

JSON object. Unknown fields are rejected with 422.

  • itemsarray of object | nullmin items 1, max items 500

    One to 500 operations. Each keeps its own method, path, body, query and label. Omit when submitting a single operation at the top level.

    Show 7 child fields
    • items[].operationstring | nullmax length 200

      Operation id (google_calendar) or METHOD /path (POST /v1/calendar). Get the list from GET /v1/async/operations.

    • items[].methodstring | nullmax length 10

      HTTP method for a path item. Defaults to POST.

    • items[].pathstring | nullmax length 200

      Route path for a path item, for example /v1/calendar.

    • items[].urlstring | nullmax length 2048

      Shorthand for the generic scrape endpoint: this URL is fetched as a /v1/scrape job. Other item fields in body are passed through.

    • items[].bodyobject

      The operation's JSON request body, exactly as the synchronous endpoint takes it.

    • items[].queryobject

      Query-string parameters, for a GET operation.

    • items[].labelstring | nullmax length 200

      Optional customer label returned with this item.

  • operationstring | nullmax length 200

    Single-job shorthand: operation id or METHOD /path.

  • methodstring | nullmax length 10

    Single-job shorthand: HTTP method for path.

  • pathstring | nullmax length 200

    Single-job shorthand: route path such as /v1/calendar.

  • urlstring | nullmax length 2048

    Single-job shorthand for the generic scrape endpoint.

  • bodyobject

    Single-job shorthand: the operation's JSON body.

  • queryobject

    Single-job shorthand: query-string parameters.

  • labelstring | nullmax length 200

    Single-job shorthand: label returned with the item.

  • priorityintegerdefault 5min 0, max 9

    Queue priority from 0 (lowest) to 9 (highest). FIFO is preserved among jobs with the same priority.

  • callback_urlstring | nullmax length 2048

    Optional public HTTPS endpoint. A signed async_job.completed event is POSTed after the job reaches a terminal state. Verify x-scrapercompany-signature (HMAC-SHA256 of x-scrapercompany-timestamp + . + the raw body) with the enabled HTTPS webhook secret for this URL, or with GET /v1/async/callback-secret when the URL is not an enabled registered webhook. For 24 hours after rotating the account secret the header lists both HMACs, comma-separated. Dedupe on x-scrapercompany-delivery.

  • callbackobject | null

    ScraperAPI-style webhook callback object. An alternative to callback_url.

    Show 2 child fields
    • callback.typestringdefault webhook

      Callback transport. webhook is the only supported value.

    • callback.urlstringrequiredmax length 2048

      Public HTTPS endpoint that receives the signed completion event.

  • destination_idstring | nullmax length 80

    Saved S3/GCS destination (POST /v1/async/destinations) to upload the finished job to. Delivery is independent of the scrape outcome.

  • metaobject

    Caller metadata echoed unchanged in status responses and webhooks. Maximum 8 KB.

  • max_creditsinteger | nullmin 0

    Stop starting items once this many credits are spent or reserved. An item starts only when credits already spent, plus the listed price of items in flight, plus this item's listed price, fit under the limit. The listed price is the synchronous route cost; the charge is never higher. Items that do not fit are cancelled.

  • include_resultsbooleandefault false

    When true, the completion webhook includes item response bodies if they fit in 256 KB. Otherwise the webhook is a summary plus results_url. Polling follows its own include_results query parameter.

  • namestringrequiredmin length 1, max length 80

    Display name, unique per account.

  • cadencestringdefault daily

    How often to run. hourly is the fastest; manual creates a schedule that only POST .../run starts. Missed slots are skipped, not replayed.

    One ofhourlyevery_6htwice_dailydailyweeklymanual

  • run_hourintegerdefault 0min 0, max 23

    Hour of the day in timezone for daily/weekly; ignored by interval cadences.

  • weekdayintegerdefault 0min 0, max 6

    Day for weekly: 0 = Monday, 6 = Sunday.

  • timezonestringdefault UTCmax length 64

    IANA timezone for run_hour/weekday (America/New_York). Interval cadences advance from the previous run in UTC.

  • enabledbooleandefault true

    Pause a schedule (false) without deleting it.

Example request

curl -X POST "https://api.scrapercompany.com/v1/async/schedules" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cadence": "daily",
    "destination_id": "asyncdst_0123456789abcdef0123456789abcdef",
    "items": [
      {
        "body": {
          "currency": "USD",
          "days": 90,
          "market": "US",
          "token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ"
        },
        "operation": "google_calendar"
      }
    ],
    "meta": {
      "batch": "nightly"
    },
    "name": "nightly-comp-set",
    "run_hour": 6,
    "timezone": "America/New_York"
  }'

Response

201 — The schedule and its next/last run state.

201 response
{
  "id": "asyncsched_0123456789abcdef0123456789abcdef",
  "name": "nightly-comp-set",
  "enabled": true,
  "cadence": "daily",
  "run_hour": 6,
  "weekday": 0,
  "timezone": "America/New_York",
  "destination_id": "asyncdst_0123456789abcdef0123456789abcdef",
  "next_run_at": "2026-10-23T10:00:00Z",
  "last_run_at": "2026-10-22T10:00:00Z",
  "last_job_id": "asyncjob_0123456789abcdef0123456789abcdef",
  "created_at": "2026-10-20T09:00:00Z",
  "updated_at": "2026-10-22T10:00:01Z",
  "items": [
    {
      "operation": "google_calendar",
      "body": {
        "token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ",
        "days": 90,
        "currency": "USD",
        "market": "US"
      }
    }
  ],
  "priority": 5,
  "max_credits": 100,
  "meta": {
    "batch": "nightly"
  },
  "include_results": false,
  "items_total": 1
}

Errors

Errors return a JSON body with a detail field. Failed requests are not charged. See Errors for the full list and retry advice.

StatusMeaningRetry?
401Unauthorized

Missing or invalid API key.

{"detail":"missing or invalid API key"}
No, fix the request
422Unprocessable Content

Request validation failed. detail is a list of problems for schema errors, or a string for semantic checks performed by the endpoint.

{"detail":[{"loc":["body","name"],"msg":"Field required","type":"missing"}]}
No, fix the request
429Too Many Requests

Too many requests: the key's requests-per-minute limit was exceeded, or (in enforce credits mode) the plan's concurrent-request limit. No rate-limit or Retry-After headers are sent; back off and retry.

{"detail":"rate limit 60/min exceeded"}
Yes, with backoff
503Service Unavailable

Temporarily unavailable: a dependency of this endpoint is down, or the upstream source changed its contract. Retry later.

{"detail":"database unavailable: OperationalError"}
Yes, with backoff

Try it

Async jobs, destinations, schedules and the callback secret are not changed from the docs; call this with your own key.

  1. Export your key: export SCRAPERCOMPANY_API_KEY=sk_... (no key yet? start a free trial).
  2. Copy the cURL example above and run it in a terminal.

Questions about this page?

Send the page link and your question, and the team will answer.

Email support