webclaw

Extract

Extract structured JSON data from a public URL. Provide a JSON schema for typed output, or a natural language prompt for flexible extraction. Both modes use an LLM to parse the page content.

POST/v1/extract

Extract structured data from a URL using a JSON schema or natural language prompt.

Note
To receive Markdown and structured data together, use the Scrape extraction format. This endpoint remains available and returns its existing data envelope. Hosted extraction costs one credit per page.

Schema mode

Provide a JSON Schema to guide the output structure. Validate returned data and check it against the source before relying on it.

Request body

json
{
  "url": "https://example.com/pricing",
  "schema": {
    "type": "object",
    "properties": {
      "title": { "type": "string" },
      "price": { "type": "number" },
      "currency": { "type": "string" },
      "features": {
        "type": "array",
        "items": { "type": "string" }
      }
    }
  }
}

Response

json
{
  "data": {
    "title": "Pro Plan",
    "price": 49,
    "currency": "USD",
    "features": [
      "Unlimited extractions",
      "Priority support",
      "Custom integrations"
    ]
  }
}

Prompt mode

Describe what you want in plain English. The LLM will determine the structure based on your prompt and the page content.

Request body

json
{
  "url": "https://example.com/pricing",
  "prompt": "Extract all pricing tiers with name, price, and features"
}

Response

json
{
  "data": {
    "tiers": [
      {
        "name": "Hobby",
        "price": 9,
        "features": ["1 seat", "Community support"]
      },
      {
        "name": "Pro",
        "price": 49,
        "features": ["5 seats", "Priority support", "Custom profiles"]
      },
      {
        "name": "Scale",
        "price": 199,
        "features": ["500k pages/month", "Dedicated support", "SLA"]
      }
    ]
  }
}

Parameters

FieldTypeRequiredDescription
urlstringYesURL to extract data from.
schemaobjectNo*JSON Schema defining the desired output structure.
promptstringNo*Natural language description of what to extract.
Warning
You must provide either schema or prompt. If both are provided, schema defines the structure and the prompt adds extraction instructions.
Note
The hosted API manages model access; you only need a Webclaw API key. For a local OSS server, configure a provider using the self-hosting guide. Extracted facts remain model output: missing information and incorrect inferences are possible.

Example

curl -- schema mode
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/product/widget",
    "schema": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "price": { "type": "number" },
        "in_stock": { "type": "boolean" }
      }
    }
  }'
curl -- prompt mode
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/team",
    "prompt": "Extract all team members with name, role, and LinkedIn URL"
  }'

Get started

Ready to build? Start extracting.

Cancel anytime. One key for every format and endpoint.

View on GitHub