Reference
Webhooks

Webhooks

SuperScraper delivers outbound webhooks for crawl and async batch completion (this page), for async parse jobs (parse.completed / parse.failed, see Parse) and for monitors (monitor.changed, signed with a per-monitor secret, see Monitors). It receives one inbound webhook (Stripe billing events).

Crawl completion (signed)

Pass webhook (or the legacy alias webhookUrl) to POST /v1/crawl. When the job finishes, SuperScraper POSTs a signed envelope to your URL, with retries.

POST <your webhook URL>
Content-Type: application/json
X-SuperScraper-Event: crawl.completed
X-SuperScraper-Timestamp: 1751500000
X-SuperScraper-Signature: sha256=<hex hmac>
 
{
  "event": "crawl.completed",
  "timestamp": 1751500000,
  "data": {
    "jobId": "01hwz3p4q8k2nmx7vyd6cbse1f",
    "status": "completed",
    "pagesScraped": 24,
    "resultUrl": "https://api.superscraper.dev/v1/crawl/01hwz3p4q8k2nmx7vyd6cbse1f/results",
    "resultStorage": "database",
    "resultsStored": 24,
    "resultsTruncated": false,
    "totalResults": 24,
    "sampleTruncated": false,
    "results": [ { "url": "https://www.northside-roasters.example/", "ok": true } ]
  }
}

results is a bounded sample (25 entries by default) of { url, ok, error? }, never the full crawl. Read the pages from resultUrl (GET /v1/crawl/:id/results). On failure, the event is crawl.failed and data.status is "failed", with the reason in note when there is one.

Verifying the signature

X-SuperScraper-Signature is sha256=<hex> where <hex> is HMAC-SHA256("{timestamp}.{rawBody}", WEBHOOK_SIGNING_SECRET), computed over the raw request body (not the parsed JSON) and the X-SuperScraper-Timestamp value:

const crypto = require('crypto');
 
function verify(rawBody, timestampHeader, signatureHeader, secret) {
  const expected = 'sha256=' + crypto
    .createHmac('sha256', secret)
    .update(`${timestampHeader}.${rawBody}`)
    .digest('hex');
  return expected === signatureHeader;
}
⚠️

Differences / limits. Signing only happens when the server has WEBHOOK_SIGNING_SECRET configured. If it isn't set, the webhook is still delivered but unsigned (no X-SuperScraper-Signature header). Always check for the header before trusting a payload as authentic. Delivery makes up to 3 attempts (the first try plus 2 retries) with exponential backoff (any non-2xx or network error is retryable); the target URL is passed through the same SSRF guard as scrape requests, so private/loopback/metadata targets are rejected.

Respond with any 2xx status to acknowledge delivery.

Batch webhooks

POST /v1/batch with async: true (or more than 100 URLs) supports the same signed-webhook mechanism as crawl, with events batch.completed / batch.failed.

Inbound: Stripe billing events

POST /webhooks/stripe receives Stripe's own webhook events (checkout completion, subscription renewal). Here Stripe is the caller. It verifies the stripe-signature header against STRIPE_WEBHOOK_SECRET via the Stripe SDK's constructEvent before processing; an invalid signature is rejected. API consumers never call this endpoint. It is listed so this page covers every webhook in the API.

Summary

WebhookDirectionSigned?RetriesConfigured via
Crawl / batch completionOutbound (us → you)Yes, HMAC-SHA256 (if WEBHOOK_SIGNING_SECRET set)Up to 3 attempts, exponential backoffwebhook field on /v1/crawl or async /v1/batch
Stripe billing eventsInbound (Stripe → us)Yes, Stripe signatureStripe's own retry policyConfigured server-side, not by API consumers