Skip to main content
Skip to content
ScrapingBuddyDevelopers
On this page Overview

Scraping API/API reference

Create a task

Collect a public page, with optional single-page or deep analysis.

01 / Request

Make a request

POST/api/v1/scraping/tasks

During the current testing stage, a valid customer API key is enough to create a public-page task; separate account and hostname approval is not required. Send one starting URL per task, with a JSON body of at most 8,192 bytes, including any analysis instruction and company context.

Persist a UUID v4 Idempotency-Key and your request before sending. An identical retry with the same key returns the existing task; changing the request with that key returns 409. A different key creates a new task.

Returns 202 for queued, submitting, processing, researching or analyzing tasks, otherwise 200. The response includes pollAfterSeconds: 6 and a Location header for the task.

Required headers
AuthorizationstringRequired
Bearer followed by your ScrapingBuddy customer API key.
Content-TypestringRequired
application/json.
Idempotency-KeyUUID v4Required
Generate once per new task. Save with the request and reuse on uncertain retries. This becomes its ID.

JSON body

urlstringRequired
Complete http:// or https:// URL, at most 2,048 characters. Use a public hostname on standard ports. IP literals, private addresses, embedded credentials and credential query parameters are rejected.
formathtml | markdownOptional
Default: html. Choose markdown for text-oriented workflows or html for your own parsing.
waitForobjectOptional
Optional. Use exactly one condition: {"text":"About us"}, {"element":"main","checkVisible":true}, or {"state":"domcontentloaded"}. state also accepts load. text and element are non-empty strings up to 300 characters. checkVisible defaults to false.
analysisobjectOptional
Optional. Omit to collect content without AI. Include instruction (1-2,000 characters) and optionally companyContext (1-3,000 characters). For multi-page research, add depth: "deep", maxPages (integer 2-30, default 5), and optional webSearch (boolean, default false), with format: "markdown". To classify this one URL, include choices (2-20 labels, 1-80 characters each, unique ignoring case) and use Markdown; read analysis.decision. Models and API keys are server-managed.

02 / Response

Understand the response

Success returns HTTP 202 while work is active, otherwise 200 with JSON. A successful API response is not proof of successful page collection.

taskobject
The task object described below. Inspect task.status before reading content.
pollAfterSecondsinteger
6. Wait at least this long before checking progress.

Task object

idUUID v4
The task ID is the Idempotency-Key you supplied when creating this task. Save it for result retrieval and support.
statusstring
queued, submitting, processing, researching, analyzing, ready, failed, review, or expired. An HTTP 200 alone does not mean the content is ready.
urlstring
The normalized source URL. URL fragments are removed.
formathtml | markdown
The requested content format. Defaults to html.
httpStatusinteger | null
The source website HTTP status, when available. This is separate from the status of your API request.
warningstring | null
A warning can accompany ready content when the wait condition was not met. Check whether the returned page is complete.
contentstring (conditional)
Present only for a ready, unexpired task in create/get responses. Always omitted from task history. Save it before contentExpiresAt; do not execute returned HTML.
analysisobject (conditional)
Present only when requested. status is pending, processing, ready, failed, skipped, or expired. A ready analysis contains result (summary, findings, limitations, sourceUrl), model, usage (inputTokens/outputTokens), and inputTruncated. With analysis.choices, it also contains decision: status, label, confidence, probabilities and insufficientEvidenceProbability. A failed analysis contains error.code and error.message; collected content is still returned. History exposes only analysis.status.
researchobject (conditional)
Deep analysis only: maxPages, pagesCollected, pagesAttempted, stopReason and sources. stopReason is null, page_limit, links_exhausted, time_limit, unconfirmed_page, budget_exhausted or billing_review. Sources include URL, title, status, errorCode and warning; history returns sources: []. When available, webSearch reports status, sourcesFound and warning. content contains only the starting page, not all source pages.
errorobject | null
A task failure or review has code and message fields. This differs from the top-level error string returned for an unsuccessful API request.
billingobject
New paid tasks use mode: "usage". customerChargeUsd is the settled USD charge; heldUsd is a temporary wallet hold, not an additional charge. Provider costs are multiplied by 1.5. Earlier pilot tasks remain free.
createdAtISO timestamp
When the task was created.
completedAtISO timestamp | null
When processing finished, if available.
contentExpiresAtISO timestamp | null
Content and analysis expire 24 hours after page collection. After expiry, both results are omitted and status becomes expired.

Errors & next steps

Request errors return an HTTP error status and a top-level error string. Processing failures appear in task.error even when fetching the result succeeds.

New tasks and batches require $1 available balance; insufficient starting credit returns 402. All customer keys share 60 requests per minute per account. For 429, honor Retry-After; active-task and daily limits may require a longer wait.

Scraping API v1
Scraping referenceCreate a taskGet a task & resultList task historyCreate a classification batchGet classification resultsList classification batchesStop queued classification URLs

Explore the documentation

Scraping APIIntroduction

Public pages, HTML, Markdown, deep research, bulk classification, wallet billing and first integration.

GuidesBulk classification

One question, your own answer labels, and a separate machine-readable result for each website.

GuidesYour first scrape

Go from a public URL to saved page content in four steps.

GuidesAuthentication & access

Connect your server with your customer API key and understand public-page access.

GuidesAI analysis & company context

Extract information, summarize a page or assess relevance with optional OpenAI analysis.

GuidesFormats & page readiness

Choose the content format and when the page is ready to collect.

GuidesTask lifecycle & retention

Know when to poll, when to save content and when to stop.

GuidesSafe retries

Recover a lost response without accidentally creating another task.

GuidesErrors, limits & billing

Understand request failures, task failures and usage-based billing.

POST /scraping/tasksCreate a task

Collect a public page, with optional single-page or deep analysis. During the current testing stage, a valid customer API key is enough to create a public-page task; separate accou

GET /scraping/tasks/{id}Get a task & result

Read task progress and retrieve content when it is ready. Fetch the saved task ID with the same account that created it. Wait at least 6 seconds between progress checks. This reque

GET /scraping/tasksList task history

Find your recent tasks, newest first, without downloading page content. Returns up to 10 tasks per page, ordered by creation time and ID, plus hasMore. Request offset=0, then 10, t

POST /scraping/classificationsCreate a classification batch

Ask one question across up to 100 URLs and constrain answers to your own labels. Send a saved UUID v4 Idempotency-Key and JSON body of at most 256 KiB. The key becomes batch.id. An

GET /scraping/classifications/{id}Get classification results

Retrieve batch progress and all per-URL decisions. Use the batch ID and a key belonging to the same account. Poll at least 10 seconds apart. Returns 202 while queued or running, an

GET /scraping/classificationsList classification batches

Read paginated batch summaries and current classification availability. Returns up to 10 batches, newest first, without items. Use offset=0, then 10, then 20 while hasMore is true.

POST /scraping/classifications/{id}/cancelStop queued classification URLs

Stop batch items that have not started; let in-flight work finish. Send Authorization only; no request body or new Idempotency-Key is required. Repeating cancellation is safe. Only