webclaw

REST API

The webclaw REST API gives you programmatic access to the full extraction engine. The endpoint reference describes JSON requests and responses; streaming endpoints use SSE or NDJSON.

Base URL

Use the cloud endpoint for managed infrastructure, or point at your own instance when self-hosting.

bash
# Cloud (managed)
https://api.webclaw.io

# Self-hosted
http://localhost:3000

Authentication

Authenticated hosted operations require an API key in the Authorization header. Public routes such as health and the verified free tools have separate access rules.

http
Authorization: Bearer <api_key>

Cloud: Create API keys from your dashboard at webclaw.io. Keys are prefixed with wc_.

Self-hosted: Pass --api-key when starting the server, or set the WEBCLAW_API_KEY environment variable. If neither is set, the server runs without authentication.

Note
Without a key, the OSS server permits loopback development access. A public bind requires a key unless open public access is explicitly enabled.

Request format

All POST endpoints accept a JSON body. Set the Content-Type header accordingly.

http
Content-Type: application/json

Response format

Non-streaming API responses use JSON. Successful responses return endpoint-specific data. Errors use a consistent shape:

json
{
  "error": "Human-readable error message"
}

Rate limiting

Cloud API rate limits are based on your plan tier. Self-hosted instances have no rate limits by default. See the Cloud API page for plan details.

Output formats

The /v1/scrape endpoint supports 9 output formats. Pass one or more in the formats array. Request screenshots with the separate screenshot boolean. Query and attributes cannot be combined with browser actions or screenshots.

FormatDescription
extractStructured data with an extract object containing schema, prompt, or both. Can be combined with Markdown. See Scrape for an example.
markdownClean markdown with resolved URLs and collected assets. Default.
textPlain text with no formatting.
jsonFull ExtractionResult as JSON. Includes metadata, content, word count, and extracted URLs.
llmContent optimized for LLM input: image stripping, emphasis removal, link deduplication, and whitespace cleanup. Savings vary by page and tokenizer.
linksArray of all extracted links. Each entry has text and href fields.
rawHtmlThe raw HTML string from the pipeline, before any extraction processing.
attributesExtract DOM attributes by CSS selector. Requires the attribute_selectors parameter.
queryPage-level Q&A with LLM. Requires the query parameter. Returns query_answer in the response.

Document parsing

webclaw auto-detects document types from Content-Type headers and file extensions. In addition to PDF, the following formats are supported natively and converted to your requested output format:

DOCX -- Microsoft Word documents

XLSX -- Excel spreadsheets (each sheet becomes a markdown table)

CSV -- Comma-separated values

Tip
No special parameters are needed. Point /v1/scrape at a .docx, .xlsx, or .csv URL and webclaw handles the rest.

YouTube transcript extraction

YouTube URLs (youtube.com/watch) are auto-detected and processed differently. webclaw extracts structured markdown containing the video title, channel name, view count, publish date, duration, description, and transcript text when captions can be retrieved.

curl
curl -X POST https://api.webclaw.io/v1/scrape \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "formats": ["markdown"]}'
Note
Pass a YouTube watch URL without additional parameters. Captions may be unavailable, and a successful page response does not prove transcript extraction. Check the transcript field and returned content before using it.

Endpoints

The full list of available endpoints.

Core endpoints

MethodPathDescription
POST/v1/scrapeSingle URL extraction. Supports screenshots, mobile emulation, and document parsing (PDF, DOCX, XLSX, CSV).
POST/v1/crawlStart async crawl with path filtering, subdomain/external link control, and webhook support.
GET/v1/crawl/{id}Poll crawl status
GET/v1/crawl/{id}/streamStream crawl results via Server-Sent Events (SSE)
GET/v1/crawl/{id}/pagesPaginated page results for large crawls
GET/v1/crawl/historyList all crawl jobs for your account
POST/v1/crawl/{id}/retryRetry a failed or cancelled crawl with the saved configuration
POST/v1/batchMulti-URL extraction
POST/v1/mapSitemap discovery
POST/v1/endpointsDiscover API endpoints in a page's inline JS and script bundles
POST/v1/searchWeb search with parallel scraping of result pages
POST/v1/extractLLM JSON extraction with prompt-to-schema generation
POST/v1/summarizeLLM summarization
POST/v1/diffContent change tracking
POST/v1/brandBrand identity extraction

X (Twitter)

Monitor X profiles, searches, lists, and replies for new posts. Paid feature; free or lapsed accounts get a 403.

MethodPathDescription
POST/v1/x/monitorsCreate a monitor for a profile, search, list, or replies
GET/v1/x/monitorsList X monitors
GET/v1/x/monitors/{id}Get one monitor
PATCH/v1/x/monitors/{id}Update a monitor
DELETE/v1/x/monitors/{id}Delete a monitor
POST/v1/x/monitors/{id}/checkTrigger an immediate background check

Webhooks

MethodPathDescription
POST/v1/webhooksRegister a new webhook
GET/v1/webhooksList all registered webhooks
PATCH/v1/webhooks/{id}Update a webhook configuration
DELETE/v1/webhooks/{id}Delete a webhook

Firecrawl v2 compatibility

Compatibility routes for supported Firecrawl v2 operations. Change the base URL and API key, then verify the parameters and response fields your client uses.

MethodPathDescription
POST/v2/scrapeFirecrawl-compatible single URL scrape
POST/v2/crawlFirecrawl-compatible async crawl
GET/v2/crawl/{id}Firecrawl-compatible crawl status polling
DELETE/v2/crawl/{id}Firecrawl-compatible crawl cancellation
POST/v2/mapFirecrawl-compatible sitemap URL discovery
POST/v2/searchFirecrawl-compatible web search

Results and history

Authenticated cloud support endpoints for dashboard history, request inspection, replay output lookup, and cached result lookup.

MethodPathDescription
GET/v1/cache/lookupLook up the latest cached output for an endpoint and URL.
GET/v1/resultsPaginated cached results. Supports endpoint, page, and per_page.
GET/v1/results/{id}Fetch one cached result by result ID.
GET/v1/results/run/{usage_log_id}Resolve cached output for a specific dashboard run.
cached output for a run
curl https://api.webclaw.io/v1/results/run/87ac93f1-1ff8-4622-a1f4-1ac2a8117fa7 \
  -H "Authorization: Bearer wc_your_api_key"
Note
Result endpoints are scoped to the authenticated workspace. They are useful for dashboards, agent debug flows, and replay tools that need to recover output from an earlier run.

Utility

MethodPathDescription
GET/healthService health (response details depend on deployment)

POST /v1/search

Perform a web search and optionally scrape all result pages in parallel. Combines discovery and extraction into a single call.

POST/v1/search

Search the web and scrape result pages in parallel.

Request body

json
{
  "query": "best rust web frameworks 2026",
  "num_results": 5,
  "scrape": true,
  "formats": ["markdown"],
  "country": "us",
  "lang": "en"
}
FieldTypeRequiredDescription
querystringYesThe search query string.
num_resultsnumberNoNumber of search results to return (1–10). Default: 5.
scrapebooleanNoWhen true, scrapes each result page in parallel. Default: true.
formatsstring[]NoOutput formats for scraped pages: markdown, text, llm, or json. Defaults to ["markdown"].
countrystringNoTwo-letter country code to localize results (e.g. "us", "gb", "de").
langstringNoTwo-letter language code for results (e.g. "en", "fr").

Example

curl
curl -X POST https://api.webclaw.io/v1/search \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best rust web frameworks 2026",
    "num_results": 3,
    "formats": ["llm"],
    "country": "us"
  }'

POST /v1/extract

Extract structured JSON data from a public URL. Provide a JSON schema to guide the output, or a natural language prompt. Check extracted values against the source. When only a prompt is provided (no schema), the LLM generates a JSON schema first, then extracts data matching it. The response includes a generated_schema field showing the auto-generated schema.

POST/v1/extract

LLM-powered structured data extraction with prompt-to-schema generation.

Prompt-to-schema example

curl
curl -X POST https://api.webclaw.io/v1/extract \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "prompt": "Extract all pricing tiers with name, price, and features"
  }'

When only prompt is provided, the response includes both the extracted data and the generated schema:

Response with generated_schema
{
  "data": {
    "tiers": [
      {"name": "Hobby", "price": 9, "features": ["1 seat", "Community support"]},
      {"name": "Pro", "price": 49, "features": ["5 seats", "Priority support"]}
    ]
  },
  "generated_schema": {
    "type": "object",
    "properties": {
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {"type": "string"},
            "price": {"type": "number"},
            "features": {"type": "array", "items": {"type": "string"}}
          }
        }
      }
    }
  }
}

Enhanced scrape parameters

The /v1/scrape endpoint supports additional parameters for browser automation, screenshots, mobile emulation, cache control, page-level Q&A, and attribute extraction.

FieldTypeRequiredDescription
screenshotbooleanNoRequest a screenshot. Returned as a base64-encoded PNG in the response.
mobilebooleanNoUse a mobile user agent for HTTP fetching. Cannot be combined with screenshots or browser actions.
no_cachebooleanNoBypass the response cache and force a fresh fetch.
querystringNoNatural language question about the page. Used with the query format. The answer is returned in query_answer.
attribute_selectorsobject[]NoArray of {selector, attribute} pairs. Used with the attributes format to extract specific DOM attributes by CSS selector.

Query format example

curl
curl -X POST https://api.webclaw.io/v1/scrape \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/pricing",
    "formats": ["query"],
    "query": "What is the price of the Pro plan?"
  }'

Attributes format example

curl
curl -X POST https://api.webclaw.io/v1/scrape \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["attributes"],
    "attribute_selectors": [
      {"selector": "img", "attribute": "alt"},
      {"selector": "a", "attribute": "href"}
    ]
  }'

Enhanced crawl parameters

The /v1/crawl endpoint now supports path filtering, subdomain and external link control, and webhook notifications.

FieldTypeRequiredDescription
allow_subdomainsbooleanNoAllow the crawler to follow links to subdomains of the starting URL. Default: false.
allow_external_linksbooleanNoAllow the crawler to follow links to external domains. Default: false.
include_patternsstring[]NoGlob patterns for paths to include (e.g. /docs/**). Only matching URLs will be crawled.
exclude_patternsstring[]NoGlob patterns for paths to exclude (e.g. /blog/**). Matching URLs will be skipped.
webhook_urlstringNoURL to receive a POST request when the crawl completes or fails.

Crawl sub-endpoints

GET/v1/crawl/{id}/stream

Stream crawl results in real-time via Server-Sent Events. Each page result is sent as an SSE event as it completes.

GET/v1/crawl/history

List all crawl jobs for your account, ordered by creation date.

POST/v1/crawl/{id}/retry

Retry a failed or completed crawl using the same configuration. Returns a new crawl ID.

Enhanced crawl example

curl
curl -X POST https://api.webclaw.io/v1/crawl \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.stripe.com",
    "max_depth": 3,
    "max_pages": 200,
    "include_patterns": ["/docs/**"],
    "exclude_patterns": ["/docs/changelog/**"],
    "allow_subdomains": false,
    "webhook_url": "https://your-app.com/webhooks/crawl-done"
  }'

Webhooks

Register webhook URLs to receive POST notifications when async operations (crawls, batch jobs) complete. Manage webhooks with full CRUD.

POST/v1/webhooks

Register a new webhook endpoint.

Create webhook request

json
{
  "url": "https://your-app.com/webhooks/webclaw",
  "events": ["crawl.completed", "crawl.failed", "batch.completed"]
}
GET/v1/webhooks

List all registered webhooks for your account.

PATCH/v1/webhooks/{id}

Update an existing webhook's URL or event subscriptions.

DELETE/v1/webhooks/{id}

Delete a webhook. It will no longer receive notifications.

Example

Register a webhook
curl -X POST https://api.webclaw.io/v1/webhooks \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks/webclaw",
    "events": ["crawl.completed"]
  }'

Firecrawl v2 compatibility

These routes translate supported Firecrawl v2 requests and responses. They do not guarantee complete feature parity. Test your client's options and error handling before migrating.

POST/v2/scrape

Firecrawl-compatible scrape. Accepts Firecrawl v2 request format and returns Firecrawl v2 response shape.

POST/v2/crawl

Firecrawl-compatible async crawl. Returns a job ID in Firecrawl v2 format.

GET/v2/crawl/{id}

Poll a Firecrawl-compatible crawl job for status and results.

POST/v2/search

Firecrawl-compatible web search with scraping.

Tip
To migrate from Firecrawl, replace https://api.firecrawl.dev with https://api.webclaw.io in your SDK configuration. Authentication works the same way -- just use your webclaw API key instead.

Quick example

curl
curl -X POST https://api.webclaw.io/v1/scrape \
  -H "Authorization: Bearer wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "formats": ["markdown"]}'

Get started

Ready to build? Start extracting.

Cancel anytime. One key for every format and endpoint.

View on GitHub