Docs / API reference

POST/v1/extract

Extract

Extract structured data from web pages or raw content using LLM. Accepts URLs to scrape first, or raw markdown/HTML content directly. Returns typed JSON matching your schema.

Execution model

Live request

Runtime depends on endpoint, target, pagination, rendering mode, and active plan limits.

Credit weight

Live catalog

Current weights are managed from the Data API Weights admin table and shown on pricing before use.

Parameters

NameTypeRequirementDescription
urlstringOptionalSingle URL to scrape then extract from.
urlsstring[]OptionalMultiple URLs to scrape and extract from (async job).
contentstringOptionalRaw markdown/text content to extract from (no scraping needed).
htmlstringOptionalRaw HTML to convert and extract from.
promptstringOptionalNatural language extraction instruction (e.g. 'Extract all product names and prices').
schemaobjectOptionalJSON Schema for structured output. The LLM will return data matching this schema.
providerstringOptionalLLM provider: "openai", "anthropic", "gemini", "groq", "openrouter", etc.
only_main_contentbooleanOptionalExtract only main content before LLM processing.
wait_fornumberOptionalWait ms after page load (for URLs).
timeoutnumberOptionalScrape timeout in ms (for URLs).
headersobjectOptionalCustom HTTP headers.
cookiesobjectOptionalCustom cookies.
webhook_urlstringOptionalWebhook URL for extraction completion notification.
webhook_secretstringOptionalHMAC secret for webhook signature verification.

Response fields

FieldTypeDescription
data.extractobjectThe structured JSON matching your schema (or free-form when only a prompt is given).
data.time_takennumberElapsed processing time in seconds for this extraction result.

Request and response

curl -X POST "https://api.datablue.dev/v1/extract" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://openai.com/pricing",
  "prompt": "Extract all pricing tiers with name, price per million tokens, and context window",
  "schema": {
    "type": "object",
    "properties": {
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "input_price": {
              "type": "string"
            },
            "output_price": {
              "type": "string"
            },
            "context_window": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}'
Example response
{
  "success": true,
  "data": {
    "url": "https://openai.com/pricing",
    "extract": {
      "tiers": [
        {
          "name": "GPT-4o",
          "input_price": "$2.50/1M",
          "output_price": "$10.00/1M",
          "context_window": "128K"
        },
        {
          "name": "GPT-4o mini",
          "input_price": "$0.15/1M",
          "output_price": "$0.60/1M",
          "context_window": "128K"
        },
        {
          "name": "GPT-4.1",
          "input_price": "$2.00/1M",
          "output_price": "$8.00/1M",
          "context_window": "1M"
        }
      ]
    },
    "content_length": 48230,
    "time_taken": 2.39
  }
}