Extract Endpoint
Turn raw content, HTML, one URL, or multiple URLs into an answer or schema-shaped JSON.
Getting Started
Send your API key as a bearer token. Start with the smallest request below.
Extract from Content
Send content plus a prompt for an immediate natural-language answer.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "The Acme Pro plan costs $49 per month and includes 10 seats.",
"prompt": "What does the Pro plan cost and how many seats are included?"
}'{
"success": true,
"data": {
"answer": "The Pro plan costs $49 per month and includes 10 seats.",
"content_length": 63
},
"job_id": "550e8400-e29b-41d4-a716-446655440010"
}Input Modes
Raw HTML
Send html when you already have page markup and do not need DataBlue to fetch a URL.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<article><h1>Widget</h1><p>Price: $49</p></article>",
"prompt": "Extract the product name and price"
}'{
"success": true,
"data": {
"answer": "Widget costs $49.",
"content_length": 19
},
"job_id": "550e8400-e29b-41d4-a716-446655440011"
}Single URL
Send url to scrape one page and extract from it synchronously.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/products/widget",
"prompt": "Extract the product name and price"
}'{
"success": true,
"data": {
"url": "https://example.com/products/widget",
"answer": "Widget costs $49.",
"content_length": 1240
},
"job_id": "550e8400-e29b-41d4-a716-446655440012"
}Multiple URLs
Send more than one URL to start an asynchronous extraction job.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://example.com/products/widget",
"https://example.com/products/gadget"
],
"prompt": "Extract the product name and price"
}'{
"success": true,
"job_id": "550e8400-e29b-41d4-a716-446655440013",
"status": "started",
"message": "Extraction started for 2 URLs",
"total_urls": 2
}Check Extraction Status
Poll a multi-URL job until it completes, fails, or is cancelled.
curl -X GET "https://api.datablue.dev/v1/extract/JOB_ID" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"job_id": "550e8400-e29b-41d4-a716-446655440013",
"status": "completed",
"total_urls": 2,
"completed_urls": 2,
"data": [
{
"url": "https://example.com/products/widget",
"answer": "Widget costs $49.",
"content_length": 1240
},
{
"url": "https://example.com/products/gadget",
"answer": "Gadget costs $79.",
"content_length": 1180
}
]
}Extraction Options
Prompt and Schema
Use a prompt for an answer, or add schema to return validated structured fields.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Widget — $49 — In stock",
"prompt": "Extract the product",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"price": {
"type": "number"
},
"in_stock": {
"type": "boolean"
}
},
"required": [
"name",
"price",
"in_stock"
]
}
}'{
"success": true,
"data": {
"extract": {
"name": "Widget",
"price": 49,
"in_stock": true
},
"content_length": 23
},
"job_id": "550e8400-e29b-41d4-a716-446655440014"
}Provider and Model
Set provider and an optional model to use a configured BYOK provider.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Widget — $49",
"prompt": "Extract the product and price",
"provider": "openai",
"model": "gpt-4.1-mini"
}'{
"success": true,
"data": {
"answer": "Widget costs $49.",
"content_length": 12
},
"job_id": "550e8400-e29b-41d4-a716-446655440015"
}URL Content Settings
For URL inputs, control main-content cleanup, wait time, timeout, headers, and cookies.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/account",
"prompt": "Extract the account plan",
"only_main_content": true,
"wait_for": 1000,
"timeout": 30000,
"headers": {
"Accept-Language": "en-US"
},
"cookies": {
"session": "SESSION_VALUE"
}
}'{
"success": true,
"data": {
"url": "https://example.com/account",
"answer": "The account uses the Pro plan.",
"content_length": 860
},
"job_id": "550e8400-e29b-41d4-a716-446655440016"
}Completion
Webhook
Add a webhook to a multi-URL request to receive the completed or failed job event.
curl -X POST "https://api.datablue.dev/v1/extract" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://example.com/products/widget",
"https://example.com/products/gadget"
],
"prompt": "Extract the product name and price",
"webhook_url": "https://api.example.net/webhooks/datablue",
"webhook_secret": "WEBHOOK_SECRET"
}'{
"success": true,
"job_id": "550e8400-e29b-41d4-a716-446655440013",
"status": "started",
"message": "Extraction started for 2 URLs",
"total_urls": 2
}Response
Prompt-only extraction returns data.answer. Schema extraction returns data.extract. Multi-URL requests return a job ID first.
Error Handling
Handle 401 for authentication, 422 for invalid input, 429 for limits, and retry only transient failures.
Extract vs Scrape
Use Extract for specific answers or typed fields. Use Scrape when you need the page content itself.
