API URL
POST /api/v1/structured-extraction/extract
Headers
Code
Content-Type: application/jsonBody Parameters
Param
Type
Description
url
optional
string
Public http/https URL to fetch (SSRF-guarded; max 2 MB response)
html
optional
string
Raw inline HTML (max 1 MB)
selectors
required
object
1-25 entries mapping output field names to CSS selectors
Example Request
Code
POST https://datpaq.com/api/v1/structured-extraction/extract?api_key=your-api-key | Body: {"url":"https://example.com/product","selectors":{"title":"h1.product-title","price":".price"}}Successful Response
Status
HTML
200 OKBody
Code
{
"success": true,
"data": {
"title": "Amazing Widget",
"price": "$29.99"
},
"metadata": {
"timingMs": 12,
"fromCache": false,
"correlationId": "req_abc123",
"timestamp": "2026-10-13T12:00:00.000Z",
"processingTime": "12ms",
"api_token_name": null,
"rate_limit": {
"limit": null,
"remaining": null,
"reset": null
}
},
"correlationId": "req_abc123",
"updatedAt": "2026-10-13T12:00:00.000Z"
}Field
Type
success
boolean
data
object
metadata
object
metadata_timingMs
number
metadata_fromCache
boolean
reason
string
details
array
correlationId
string
metadata_correlationId
string
metadata_timestamp
string
metadata_processingTime
string
metadata_api_token_name
string
metadata_rate_limit
object
status
string
service
string
version
string
offlineTests
boolean
error
object
updatedAt
string
Error Response
Example
Code
HTTP 400 ValidationError: Missing selectors or both/neither of url and html — Request rejected before extraction; HTTP 401 AuthenticationError: Gateway authentication failure — Request rejected due to missing or invalid API credentials; HTTP 403 SsrfBlocked: URL destination failed SSRF policy — Reasons include blocked-hostname and dns-resolved-to-blocked-ip; HTTP 404 NotFound: Unknown endpoint path — Request path does not map to available structured-extraction routes; HTTP 413 ResponseTooLarge: Upstream HTML exceeds 2 MB — Reason response-too-large; HTTP 429 RateLimitError: More than 30 requests in 15 minutes — Request rejected by service rate limiter; HTTP 502 FetchError: URL fetch failed or upstream HTTP error — Reasons fetch-failed or upstream-error; HTTP 500 InternalError: Unexpected extraction failure — Extraction could not completeLast Updated: May 4, 2026