sparkcrawlDocs

Enqueue up to 100 independent requests

POST
/api/v1/batches

Authorization

bearerAuth
headerAuthorizationBearer <sc_live_<43 characters>>

Organization API key created at /app/api. Scopes: scrape, crawl, search, research. The secret is shown once.

Header Parameters

Idempotency-Key?string

Replays the original job instead of creating a second one when the same key and body are retried.

Match^[A-Za-z0-9._~-]{1,128}$
Lengthlength <= 128

Request Body

application/json
  1. body
entries*array<>
Items1 <= items <= 100
maxCostUsd?number
Range0 <= value <= 10
Default0.15
maxCustomerCostUsd?number

Optional ceiling in USD on what this request may charge the organization balance. When omitted and billing is enabled, the server reserves exactly the required ceiling: success-page fee × requested pages + maxCostUsd × (1 + upstream markup) — today US$0.005 per page and a 50% markup (GET /api/v1/pricing). The reservation settles down to the measured charge; a value below the required ceiling is rejected.

Range0 <= value <= 100
webhook?

Response Body

Batch accepted

application/json
  1. response
job?
replayed?boolean
Example Request
curl -X POST 'https://sparkcrawl.com/api/v1/batches' \  -H 'Content-Type: application/json' \  -d '{  "entries": [    {      "url": "http://example.com"    }  ]}'
Example Response
{  "job": {    "id": "string",    "kind": "scrape",    "status": "queued",    "url": "http://example.com",    "createdAt": 0,    "updatedAt": 0,    "expiresAt": 0,    "pagesCompleted": 0,    "pagesFailed": 0,    "pagesQueued": 0,    "maxPages": 0,    "upstreamCostUsd": 0,    "reservedCostUsd": 0,    "uncertainCostUsd": 0,    "customerChargeUsd": 0,    "pricingVersion": "string",    "result": {      "id": "string",      "url": "http://example.com",      "finalUrl": "http://example.com",      "status": "success",      "httpStatus": 0,      "tierUsed": 0,      "htmlSource": "response",      "title": "string",      "html": "string",      "markdown": "string",      "json": {},      "structuredJson": null,      "jsonLd": [        null      ],      "screenshotBase64": "string",      "pdfBase64": "string",      "cacheHit": true,      "cacheRevalidated": true,      "etag": "string",      "cacheControl": "string",      "engine": "http",      "stage": "http_direct",      "verification": "passed",      "attempts": [        {          "id": "string",          "tier": 0,          "provider": "string",          "proxy": "string",          "status": "string",          "stage": "string",          "engine": "string",          "durationMs": 0,          "bytes": 0,          "upstreamCostUsd": 0,          "pricingStatus": "string"        }      ],      "durationMs": 0,      "bytes": 0,      "links": [        "http://example.com"      ],      "upstreamCostUsd": 0,      "pricingStatus": "known",      "customerChargeUsd": 0,      "artifacts": {        "html": "string",        "screenshot": "string",        "pdf": "string",        "json": "string"      },      "error": {        "code": "string",        "message": "string"      }    }  },  "replayed": true}