Docs/Extract
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
| Name | Type | Requirement | Description |
|---|---|---|---|
| url | string | Optional | Single URL to scrape then extract from. |
| urls | string[] | Optional | Multiple URLs to scrape and extract from (async job). |
| content | string | Optional | Raw markdown/text content to extract from (no scraping needed). |
| html | string | Optional | Raw HTML to convert and extract from. |
| prompt | string | Optional | Natural language extraction instruction (e.g. 'Extract all product names and prices'). |
| schema | object | Optional | JSON Schema for structured output. The LLM will return data matching this schema. |
| provider | string | Optional | LLM provider: "openai", "anthropic", "gemini", "groq", "openrouter", etc. |
| only_main_content | boolean | Optional | Extract only main content before LLM processing. |
| wait_for | number | Optional | Wait ms after page load (for URLs). |
| timeout | number | Optional | Scrape timeout in ms (for URLs). |
| headers | object | Optional | Custom HTTP headers. |
| cookies | object | Optional | Custom cookies. |
| webhook_url | string | Optional | Webhook URL for extraction completion notification. |
| webhook_secret | string | Optional | HMAC secret for webhook signature verification. |
Response fields
| Field | Type | Description |
|---|---|---|
| data.extract | object | The structured JSON matching your schema (or free-form when only a prompt is given). |
| data.time_taken | number | Elapsed 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
}
}