# Authentication (/docs/authentication) Dataloom authenticates every request with a key. Direct users authenticate with API keys created in the console; marketplace users authenticate with the key their marketplace issued. ## Direct access — API keys [#direct-access--api-keys] Create and manage API keys on the console's **API keys** page. Send the key on every request using the standard `Authorization: Bearer` scheme: ```bash curl "https://api.dataloom.dev/website-insights/v2/all-insights" \ -G -d url=github.com \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` Keep the key in an environment variable or your platform's secret store — not in source code. ## If a key leaks [#if-a-key-leaks] Revoke it from the console immediately. A revoked key stops authenticating right away; it stays visible in your keys list marked as revoked so you can audit what it was used for. Create a replacement key and update your services. ## Marketplace access — RapidAPI [#marketplace-access--rapidapi] Dataloom APIs are also listed on [RapidAPI](https://rapidapi.com/dataloom/api/website-insights). There you authenticate with the key RapidAPI issued to you, sent as the `X-RapidAPI-Key` header: ```bash curl "$BASE_URL/website-insights/v2/all-insights" \ -G -d url=github.com \ -H "X-RapidAPI-Key: $RAPIDAPI_KEY" ``` The exact base URL for your subscription is shown on the RapidAPI listing. Marketplace usage is attributed separately in your console analytics — see [RapidAPI](/docs/rapidapi) for details. Every request is attributed to a traffic source — direct, marketplace, or playground — and your console usage charts break traffic down by source. # Billing & credits (/docs/billing) Dataloom bills per successful call with **credits**. There are no subscriptions to manage and no charge for failed work. ## Credits [#credits] Each endpoint costs a fixed number of credits per successful call — the cost is listed on every endpoint's reference page and in the console. For example, every Website Insights endpoint costs 1 credit. ## The monthly grant [#the-monthly-grant] When your balance is at **zero**, **250 free credits** are added on the 1st of each month (UTC) — no card required. Accounts that still hold credits receive nothing that month, and free credits expire at the end of the month they arrive in, so they never stack or roll over. Spending draws free credits first; purchased credits stay available for 12 months. One-time credit packs are listed on the [pricing page](https://dataloom.dev/pricing). ## What costs 0 credits [#what-costs-0-credits] Only successful work is charged. You are not billed for: - **Validation failures (4xx)** — a bad parameter or malformed request costs nothing. - **Upstream errors (5xx)** — if Dataloom cannot serve the response, it costs nothing. - **Rate-limited requests (429)** — rejected requests are free. - **Playground calls** — the console playground never uses your keys or credits. ## The credit ledger [#the-credit-ledger] Every charge is recorded in your credit ledger with its request ID, so you can reconcile exactly which call spent which credit. The console shows the ledger and your current balance, and emails you when your balance runs low. Per-endpoint costs: each API's reference page and the console's API detail view. Credit pack pricing: the [pricing page](https://dataloom.dev/pricing). # Errors (/docs/errors) Dataloom APIs use standard HTTP status codes. Failed calls never reach the billing path — only successful work is charged. ## Status codes [#status-codes] | Status | Meaning | Billed? | | --- | --- | --- | | `200` | Success — the response body contains your data | Yes | | `400` | Validation failure — a required parameter is missing or malformed. The body comes from the API; each endpoint's exact error bodies are on its [reference page](/reference) | No | | `401` | Missing, invalid, **or revoked** API key | No | | `402` | Insufficient credit balance for this call — top up in the console | No | | `403` | Account email not verified yet — verify to unlock the key | No | | `404` | Unknown path — check the endpoint's reference page | No | | `429` | Rate limited — slow down and retry (see [rate limits](/docs/rate-limits)) | No | | `500` | Gateway-side failure while checking the request | No | | `502` / `503` | The upstream API could not be reached | No — refunded | | `504` | The upstream API timed out | No — refunded | Anything the upstream API itself returns (including upstream `4xx`/`5xx` not in this table) passes through with its original status and body and costs 0 credits. ## Error bodies — gateway rejections [#error-bodies--gateway-rejections] Gateway-generated rejections (`401`, `402`, `403`, `429`) share one JSON envelope: ```json { "error": "Payment Required", "message": "Insufficient credit balance. Please top up your account.", "service": "Website Insights", "remainingBalance": 0 } ``` | Field | Description | | --- | --- | | `error` | HTTP-style title. `Unauthorized` for `401` and `403`, `Payment Required` for `402`, `Too Many Requests` for `429`. Branch on the status code — never on this title. | | `message` | Human-readable reason for this specific rejection. | | `service` | Name of the service that received the request. | | `remainingBalance` | Your credit balance, present when it is known (`402`, `429`). | ### Every rejection you can hit [#every-rejection-you-can-hit] | Status | `message` | What to do | | --- | --- | --- | | `401` | `Invalid or missing API key` | Send `Authorization: Bearer ` — see [authentication](/docs/authentication) | | `401` | `API key has been revoked` | Create a new key in the console; update your services | | `401` | `Authentication failed` | Rare gateway-side failure — retry once, then contact support | | `402` | `Insufficient credit balance. Please top up your account.` | Top up in the console, or wait for the next monthly grant | | `403` | `API key is pending verification. Please verify your email.` | Verify your email; the key works immediately after | | `429` | `Rate limit exceeded. Your plan limit is N request(s) per second.` | Back off and smooth your request rate — see [rate limits](/docs/rate-limits) | | `429` | `Playground rate limit exceeded. Limit is N request(s) per minute.` | Console playground throttle — wait a minute | | `429` | `Playground daily quota exceeded (max 20 calls/day). Verify email for unlimited access.` | Verify your email to lift the daily playground cap | Rejection responses always carry `X-Gateway-Credit-Cost: 0`; rate-limit rejections additionally carry `Retry-After`, `X-RateLimit-Limit`, and `X-RateLimit-Remaining` — see [response headers](/docs/response-headers). ## Upstream errors [#upstream-errors] When the gateway cannot reach the API itself, it returns `502` (unreachable) or `504` (timeout) with this body: ```json { "messages": "The API is unreachable, please contact the API provider", "info": "Your Client (working) ---> Gateway (working) ---> API (not working)" } ``` The field is `messages`, plural — a historical quirk of the gateway contract, so parse it accordingly. Endpoints that define their own `5xx` example bodies override this default; the endpoint's reference page always shows the exact body to expect. Reserved credits are refunded automatically on `502`/`504` — the refund shows up in your credit ledger, and you are never charged for a call you did not receive (see [billing](/docs/billing)). ## Retrying safely [#retrying-safely] - On `429`, honor the `Retry-After` header, then back off exponentially with jitter. Do not hammer the endpoint — rejected requests are free, but they still count against your rate limit window. - On `5xx`, retrying the same request is safe: the failed attempt cost 0 credits, and a successful retry is charged once. - On `400`, fix the request — the parameter tables on each reference page list every parameter's type, requiredness, and accepted values. ## Request IDs [#request-ids] Every call is recorded with a request ID. Each credit charge and refund in your console ledger is keyed by it, so you can reconcile exactly which call spent which credit. If something looks wrong, quote the request ID from your ledger when writing to [support@dataloom.dev](mailto:support@dataloom.dev) — it lets us find the exact call in the gateway logs. This page documents the gateway-wide contract. Each API can also return endpoint-specific errors (for example, `400` bodies with field-level validation details) — every endpoint's reference page lists its exact response examples, including error bodies. # Dataloom Docs (/docs) Welcome to the Dataloom documentation — guides for integrating the SEO data APIs, billed per successful call. # Batch analysis (/docs/mavion-seo-insights-batch) The batch API takes a list of domains and analyzes 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 (see [webhooks](/docs/mavion-seo-insights-webhooks)). The flow is always the same four steps: ```text POST /analysis → 202 with the batch object (billed here) GET /analysis/{id}/status → progress counters (free) GET /analysis/{id}/results → paginated per-domain results (free) GET /analysis/{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/mavion-seo-insights/v2/analysis`. ## 1. Submit a batch [#1-submit-a-batch] ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis?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: | Parameter | Type | Default | Description | | --- | --- | --- | --- | | `dataset` | string | `all-insights` | Which dataset to compute for every domain — see [datasets & fields](/docs/mavion-seo-insights-datasets). | | `wait` | int 0–30 | `0` | Long-poll: hold the response up to this many seconds for the batch to finish. Returns `200` with final results when it finishes in time, `202` otherwise. | Body: | Field | Type | Required | Description | | --- | --- | --- | --- | | `urls` | string[] | yes | 1 to 10,000 domains or URLs. | | `callback_url` | string | no | HTTPS URL to POST a signed completion notification to — see [webhooks](/docs/mavion-seo-insights-webhooks). | The response is the **batch object** (`202 Accepted`, or `200` when `wait` caught the finish): ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "object": "batch", "status": "queued", "dataset": "all-insights", "detail": "full", "created_at": "2026-10-27T12:00:00.000000+00:00", "completed_at": null, "expires_at": null, "summary": { "submitted": 3, "unique": 3, "duplicates": 0, "failed": 1, "pending": 2 }, "status_url": "/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/status", "results_url": "/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results" } ``` `detail` is always `"full"` — every batch is computed at maximum verbosity (the full topical trust list and the duplicate link classification). It is informational; there is no parameter to change it. Store the `id` — everything else keys off it. ### Deduplication and item indexing [#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. - 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_DOMAIN` 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](/docs/billing). ### Idempotent submissions [#idempotent-submissions] Send an `Idempotency-Key` header to make retries safe — a network timeout after submit will never create a second batch: ```bash -H "Idempotency-Key: my-cron-2026-10-27" ``` - 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 [#2-poll-status] ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/status" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` The batch object's `status` moves through this lifecycle: | Status | Meaning | | --- | --- | | `queued` | Accepted, waiting for a worker. | | `running` | Being processed. | | `cancelling` | Cancel was requested; stops scheduling new fetches. Transient. | | `completed` | Every domain succeeded. | | `partial` | Some succeeded, some failed. | | `failed` | Every domain failed. | | `cancelled` | Cancelled by you. | The `summary` counters tell you how far along it is: ```json { "submitted": 3, "unique": 3, "duplicates": 0, "failed": 1, "pending": 2 } ``` `pending` is what has not finished yet; `failed` counts every error row including the submit-time invalid items. The `completed_at` and `expires_at` timestamps 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 [#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. ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results?offset=0&limit=100" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` | Parameter | Type | Default | Description | | --- | --- | --- | --- | | `offset` | int | `0` | Result index to start from. | | `limit` | int 1–500 | `100` | Max results per page. | ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "object": "batch.results", "status": "running", "offset": 0, "limit": 100, "next_offset": 2, "results": [ { "url": "stripe.com", "index": 0, "duplicate_indexes": [], "attempts": 1, "status": "success", "data": { "metrics": { "trust_score": 91, "link_influence": 76 } }, "error": null }, { "url": "not-a-domain", "index": 2, "duplicate_indexes": [], "attempts": 0, "status": "error", "data": null, "error": { "code": "INVALID_DOMAIN", "message": "The submitted item is not a valid domain or URL.", "retryable": false } } ] } ``` - Rows arrive in **completion order** while the batch runs; keep paging while `next_offset` is set. Once the batch is terminal, `next_offset` is `null` on the last page. - `status` is `"success"` or `"error"` — the same marker the single-URL endpoint's items carry — and a row's `data` is byte-identical to what the single-URL endpoint returns for that domain, so one parser serves both surfaces. - `error` is non-null exactly for failed items — `data` and `error` are never both set. `data` has the shape of the dataset you chose (see [datasets & fields](/docs/mavion-seo-insights-datasets)). - A `retryable: true` error (transient upstream failure) is worth resubmitting as a new batch later; `retryable: false` is a bad item — see [errors](/docs/mavion-seo-insights-errors). ### Python polling example [#python-polling-example] ```python import time, requests BASE = "https://api.dataloom.dev/mavion-seo-insights/v2" HEADERS = {"Authorization": f"Bearer {API_KEY}"} batch = requests.post(f"{BASE}/analysis", 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}/analysis/{batch['id']}/status", headers=HEADERS).json() results, offset = [], 0 while offset is not None: page = requests.get(f"{BASE}/analysis/{batch['id']}/results", params={"offset": offset, "limit": 500}, headers=HEADERS).json() results.extend(page["results"]) offset = page["next_offset"] ``` ## 4. Download everything at once [#4-download-everything-at-once] Once the batch is terminal, fetch every result as [NDJSON](https://github.com/ndjson) — one JSON result row per line, sorted by submission `index`: ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/download" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` ```text {"url": "stripe.com", "index": 0, "duplicate_indexes": [], "attempts": 1, "data": {...}, "error": null} {"url": "github.com", "index": 1, "duplicate_indexes": [], "attempts": 1, "data": {...}, "error": null} {"url": "not-a-domain", "index": 2, "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 [#cancel-a-batch] ```bash curl -X POST "https://api.dataloom.dev/mavion-seo-insights/v2/analysis/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. ## Retention [#retention] | | | | --- | --- | | Results retrievable | 7 days from completion — `expires_at` on the batch object | | Batch record afterwards | kept 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 [#throughput-expectations] Domains are processed concurrently, and each one takes roughly 10–30 seconds (the same challenge-solving as the single-URL endpoint). Expect a sustained rate of a few dozen domains per minute: a 1,000-domain batch takes around half an hour, a full 10,000-domain batch a few hours. Use the `status` counters and partial results to monitor progress, or let the webhook tell you when it is done. # Datasets & fields (/docs/mavion-seo-insights-datasets) Every Mavion SEO Insights lookup — single-URL or batch — computes a **dataset** for the domain. The default, `all-insights`, returns everything; the other datasets return just one section of the same profile, so you pay the same but download and parse less. | `dataset=` | Returns | | --- | --- | | `all-insights` *(default)* | All six sections below. | | `general-info` | `site` only. | | `backlink-profile` | `backlinks` + `anchors`. | | `core-metrics` | `metrics` only. | | `crawl-index` | `crawl` only. | | `language-topics` | `language` only. | On the single-URL endpoint the section sits inside the item's `data` field; in batch results, each row's `data` holds the same object directly. The field reference below shows the `all-insights` shape. The profile is a snapshot of the live index for the domain's root form. Domains with no data in the index return an `INVALID_DOMAIN` error instead of an empty profile — see [errors](/docs/mavion-seo-insights-errors). Schema-wide rules: - All keys are **snake_case**; all numbers are JSON numbers (never numeric strings). - Fields whose upstream value is empty are **omitted** (never `null`) — notably `global_rank`, `site.ip_address`, and `site.redirects_to`. A `0` is a real value and always present. - Responses are always **verbose** — the full topical trust list and the duplicate link classification are included in every response. ## metrics [#metrics] | Field | Type | Description | | --- | --- | --- | | `trust_score` | int | 0–100 measure of how trustworthy the domain's backlinks are. The headline quality metric. | | `link_influence` | int | 0–100 measure of backlink **volume** regardless of quality. A large gap between trust score and link influence usually signals spammy links. | | `global_rank` | int | The domain's rank in the global ordering by backlink count — lower is bigger. Omitted when the domain is unranked. | | `topical_trust` | object[] | Where the domain's trust comes from, by category, strongest first. Each entry: `topic` (full path, e.g. `Business/Financial Services`), `top_level_topic` (e.g. `Business`), `score` (0–100 trust score for that topic), `share_pct` (share of the domain's topical backlinks). Always the complete list. | ## backlinks [#backlinks] | Field | Type | Description | | --- | --- | --- | | `total` | int | Total known external links pointing at the domain. | | `referring_domains` | int | Distinct root domains linking to it. Usually the most meaningful volume metric. | | `referring_ips` | int | Distinct IP addresses linking to it — many links from one IP often means one owner. | | `referring_subnets` | int | Distinct /24 subnets linking to it. | | `edu_backlinks` / `edu_referring_domains` | int | Links from `.ac`/`.edu`-style academic domains. | | `gov_backlinks` / `gov_referring_domains` | int | Links from `.gov`-style government domains. | | `referring_domain_breakdown` | object | Referring domains split by link attributes: `live`, `direct` (linking the root domain directly), `dofollow`, `https`, and `homepage` (linking the homepage). | | `link_breakdown` | object | Link totals broken down by kind: `total_links`, `text`, `image`, `frames`, `redirects`, `nofollow`, `https`, `homepage`, `indirect`, `deleted`. | | `duplicate_link_counts` | object | How many links are duplicates of each other, classified into `distinct`, `notable_duplicate`, `non_notable_duplicate`, `redirect`, `pending_classification`, `cannot_be_classified` — each also suffixed `_live` for the still-live subset. | ## anchors [#anchors] | Field | Type | Description | | --- | --- | --- | | `total_referring_domains` | int | Referring domains covered by the anchor analysis. | | `items` | object[] | The most common anchor texts, highest `referring_domains` first. Each item: `text` (truncated to 200 characters — scraped sentences get cut), `total_links`, `referring_domains`, `nofollow_links`, `deleted_links`, `est_trust_score`, `est_link_influence`. | | `other` | object | Aggregate for anchors outside the top list: `referring_domains`. | ## crawl [#crawl] | Field | Type | Description | | --- | --- | --- | | `crawled_pages` | int | URLs of the domain that have been crawled. | | `indexed_pages` | int | URLs of the domain in the index. | | `first_seen` | string | `YYYY-MM-DD` — when the domain first appeared in the index. | | `first_crawled` | string | `YYYY-MM-DD` — first successful crawl. | | `last_crawled` | string | `YYYY-MM-DD` — most recent crawl. | ## language [#language] | Field | Type | Description | | --- | --- | --- | | `primary_topic` | string | The domain's primary classified topic, e.g. `Computers/Software/Operating Systems`. | | `site_languages` | object[] | Languages detected on the domain's pages, each with `code` (e.g. `en`), `name` (`English`), `share_pct` (share of pages). | | `referring_languages` | object[] | Same shape — languages of the pages that link **to** the domain. | ## site [#site] | Field | Type | Description | | --- | --- | --- | | `title` | string | Title of the domain's landing page at last crawl. | | `ip_address` | string | IP the root domain resolved to at last crawl. Omitted when unknown. | | `redirects_to` | string | Where the root URL redirects to. Omitted when the domain does not redirect. | # Mavion SEO Insights errors (/docs/mavion-seo-insights-errors) This page lists the error codes specific to the Mavion SEO Insights. The platform-wide contract — gateway rejections (`401`, `402`, `429`), and general retry guidance — is the same for every Dataloom API and is documented in [errors](/docs/errors). The API uses two error envelopes: **Single-URL endpoint** — the Website Insights-style envelope, with the request context stamped in: ```json { "status": "error", "error": { "code": "INVALID_DOMAIN", "message": "The provided domain string cannot be parsed into a valid fully qualified domain name.", "target": "url", "rejected_value": "reddit .com", "timestamp": "2026-10-27T12:00:00Z" } } ``` | Field | Description | | --- | --- | | `code` | Stable identifier — branch on this, never on message text. | | `message` | Human-readable reason for this specific failure. | | `target` | Which input failed — always `"url"` on this API. | | `rejected_value` | The input as received (whitespace included). | | `timestamp` | UTC when the error was produced, `YYYY-MM-DDTHH:MM:SSZ`. | **Batch endpoints** — return a bare body with a `retryable` flag: ```json { "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. ## Single-URL endpoint [#single-url-endpoint] | Status | Code | Meaning | What to do | | --- | --- | --- | --- | | `400` | `MISSING_PARAMETER` | The `url` query parameter is absent or empty. | Add `?url=domain`. | | `400` | `INVALID_DOMAIN` | Not a parseable domain/URL, over 2,048 characters — **or the domain has no data in the index**. | Check spelling and TLD; treat as "no backlink data" when the domain is real. | | `502` | `RELAY_SERVICE_ERROR` | The egress-relay path failed transiently. | Retry; back off if it repeats. | | `503` | `CONNECTION_ERROR` | Could not connect to the upstream service. | Retry; the failure may be transient. | | `504` | `TIMEOUT_ERROR` | The upstream fetch timed out. | Retry with a longer client timeout. | | `500` | `INTERNAL_SERVER_ERROR` | Unexpected failure during the fetch. | Retry; the failure may be transient. | `4xx` rejections mean the input itself is bad — no retry helps until the request is fixed. The `5xx` rows are transient: retrying the same request is safe. ## Batch endpoints [#batch-endpoints] Returned by the `/analysis` endpoints: | HTTP | Code | Meaning | What to do | | --- | --- | --- | --- | | `400` | `BATCH_TOO_LARGE` | More than 10,000 items in `urls`. | Split the submission. | | `400` | `INVALID_REQUEST` | Malformed body or an unknown `dataset` value (the message names the offending field). | Fix the field the message points at. | | `400` | `INVALID_CALLBACK_URL` | The `callback_url` is not a plain HTTPS URL or targets a private/loopback address — see [webhooks](/docs/mavion-seo-insights-webhooks). | Send a public HTTPS URL. | | `404` | `BATCH_NOT_FOUND` | Unknown batch id. | Check the id you stored from the submit response. | | `409` | `IDEMPOTENCY_CONFLICT` | An `Idempotency-Key` was reused with a different request body. | Use a fresh key for the new body. | | `409` | `BATCH_NOT_FINISHED` | `/download` called while the batch is still running. | Poll `/status` first, or read partial pages from `/results`. | | `410` | `BATCH_EXPIRED` | The batch passed its `expires_at` (7 days after completion). | The results are gone — resubmit if you still need them. | ## Item-level errors (batch result rows) [#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`: ```json { "url": "not-a-domain", "index": 2, "duplicate_indexes": [], "attempts": 0, "data": null, "error": { "code": "INVALID_DOMAIN", "message": "The submitted item is not a valid domain or URL.", "retryable": false } } ``` | Code | Retryable | Meaning | | --- | --- | --- | | `INVALID_DOMAIN` | no | Not a valid domain — or real but absent from the index. Present at submit time as an immediate row; costs nothing. | | `TIMEOUT_ERROR` | **yes** | The fetch timed out transiently. | | `CONNECTION_ERROR` | **yes** | Could not connect to the upstream service. | | `RELAY_SERVICE_ERROR` | **yes** | The egress-relay path failed transiently. | | `INTERNAL_SERVER_ERROR` | **yes** | Unexpected upstream failure. | Rows written by batches submitted before 2026-10-27 may carry `INVALID_URL` instead of `INVALID_DOMAIN` — treat them identically. 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 [#http-status-summary] | Status | When | | --- | --- | | `200` | Success — single-URL lookup, or a batch call where `wait` caught the finish. | | `202` | Batch accepted — not finished yet. | | `400` | Validation failure (see tables above). | | `404` | Unknown batch id. | | `409` | Idempotency conflict, or download before the batch finished. | | `410` | The batch expired. | | `500` / `502` / `503` / `504` | Upstream fetch failures on the single-URL endpoint — retry. | | `401` / `402` / `429` | Gateway-level — see [errors](/docs/errors). | # Webhooks (/docs/mavion-seo-insights-webhooks) When you submit a batch with a `callback_url`, the API POSTs a signed notification to it the moment the batch reaches a terminal status. That replaces polling: your server reacts to completion instead of asking for it. The `webhook_secret` needed to verify signatures is returned **once**, in the submit response. If you lose it, the batch's callbacks cannot be verified — you would have to treat the payload's summary as advisory and re-fetch results by batch id. ## Receiving a delivery [#receiving-a-delivery] Add `callback_url` to the submit body — HTTPS only: ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis" \ -X POST \ -H "Authorization: Bearer $DATALOOM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "urls": ["stripe.com", "github.com"], "callback_url": "https://api.yourapp.com/hooks/mavion" }' ``` The submit response carries the batch object plus a `webhook_secret`: ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "status": "queued", "webhook_secret": "b3f1c9a2e8d74f06a1c25e9b0d3f87aa" } ``` When the batch finishes (`completed`, `partial`, `failed`, or `cancelled`), your endpoint receives a `POST` with these headers: | Header | Description | | --- | --- | | `X-Mavion-Batch-Id` | The batch id — route on this if you handle several batches. | | `X-Mavion-Timestamp` | Unix seconds when the delivery was signed. | | `X-Mavion-Signature` | `sha256=` followed by the hex HMAC-SHA256 signature. | The body is the batch object plus results: ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "object": "batch", "status": "completed", "dataset": "all-insights", "created_at": "2026-10-27T12:00:00.000000+00:00", "completed_at": "2026-10-27T12:31:14.000000+00:00", "expires_at": "2026-11-03T12:31:14.000000+00:00", "summary": { "submitted": 2, "unique": 2, "duplicates": 0, "failed": 0, "pending": 0 }, "results": [ { "url": "stripe.com", "index": 0, "duplicate_indexes": [], "attempts": 1, "status": "success", "data": {}, "error": null }, { "url": "github.com", "index": 1, "duplicate_indexes": [], "attempts": 1, "status": "success", "data": {}, "error": null } ] } ``` Batches of up to **200 items** carry all result rows inline in `results`. Larger batches set `results_omitted: true` and include a `results_url` pointing at the results endpoint — page through it as usual (see [batch analysis](/docs/mavion-seo-insights-batch)). Respond with any `2xx` status as soon as you have durably queued the work — do heavy processing after replying. ## Verifying the signature [#verifying-the-signature] The signature is HMAC-SHA256 over `"{timestamp}.{raw_body}"`, keyed with your `webhook_secret`. Verify it before trusting a payload: ```python import hmac, hashlib, time def verify(secret: str, timestamp: str, raw_body: bytes, signature: str) -> bool: # Reject stale deliveries: a captured payload stops working after 5 min. if abs(time.time() - int(timestamp)) > 300: return False expected = hmac.new( secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256, ).hexdigest() return hmac.compare_digest(signature, f"sha256={expected}") ``` ```javascript import { createHmac, timingSafeEqual } from "node:crypto"; function verify(secret, timestamp, rawBody, signature) { if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; const expected = "sha256=" + createHmac("sha256", secret) .update(`${timestamp}.${rawBody}`) .digest("hex"); const a = Buffer.from(expected); const b = Buffer.from(signature); return a.length === b.length && timingSafeEqual(a, b); } ``` Three details matter: - Sign the **raw** request body — the exact bytes received, before any JSON parse/re-serialize. - Compare in constant time (`hmac.compare_digest` / `timingSafeEqual`), never `==`. - Reject deliveries whose `X-Mavion-Timestamp` is older than a few minutes — that is what makes captured payloads unreplayable. ## Retries [#retries] If your endpoint does not answer `2xx` within 15 seconds, or the connection fails, the delivery is retried up to **5 times** with a growing wait between attempts (about 30 s, then 60 s, 90 s, 120 s). Failed deliveries do not block anything else — the batch's results stay retrievable either way, so your worst case is switching from webhook to polling for that batch id. ## Monitoring deliveries [#monitoring-deliveries] The status endpoint reports where the callback stands for batches that have one: ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "status": "completed", "webhook": { "status": "delivered", "attempts": 1, "last_status": "200" } } ``` | `webhook.status` | Meaning | | --- | --- | | `pending` | Batch not finished yet (or finishing right now). | | `delivered` | Your endpoint accepted a delivery with a `2xx`. | | `failed` | All 5 attempts exhausted — check your endpoint's availability. | ## Security rules [#security-rules] These are enforced at submit time: - `callback_url` must be a plain **HTTPS** URL — no other scheme, no embedded username/password. - Hosts that resolve to **private, loopback, or link-local addresses** are rejected. This keeps a caller from pointing callbacks at our internal network. - A hostname that does not resolve is accepted at submit (DNS can be transient) — but delivery will fail its retries if it never resolves, which the `webhook.status` above will show. A batch delivers exactly one webhook — at its final state. Partial progress is reported only through the status/results endpoints. # Mavion SEO Insights (/docs/mavion-seo-insights) The Mavion SEO Insights API profiles any domain against a comprehensive backlink index: trust and influence scores, referring domains and IPs, anchor text, topical trust, and crawl metadata — clean JSON with a stable snake_case schema, no scraping on your side. Every profile includes: - **Metrics** — trust score, link influence, global rank, and the full topical trust breakdown by category. - **Backlinks** — external backlink and referring-domain counts, edu/gov links, link-type breakdowns, and the duplicate link classification. - **Anchors** — the anchor text distribution with per-anchor link and domain counts. - **Crawl & index** — crawled and indexed URL counts, first-seen and last-crawl dates. - **Language & topics** — the primary topic, languages on the page, and languages of the referring domains. - **Site** — page title, IP address, and redirect target. ## Two ways to call it [#two-ways-to-call-it] | | Single-URL lookup | Batch analysis | | --- | --- | --- | | **Endpoint** | `GET /mavion-seo-insights/v2/all-insights` | `POST /mavion-seo-insights/v2/analysis` + polling | | **Items per call** | 1 domain | 1 – 10,000 domains | | **Latency** | ~10–30 s per call — the response is final | `202` in milliseconds, results stream in while you poll | | **Billing** | 1 credit per successful call | 1 credit per unique valid domain, charged once at submission | | **Good fit for** | Interactive features, single lookups, one-off checks | Bulk enrichment, monitoring sweeps, feed imports | Lookups are not instant: each one involves solving an anti-bot challenge against the data source, so plan HTTP timeouts of at least 120 seconds on the single-URL endpoint. The batch API exists precisely to escape this — it accepts your whole list immediately and processes it in the background. ## The single-URL endpoint [#the-single-url-endpoint] ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/all-insights" \ -G -d url=stripe.com \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` The response is a single result **item** — the same shape as one row of batch results (excerpt — the complete schema is on [datasets & fields](/docs/mavion-seo-insights-datasets)): ```json { "url": "stripe.com", "status": "success", "data": { "metrics": { "trust_score": 91, "link_influence": 76, "global_rank": 141, "topical_trust": [ { "topic": "Business/Financial Services", "top_level_topic": "Business", "score": 90, "share_pct": 90.96 } ] }, "backlinks": { "total": 74658997, "referring_domains": 442751, "referring_ips": 60244 }, "site": { "title": "Stripe | Payments platform", "redirects_to": "https://stripe.com/" } } } ``` - `url` echoes the domain you asked for, whitespace-stripped. - `status` is `"success"`; `data` holds the six profile sections. - Responses are always **verbose**: every topical trust entry and the duplicate link classification are included — there is no verbosity parameter to tune. A domain that cannot be parsed, or that has no data in the index, returns an error item instead — the [error envelope](/docs/mavion-seo-insights-errors): ```json { "status": "error", "error": { "code": "INVALID_DOMAIN", "message": "The provided domain string cannot be parsed into a valid fully qualified domain name.", "target": "url", "rejected_value": "reddit .com", "timestamp": "2026-10-27T12:00:00Z" } } ``` ## The batch endpoint [#the-batch-endpoint] Submit a list, poll for status, page through results: ```bash curl "https://api.dataloom.dev/mavion-seo-insights/v2/analysis?dataset=all-insights" \ -X POST \ -H "Authorization: Bearer $DATALOOM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls": ["stripe.com", "github.com", "example.com"]}' ``` ```json { "id": "batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77", "object": "batch", "status": "queued", "dataset": "all-insights", "detail": "full", "summary": { "submitted": 3, "unique": 3, "duplicates": 0, "failed": 0, "pending": 3 }, "status_url": "/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/status", "results_url": "/analysis/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results" } ``` The full lifecycle — polling, partial results, NDJSON download, cancel, idempotent retries, and completion webhooks — is covered in [batch analysis](/docs/mavion-seo-insights-batch). ## Billing [#billing] - Single-URL lookups cost **1 credit** per successful call. - Batches cost **1 credit per unique valid domain**, charged once at submission. Duplicate items, invalid items, and every poll, results page, download, and cancel cost **0 credits**. Like all Dataloom APIs, only successful work is charged — see [billing & credits](/docs/billing) for the monthly grant and the ledger. ## Limits [#limits] | Limit | Value | | --- | --- | | Domains per batch submission | 10,000 | | Results per page | 500 | | Batch long-poll (`wait`) | up to 30 s | | Results retrievable after completion | 7 days | | Batch record kept after that | 30 days, then `410 BATCH_EXPIRED` | The paths above are the v2 surface served at `https://api.dataloom.dev`. The API's [reference page](/reference/mavion-seo-insights) always shows the live endpoint list with exact paths, parameters, and per-call costs. ## Next steps [#next-steps] # Playground (/docs/playground) Every Dataloom API has a playground in the [console](https://console.dataloom.dev). It runs **real gateway requests** against the live API, but without your keys and without your credits. ## What it is good for [#what-it-is-good-for] - Evaluating response shapes before you write integration code. - Trying parameter combinations without spending credits. - Sharing a working example with your team. ## Limits [#limits] Playground usage is throttled per minute — enough for evaluation and exploration, not for production workloads. Unverified accounts are also capped at 20 playground calls per day; verifying your email lifts the cap. For real traffic, create an API key (see [authentication](/docs/authentication)). ## How it shows up in analytics [#how-it-shows-up-in-analytics] Playground traffic is attributed to its own source. Your console usage charts break traffic down by source — direct, marketplace, and playground — so experimenting never pollutes your production numbers. # Quickstart (/docs/quickstart) Dataloom APIs are HTTPS endpoints that return clean JSON, billed per successful call with credits. This guide gets you from zero to your first response. ## 1. Create your account [#1-create-your-account] Sign in to the [Dataloom console](https://console.dataloom.dev). Every account receives **250 free credits every month** — no card required. ## 2. Create an API key [#2-create-an-api-key] Open the **API keys** page in the console and create a key. Copy it and store it somewhere safe — you will send it as a secret on every request. Your API key spends your credit balance. Never ship it in client-side code, mobile apps, or public repositories — call Dataloom from your own backend and proxy the results. ## 3. Make your first call [#3-make-your-first-call] Every request authorizes with your key in the `Authorization: Bearer` header. Here is a real call to the Website Insights API, profiling github.com: ```bash curl "https://api.dataloom.dev/website-insights/v2/all-insights" \ -G -d url=github.com \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` The response is a JSON profile of the website — traffic, rankings, and AI referrals for the latest monthly snapshot: ```json { "status": "success", "meta": { "website": "github.com", "snapshot_date": "2026-08-01", "insight_level": "complete" }, "rankings": { "global": 50 }, "traffic": { "history": [ { "month": "2026-06-01", "visits": 615239605 }, { "month": "2026-07-01", "visits": 637885711 }, { "month": "2026-08-01", "visits": 649321442 } ] } } ``` This call costs 1 credit. Every endpoint's cost is listed on its reference page and in the console. ## 4. Watch your balance [#4-watch-your-balance] The console shows your credit balance, a per-request credit ledger with request IDs, and usage charts. You will get an email alert when your balance runs low. ## Next steps [#next-steps] # RapidAPI (/docs/rapidapi) Dataloom APIs are available on [RapidAPI](https://rapidapi.com/dataloom/api/website-insights) as well as directly. The marketplace is a good fit if you already manage your API subscriptions there. ## Direct or marketplace? [#direct-or-marketplace] Both channels hit the same gateway and return identical data. Pick per project: | | Direct | RapidAPI marketplace | | --- | --- | --- | | **Account** | Dataloom console account | RapidAPI account | | **Authentication** | `Authorization: Bearer` with a console API key | `X-RapidAPI-Key` with the marketplace key | | **Base URL** | `https://api.dataloom.dev` | Shown on your RapidAPI subscription | | **Pricing** | Credits — 250 free every month, then top-up packages | Marketplace plans, billed by RapidAPI | | **Free usage** | Monthly credit grant on every account, no card | Whatever free tier the listing offers | | **Usage analytics** | Console ledger and usage charts, per request ID | RapidAPI dashboard; traffic attributed to the marketplace in Dataloom analytics | | **Playground** | Full console playground, no keys or credits needed | Not available | | **Good fit for** | Production integrations that want consolidated analytics and the free monthly grant | Teams that already manage API spend on RapidAPI | Prices and plans on RapidAPI are set per listing — check the listing page for current marketplace terms. ## Subscribing [#subscribing] Each API's RapidAPI listing is linked from the console's API detail page (under **Marketplace**) and from the [website's RapidAPI pages](https://dataloom.dev/rapidapi), which also compare plans and pricing. ## Authentication [#authentication] On the marketplace you authenticate with the key RapidAPI issued to you, sent as the `X-RapidAPI-Key` header: ```bash curl "$BASE_URL/website-insights/v2/all-insights" \ -G -d url=github.com \ -H "X-RapidAPI-Key: $RAPIDAPI_KEY" ``` The exact base URL for your subscription is shown on the RapidAPI listing. Request and response shapes are the same as direct access. ## Attribution and analytics [#attribution-and-analytics] Marketplace requests are attributed per marketplace. Your console shows usage broken down by source, so RapidAPI traffic is always distinguishable from direct traffic. Marketplace subscriptions are billed by the marketplace, not by your Dataloom credit balance. See [billing & credits](/docs/billing) for how the direct (credit-based) model works. # Rate limits (/docs/rate-limits) Dataloom rate-limits requests to keep the gateway fast and fair for everyone. ## Request limits [#request-limits] Accounts have a **per-second request limit** that scales with your credit tier. Requests over the limit are rejected with `429 Too Many Requests` and cost 0 credits. Your key's exact limit is always available to you — it is authoritative in two places: - The `X-RateLimit-Limit` response header on every call (see [response headers](/docs/response-headers)). - The `message` of any `429`, which states the plan limit: *"Rate limit exceeded. Your plan limit is N request(s) per second."* (see [errors](/docs/errors)). The concrete requests-per-second numbers for each tier are gateway-authoritative and a per-tier table will be published on this page. Until then, read your key's limit from the response header — it is the same number the gateway enforces. ## Handling 429s [#handling-429s] - Honor the `Retry-After` header from the `429` response, then back off exponentially with jitter — for example, wait 500 ms, 1 s, 2 s, 4 s between retries. - Treat `429` as a signal to smooth your request pattern, not an error to alert on. - Spread high-volume workloads (bulk domain profiling, scheduled sweeps) across time instead of firing them in parallel bursts. ## Playground throttling [#playground-throttling] The console playground is throttled **per minute**, separately from your API keys. It exists for evaluation — see the [playground guide](/docs/playground). # Response headers (/docs/response-headers) Every response from the Dataloom gateway carries headers that describe what the call cost and what you have left. They are part of the documented contract — read them instead of re-parsing balances out of response bodies. ## Headers on every response [#headers-on-every-response] | Header | Example | Description | | --- | --- | --- | | `X-Gateway-Service` | `website-insights` | The service that served the request. | | `X-Gateway-Credit-Cost` | `1` | Credits charged for this call. `0` whenever the call was free — see [billing](/docs/billing) for what costs nothing. | | `X-Gateway-Remaining-Credits` | `247` | Your credit balance as of this response. | | `X-Gateway-Latency-Ms` | `412` | End-to-end latency of the call, in milliseconds. | | `X-RateLimit-Limit` | `5` | Your key's requests-per-second limit — the authoritative number, also reflected in the message of any `429` (see [rate limits](/docs/rate-limits)). | Responses also include `Access-Control-Allow-Origin: *`. That makes the headers inspectable from any HTTP client — it does not make it safe to ship your API key in browser code (see [authentication](/docs/authentication)). ## Extra headers on rate-limit rejections [#extra-headers-on-rate-limit-rejections] A `429` response carries three additional headers: | Header | Example | Description | | --- | --- | --- | | `Retry-After` | `1` | Seconds to wait before retrying. Honor it instead of inventing your own backoff. | | `X-RateLimit-Limit` | `5` | Your per-second limit. | | `X-RateLimit-Remaining` | `0` | Always `0` on a rejection. | ## Example [#example] ```bash curl -i "https://api.dataloom.dev/website-insights/v2/all-insights?url=github.com" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` ```http HTTP/1.1 200 OK Content-Type: application/json X-Gateway-Service: website-insights X-Gateway-Credit-Cost: 1 X-Gateway-Remaining-Credits: 247 X-Gateway-Latency-Ms: 412 X-RateLimit-Limit: 5 ``` The machine-readable OpenAPI spec for every Dataloom API lives at [`/openapi.json`](/openapi.json); the header contract above is summarized in its top-level description. # Versioning & lifecycle (/docs/versioning) ## Versions live in the URL [#versions-live-in-the-url] Every Dataloom endpoint is versioned in its path: ```text https://api.dataloom.dev/{api}/{version}/{endpoint} └─ website-insights ─┘└─v2─┘└─all-insights ``` A major version is a full contract: parameters, response shape, and error semantics are stable within a version for the life of the endpoint. ## Non-breaking by default [#non-breaking-by-default] Within a version we only make additive changes: - New **optional** request parameters. - New fields in response bodies. Write clients that tolerate unknown fields — standard JSON parsing gives you this for free; don't validate responses against a closed field list. - Clarifying prose in error messages and descriptions. Never parse message text — branch on status codes (see [errors](/docs/errors)). ## What counts as breaking [#what-counts-as-breaking] Removing or renaming a parameter or response field, making an optional parameter required, or changing a field's type or semantics. Breaking changes ship under a **new version prefix** — the previous version keeps serving during a sunset window, then is retired. Endpoints are never removed from a version you are already calling without a new prefix and advance notice. ## How deprecations are announced [#how-deprecations-are-announced] - Each API's reference page has a **Changelog** section (for example, [`website-insights`](/reference/website-insights)) that records version additions, behavior changes, and upcoming sunset dates. Subscribe to it — it is the first place any change appears. - Retirements are posted well before the sunset date, and significant removals are also announced to account holders by email. - While an endpoint is deprecated but not yet retired, it keeps working normally — you will never get a silent behavior change. The version is always visible in the path you are calling, and the [`X-Gateway-Service`](/docs/response-headers) response header confirms which service answered — useful when you are migrating traffic between versions behind a shared client. # Batch analysis (/docs/website-insights-batch) 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](/docs/website-insights)) would return for that domain, so one parser serves both surfaces. The flow is always the same four steps: ```text 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 [#1-submit-a-batch] ```bash 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: | Parameter | Type | Default | Description | | --- | --- | --- | --- | | `dataset` | string | `all-insights` | Which dataset to compute for every domain: `all-insights` (the full profile) or `similar-sites`. | | `wait` | int 0–30 | `0` | Long-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: | Field | Type | Required | Description | | --- | --- | --- | --- | | `urls` | string[] | yes | 1 to 1,000 domains or URLs. | | `callback_url` | string | no | HTTPS URL to POST a signed completion notification to - see [webhooks](#webhooks). | The response is the **batch object** (`202 Accepted`, or `200` when `wait` caught the finish): ```json { "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 [#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](/docs/billing). ### Idempotent submissions [#idempotent-submissions] Send an `Idempotency-Key` header to make retries safe - a network timeout after submit will never create a second batch: ```bash -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 [#2-poll-status] ```bash 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: | Status | Meaning | | --- | --- | | `queued` | Accepted, waiting for a worker. | | `running` | Being processed. | | `cancelling` | Cancel was requested; stops scheduling new fetches. Transient. | | `completed` | Every domain succeeded. | | `partial` | Some succeeded, some failed. | | `failed` | Every domain failed. | | `cancelled` | Cancelled by you. | The `summary` counters tell you how far along it is: ```json { "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 [#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. ```bash curl "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/results?offset=0&limit=100" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` | Parameter | Type | Default | Description | | --- | --- | --- | --- | | `offset` | int | `0` | Result index to start from. | | `limit` | int 1–500 | `100` | Max results per page. | ```json { "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](#item-level-errors) below. ### Python polling example [#python-polling-example] ```python 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 [#4-download-everything-at-once] Once the batch is terminal, fetch every result as [NDJSON](https://github.com/ndjson) - one JSON result row per line, sorted by submission `index`: ```bash curl "https://api.dataloom.dev/website-insights/v2/insights/batch_9f2ce1a4d7b84c0eaf3122ee5a6d9c77/download" \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` ```text {"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 [#cancel-a-batch] ```bash 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 [#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: ``` - `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: ```json { "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 [#errors] Platform-wide gateway rejections (`401`, `402`, `429`) and refunds are documented in [errors](/docs/errors). The batch endpoints add their own: ### HTTP-level errors [#http-level-errors] | HTTP | Code | Meaning | What to do | | --- | --- | --- | --- | | `400` | `BATCH_TOO_LARGE` | More than 1,000 items in `urls`. | Split the submission. | | `400` | `INVALID_REQUEST` | Malformed body or an unknown `dataset` value (the message names the offending field). | Fix the field the message points at. | | `400` | `INVALID_CALLBACK_URL` | The `callback_url` is not a plain HTTPS URL or targets a private/loopback address - see [webhooks](#webhooks). | Send a public HTTPS URL. | | `404` | `BATCH_NOT_FOUND` | Unknown batch id. | Check the id you stored from the submit response. | | `409` | `IDEMPOTENCY_CONFLICT` | An `Idempotency-Key` was reused with a different request body. | Use a fresh key for the new body. | | `409` | `BATCH_NOT_FINISHED` | `/download` called while the batch is still running. | Poll `/status` first, or read partial pages from `/results`. | | `410` | `BATCH_EXPIRED` | The 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: ```json { "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) [#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`: | Code | Retryable | Meaning | | --- | --- | --- | | `INVALID_URL` | no | The submitted item is not a parseable domain/URL. Produced immediately at submit time; costs nothing (`attempts: 0`). | | `INVALID_DOMAIN` | no | The 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_ERROR` | **yes** | The fetch timed out transiently. | | `CONNECTION_ERROR` | **yes** | Could not connect to the upstream service. | | `RELAY_SERVICE_ERROR` | **yes** | The egress-relay path failed transiently. | | `INTERNAL_SERVER_ERROR` | **yes** | Unexpected 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 [#http-status-summary] | Status | When | | --- | --- | | `200` | Success - a batch call where `wait` caught the finish; every poll, page, download, and cancel. | | `202` | Batch accepted - not finished yet. | | `400` | Validation failure (see table above). | | `404` | Unknown batch id. | | `409` | Idempotency conflict, or download before the batch finished. | | `410` | The batch expired. | | `401` / `402` / `429` | Gateway-level - see [errors](/docs/errors). | ## Retention [#retention] | | | | --- | --- | | Results retrievable | 7 days from completion - `expires_at` on the batch object | | Batch record afterwards | kept 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 [#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. The paths above are the v2 batch surface served at `https://api.dataloom.dev`. The API's [reference page](/reference/website-insights) always shows the live endpoint list with exact paths, parameters, and per-call costs. # Website Insights (/docs/website-insights) The Website Insights API profiles any website in one call: monthly visit history, engagement, global and country rankings, traffic sources, top keywords, and how much traffic AI assistants send it - clean JSON with a stable flattened schema, no scraping on your side. Every `all-insights` profile includes: - **Profile** - page title, description, category, and favicon/screenshot URLs. - **Rankings** - global rank, top country rank, and category rank. - **Traffic** - 12 months of visit history, engagement metrics, and the ten-channel traffic-sources breakdown. - **SEO** - top keywords with search volume and CPC. - **AI referrals** - total AI-assistant visits and the per-platform share (ChatGPT, Gemini, Claude, …) with monthly history. ## Two ways to call it [#two-ways-to-call-it] | | Single-URL lookup | Batch analysis | | --- | --- | --- | | **Endpoint** | `GET /website-insights/v2/all-insights` | `POST /website-insights/v2/insights` + polling | | **Items per call** | 1 domain | 1 – 1,000 domains | | **Latency** | final response in one call (a cold domain needs a live upstream fetch - allow long HTTP timeouts) | `202` in milliseconds, results stream in while you poll | | **Billing** | 1 credit per call | 1 credit per unique valid domain, charged once at submission | | **Good fit for** | Interactive features, single lookups, one-off checks | Bulk enrichment, monitoring sweeps, feed imports | There is also a focused companion endpoint, `GET /website-insights/v2/similar-sites`, which returns just the similar-site list. Lookups are not always instant: a cold domain requires a live fetch against the data source, so plan generous HTTP timeouts on the single-URL endpoints. The batch API exists precisely to escape this - it accepts your whole list immediately and processes it in the background. ## The single-URL endpoints [#the-single-url-endpoints] ```bash curl "https://api.dataloom.dev/website-insights/v2/all-insights" \ -G -d url=github.com \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` The response is one **flattened** body - the status fields sit at the top level, not in a nested `meta` block (excerpt): ```json { "status": "success", "website": "github.com", "snapshot_date": "2026-10-01", "insight_level": "complete", "profile": { "title": "GitHub: Let's build from here", "description": "GitHub is where people build software.", "category": "Computers Electronics and Technology/Programming and Developer Software" }, "rankings": { "global": 50 }, "traffic": { "history": [ { "month": "2026-08-01", "visits": 649321442 }, { "month": "2026-09-01", "visits": 641102994 } ], "engagement": { "pages_per_visit": 5.768, "avg_duration_seconds": 384.664, "bounce_rate": 0.367 }, "sources_share": { "direct": 0.526, "organic_search": 0.2454, "referrals": 0.0956, "generative_ai": 0.0234 } }, "ai_referrals": { "total_visits": 13892123, "platforms": [ { "name": "chatgpt.com", "share": 0.715487, "history": [{ "month": "2026-09-01", "share": 0.70412 }] } ] } } ``` How to read it: - `snapshot_date` is the **data month**, labeled with its first day: `2026-10-01` means "the October 2026 monthly bucket". New months land between the 1st and 15th as the provider rolls data over. - `insight_level` is honest about coverage: `complete`, `zero_traffic`, `insufficient_data`, or `crawler_blocked`. Body `status` mirrors it - `success` only when data is actually present. - **Shares are fractions of 1** everywhere (`0.4714` = 47.14%). - `null` means "no data"; `0` is a measured zero. - `website` echoes the normalized registered domain (lowercase, no `www.`), whatever spelling you sent. `similar-sites` takes the same `url` parameter plus an optional `raw_resp=true` that returns the upstream payload as-is: ```bash curl "https://api.dataloom.dev/website-insights/v2/similar-sites" \ -G -d url=github.com \ -H "Authorization: Bearer $DATALOOM_API_KEY" ``` ```json { "status": "success", "website": "github.com", "insight_level": "complete", "similar_sites": [ { "domain": "gitlab.com", "similarity": 0.87, "category": "Programming and Developer Software" } ] } ``` ## Errors on the single-URL endpoints [#errors-on-the-single-url-endpoints] Failed validation is always a `400` with the V2 error envelope: ```json { "status": "error", "error": { "code": "INVALID_URL", "message": "The provided url string cannot be parsed into a valid domain.", "target": "url", "rejected_value": "not_a_domain!", "timestamp": "2026-11-19T12:00:00Z" } } ``` | Field | Description | | --- | --- | | `code` | Stable identifier - branch on this, never on message text. | | `message` | Human-readable reason for this specific failure. | | `target` | Which input failed - always `"url"` on this API. | | `rejected_value` | The input as received (whitespace included). | | `timestamp` | UTC when the error was produced, `YYYY-MM-DDTHH:MM:SSZ`. | The full status table: | Status | Code | Meaning | What to do | | --- | --- | --- | --- | | `400` | `MISSING_PARAMETER` | The `url` query parameter is absent or empty. | Add `?url=domain`. | | `400` | `INVALID_URL` | The submitted string cannot be parsed into a domain at all (bad characters, no TLD, over 2,048 characters). | Fix the input - this is a request problem, not a data problem. | | `400` | `INVALID_DOMAIN` | The string parsed fine as a domain, but the data provider rejected it (for example a domain that does not exist). | Treat as "no data for this domain"; check spelling. | | `502` | `RELAY_SERVICE_ERROR` | The egress-relay path failed transiently. | Retry; back off if it repeats. | | `503` | `CONNECTION_ERROR` | Could not connect to the upstream service. | Retry; the failure may be transient. | | `504` | `TIMEOUT_ERROR` | The upstream fetch timed out. | Retry with a longer client timeout. | | `500` | `INTERNAL_SERVER_ERROR` | Unexpected failure during the fetch. | Retry; the failure may be transient. | As of 2026-11-19 the two `400` codes have distinct meanings: `INVALID_URL` = your input string was unparseable; `INVALID_DOMAIN` = the input parsed but the provider rejected the domain. Responses emitted before that date used `INVALID_DOMAIN` for both cases - update any branch that treats them as one code. A domain that parses and exists but has no usable data is **not** an error: the endpoint returns `200` with `status: "insufficient_data"` (or a null-filled body), so treat the body's `insight_level`, not the HTTP code, as the coverage signal. The platform-wide contract - gateway rejections (`401`, `402`, `429`) and general retry guidance - is documented in [errors](/docs/errors). ## Billing [#billing] - Single-URL lookups cost **1 credit** per call. - Batches cost **1 credit per unique valid domain**, charged once at submission. Duplicate items, invalid items, and every poll, results page, download, and cancel cost **0 credits**. Like all Dataloom APIs, only successful work is charged - see [billing & credits](/docs/billing) for the monthly grant and the ledger. ## Limits [#limits] | Limit | Value | | --- | --- | | Domains per batch submission | 1,000 | | Results per page | 500 | | Batch long-poll (`wait`) | up to 30 s | | Results retrievable after completion | 7 days | | Batch record kept after that | 30 days, then `410 BATCH_EXPIRED` | The paths above are the v2 surface served at `https://api.dataloom.dev`. The API's [reference page](/reference/website-insights) always shows the live endpoint list with exact paths, parameters, and per-call costs. ## Next steps [#next-steps]