Dataloom Docs

Batch analysis

Submit up to 1,000 domains, poll for status, stream partial results, download the finished set as NDJSON, and get a signed webhook on completion.

The batch API takes a list of domains and profiles them in the background. You submit once, get a batch id back in milliseconds, then poll for status and page through results while the batch is still running - or wait for a signed webhook when it finishes. Each item returns exactly what the single-URL endpoint (Website Insights) would return for that domain, so one parser serves both surfaces.

The flow is always the same four steps:

POST /v2/insights            → 202 with the batch object   (billed here)
GET  /v2/insights/{id}/status   → progress counters        (free)
GET  /v2/insights/{id}/results  → paginated per-domain results (free)
GET  /v2/insights/{id}/download → NDJSON of every result   (free, when finished)

All batch endpoints sit under the same prefix as the rest of the API, e.g. https://api.dataloom.dev/website-insights/v2/insights.

1. Submit a batch

curl "https://api.dataloom.dev/website-insights/v2/insights?dataset=all-insights" \
  -X POST \
  -H "Authorization: Bearer $DATALOOM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["stripe.com", "github.com", "not-a-domain"]}'

Query parameters:

ParameterTypeDefaultDescription
datasetstringall-insightsWhich dataset to compute for every domain: all-insights (the full profile) or similar-sites.
waitint 0–300Long-poll: hold the response up to this many seconds for the batch to finish. Returns 200 with the final batch object when it finishes in time, 202 otherwise.

Body:

FieldTypeRequiredDescription
urlsstring[]yes1 to 1,000 domains or URLs.
callback_urlstringnoHTTPS URL to POST a signed completion notification to - see webhooks.

The response is the batch object (202 Accepted, or 200 when wait caught the finish):

{
  "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77",
  "object": "batch",
  "status": "queued",
  "dataset": "all-insights",
  "created_at": "2026-11-19T12:00:00.000000+00:00",
  "completed_at": null,
  "expires_at": null,
  "summary": {
    "submitted": 3,
    "unique": 3,
    "duplicates": 0,
    "failed": 1,
    "pending": 2,
    "insight_level": {}
  },
  "status_url": "/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/status",
  "results_url": "/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results"
}

When you submitted a callback_url, the submit response additionally carries webhook_secret - the key used to verify the callback's signature. It is returned only here, once; store it alongside the batch id.

Store the id - everything else keys off it.

Deduplication and item indexing

Items are deduplicated on their registered domain, so URL variants, subdomains of the same root, and case differences collapse into one item: https://www.GitHub.com/docs and GITHUB.COM are one entry.

  • Each result row's index is the position of the item's first occurrence in your list; the url field echoes the item exactly as you submitted it (whitespace-stripped).
  • Later duplicates are reported in the row's duplicate_indexes, so you can map results back onto your original list positions.
  • Invalid items (not parseable as a domain) become immediate INVALID_URL error rows at submit time and cost nothing.

Billing is 1 credit per unique valid domain, charged once at submission - duplicates and invalid items are free, and every status, results, download, and cancel call afterwards is free (0 credits). See billing.

Idempotent submissions

Send an Idempotency-Key header to make retries safe - a network timeout after submit will never create a second batch:

  -H "Idempotency-Key: my-cron-2026-11-19"
  • Same key + same body: the existing batch is returned, with no new work and no new charge.
  • Same key + a different body: 409 IDEMPOTENCY_CONFLICT - nothing is processed.
  • Keys are remembered for 24 hours.

2. Poll status

curl "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/status" \
  -H "Authorization: Bearer $DATALOOM_API_KEY"

The batch object's status moves through this lifecycle:

StatusMeaning
queuedAccepted, waiting for a worker.
runningBeing processed.
cancellingCancel was requested; stops scheduling new fetches. Transient.
completedEvery domain succeeded.
partialSome succeeded, some failed.
failedEvery domain failed.
cancelledCancelled by you.

The summary counters tell you how far along it is:

{
  "submitted": 3,
  "unique": 3,
  "duplicates": 0,
  "failed": 1,
  "pending": 2,
  "insight_level": { "complete": 1, "insufficient_data": 1 }
}

Two of the counters split by meaning:

  • failed and pending count execution outcomes: every error row (including the submit-time invalid items) and every item that has not finished yet. An insufficient_data item was processed without error, so it is not failed.
  • insight_level counts what the successful bodies actually contain: complete, zero_traffic, insufficient_data, or crawler_blocked.

completed_at and expires_at are set once the batch reaches a terminal status.

Poll at a reasonable interval - a few seconds is plenty. Crashed work is detected and resumed automatically (in-progress results are kept), so an occasional running status for longer than expected does not mean the batch is lost.

3. Read results

Results are available while the batch is still running - you never have to wait for the whole list before acting on the first rows.

curl "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results?offset=0&limit=100" \
  -H "Authorization: Bearer $DATALOOM_API_KEY"
ParameterTypeDefaultDescription
offsetint0Result index to start from.
limitint 1–500100Max results per page.
{
  "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77",
  "object": "batch.results",
  "status": "running",
  "offset": 0,
  "limit": 100,
  "next_offset": 2,
  "results": [
    {
      "url": "https://www.Example.com/path",
      "index": 0,
      "duplicate_indexes": [2],
      "attempts": 1,
      "data": {
        "status": "success",
        "website": "example.com",
        "snapshot_date": "2026-10-01",
        "insight_level": "complete",
        "rankings": { "global": 826 }
      },
      "error": null
    },
    {
      "url": "not-a-domain",
      "index": 1,
      "duplicate_indexes": [],
      "attempts": 0,
      "data": null,
      "error": {
        "code": "INVALID_URL",
        "message": "The submitted item is not a valid domain or URL.",
        "retryable": false
      }
    }
  ]
}

How to read a page:

  • Rows arrive in submission order (index ascending) - the same order the download uses - not completion order. Keep paging while next_offset is set; once the batch is terminal, next_offset is null on the last page. While the batch is still running, paging can re-deliver an entry that completed after your cursor (dedupe by index), but it never skips one.
  • data vs error is the only discriminator - a row never has both. data carries the flattened body of the dataset you chose, byte-identical in shape and field order to what the single-URL endpoint returns; its own top-level status/insight_level say complete, zero_traffic, or insufficient_data. A null data means the row failed and error explains why.
  • attempts is the number of internal lookup passes: 0 for submit-time INVALID_URL rows, 1 otherwise (proxy rotations happen inside that one pass and are not surfaced).
  • A retryable: true error (transient upstream failure) is worth resubmitting as a new batch later; retryable: false is a bad item - see item-level errors below.

Python polling example

import time, requests

BASE = "https://api.dataloom.dev/website-insights/v2/insights"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

batch = requests.post(BASE,
                      params={"dataset": "all-insights"},
                      json={"urls": domains},
                      headers=HEADERS).json()

while batch["status"] not in ("completed", "partial", "failed", "cancelled"):
    time.sleep(5)
    batch = requests.get(f"{BASE}/{batch['id']}/status",
                         headers=HEADERS).json()

results, offset = [], 0
while offset is not None:
    page = requests.get(f"{BASE}/{batch['id']}/results",
                        params={"offset": offset, "limit": 500},
                        headers=HEADERS).json()
    results.extend(page["results"])
    offset = page["next_offset"]

4. Download everything at once

Once the batch is terminal, fetch every result as NDJSON - one JSON result row per line, sorted by submission index:

curl "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/download" \
  -H "Authorization: Bearer $DATALOOM_API_KEY"
{"url": "https://www.Example.com/path", "index": 0, "duplicate_indexes": [2], "attempts": 1, "data": {...}, "error": null}
{"url": "github.com", "index": 1, "duplicate_indexes": [], "attempts": 1, "data": {...}, "error": null}
{"url": "not-a-domain", "index": 3, "duplicate_indexes": [], "attempts": 0, "data": null, "error": {...}}

The download stream lines up with your original submission order - line[N] corresponds to list position N (duplicated list positions resolve to their first occurrence). Calling it before the batch is terminal returns 409 BATCH_NOT_FINISHED.

Cancel a batch

curl -X POST "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/cancel" \
  -H "Authorization: Bearer $DATALOOM_API_KEY"
  • A queued batch is cancelled immediately - no work is done.
  • A running batch moves to cancelling and lands cancelled as soon as workers stop scheduling new fetches.
  • Results fetched before the cancel remain retrievable until expiry.
  • Billed credits are not refunded - billing happened at submission.

Cancelling an already-finished batch is a no-op that returns its status unchanged.

Webhooks

Set callback_url in the submit body (HTTPS only; URLs that resolve to private, loopback, or link-local addresses are rejected with 400 INVALID_CALLBACK_URL) and the platform POSTs one signed notification when the batch reaches a terminal status.

Verify the signature before trusting the body:

X-WebInsights-Signature: sha256=HMAC-SHA256("{timestamp}.{raw body}", webhook_secret)
X-WebInsights-Timestamp: <unix seconds>
  • webhook_secret is the per-batch key from the submit 202 response.
  • Compute the HMAC over the literal string "{timestamp}.{raw body}" - the Unix-seconds timestamp header, a dot, then the exact raw request bytes - and compare in constant time (hmac.compare_digest).
  • Reject timestamps older than ~5 minutes (replay protection).
  • Failed deliveries are re-signed with a fresh timestamp and re-sent, so dedupe on the batch id (also sent as the X-WebInsights-Batch-Id header).

The payload is the batch object plus event and, for batches of up to 200 items, the full inline results array:

{
  "event": "batch.completed",
  "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77",
  "object": "batch",
  "status": "completed",
  "dataset": "all-insights",
  "summary": { "submitted": 3, "unique": 3, "duplicates": 0, "failed": 1, "pending": 0, "insight_level": { "complete": 2 } },
  "results": [ { "url": "...", "index": 0, "duplicate_indexes": [], "attempts": 1, "data": {}, "error": null } ]
}
  • event mirrors the terminal status: batch.completed, batch.partial, batch.failed, or batch.cancelled.
  • Batches with more than 200 items omit the inline array and set results_omitted: true - page /results (the payload's absolute results_url points at them) or fetch /download instead.
  • Retries: up to 5 attempts with exponential backoff (60 s → 180 s → 540 s → 1620 s, ~40 minutes total), persisted across restarts. A 3xx response counts as a failed attempt - redirects are never followed.

Errors

Platform-wide gateway rejections (401, 402, 429) and refunds are documented in errors. The batch endpoints add their own:

HTTP-level errors

HTTPCodeMeaningWhat to do
400BATCH_TOO_LARGEMore than 1,000 items in urls.Split the submission.
400INVALID_REQUESTMalformed body or an unknown dataset value (the message names the offending field).Fix the field the message points at.
400INVALID_CALLBACK_URLThe callback_url is not a plain HTTPS URL or targets a private/loopback address - see webhooks.Send a public HTTPS URL.
404BATCH_NOT_FOUNDUnknown batch id.Check the id you stored from the submit response.
409IDEMPOTENCY_CONFLICTAn Idempotency-Key was reused with a different request body.Use a fresh key for the new body.
409BATCH_NOT_FINISHED/download called while the batch is still running.Poll /status first, or read partial pages from /results.
410BATCH_EXPIREDThe batch passed its expires_at (7 days after completion).The results are gone - resubmit if you still need them.

Batch error bodies are bare - no envelope, with a retryable flag:

{
  "error": {
    "code": "BATCH_NOT_FOUND",
    "message": "No batch found with id batch_9f2c...",
    "retryable": false
  }
}

retryable: true means retrying the same request later may succeed (transient upstream failure); retryable: false means the request itself is bad and will fail again unchanged. 400 responses are always billed at 0 credits - a rejected submit never moves your balance.

Item-level errors (batch result rows)

Inside a batch, a failed item never fails the batch - it becomes a result row with error set and data: null:

CodeRetryableMeaning
INVALID_URLnoThe submitted item is not a parseable domain/URL. Produced immediately at submit time; costs nothing (attempts: 0).
INVALID_DOMAINnoThe item parsed as a domain but the data provider rejected it (e.g. the domain does not exist). Check spelling, or treat as "no data".
TIMEOUT_ERRORyesThe fetch timed out transiently.
CONNECTION_ERRORyesCould not connect to the upstream service.
RELAY_SERVICE_ERRORyesThe egress-relay path failed transiently.
INTERNAL_SERVER_ERRORyesUnexpected upstream failure.

Rows written by batches submitted before 2026-11-19 may carry INVALID_DOMAIN where an unparseable item would today say INVALID_URL

  • treat the two identically when scanning historical batches.

How to handle failures per batch:

  • The batch's own status tells you which case you are in: completed (no failures), partial (some), or failed (all).
  • For retryable: true rows, collect their url values and resubmit them as a new batch later - old batches are immutable.
  • retryable: false rows are final; fix or drop those items.

HTTP status summary

StatusWhen
200Success - a batch call where wait caught the finish; every poll, page, download, and cancel.
202Batch accepted - not finished yet.
400Validation failure (see table above).
404Unknown batch id.
409Idempotency conflict, or download before the batch finished.
410The batch expired.
401 / 402 / 429Gateway-level - see errors.

Retention

Results retrievable7 days from completion - expires_at on the batch object
Batch record afterwardskept 30 more days, then purged

Past expires_at, every endpoint for that batch returns 410 BATCH_EXPIRED. Download long-lived data after processing; the batch id is not an archive.

Throughput expectations

Domains are processed concurrently, and each one performs the same upstream fetch as the single-URL endpoint (cold domains are the slow case). Expect minutes for a typical batch, longer for a full 1,000 - use the status counters and partial results to monitor progress, or let the webhook tell you when it is done. Legacy note: batch ids created before the batch_ prefix was introduced resolve as bare hex ids too, so old poll links keep working.

Authoritative paths

The paths above are the v2 batch surface served at https://api.dataloom.dev. The API's reference page always shows the live endpoint list with exact paths, parameters, and per-call costs.

On this page