Extract Structured Data
Extract Structured Data with the Context.dev API. Supply a schema and a URL. Sample fields include titles. Use the result as input for a related analysis or application.
- Selected price
- $0.002 / billing creditPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- —Loading...
- Success rate · 30d
- —Loading...
Extract Structured Data
Prepare your request, then continue with your agent.
Selected price
$0.002 / billing credit
A billing credit measures provider usage. Credits consumed depend on the operation and request options; one credit is not necessarily one call.
- Provider
- API
- Pricing
On this page
Playground
Run sends a real API request. Charges follow the published API contract.
Response structure
cache_metadataobjectage_msintegerstatusstring
dataobjectpriceTextstringtitlestring
key_metadataobjectcredits_consumedinteger
metadataobjectmaxCrawlDepthintegernumBlockedintegernumFailedintegernumSkippedintegernumSucceededintegernumUrlsinteger
request_idstringstatusstringurlstringurls_analyzedstring[]
// Inferred from response examples. Fields are optional and other fields may be returned.
export type ApiResponse = {
cache_metadata?: {
age_ms?: number;
status?: string;
};
data?: {
priceText?: string;
title?: string;
};
key_metadata?: {
credits_consumed?: number;
};
metadata?: {
maxCrawlDepth?: number;
numBlocked?: number;
numFailed?: number;
numSkipped?: number;
numSucceeded?: number;
numUrls?: number;
};
request_id?: string;
status?: string;
url?: string;
urls_analyzed?: Array<string>;
};Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
context-devCurrent Context.dev — Extract Structured Data · POST · View API reference | $0.002 / billing credit | — | —successP50— |
- Unit price
- $0.002
A billing credit measures provider usage. Credits consumed depend on the operation and request options; one credit is not necessarily one call.
Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 3. Price update time: not supplied.
API
- Method
- POST
- Endpoint
https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
'https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract' \
-X POST \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"maxDepth": 0,
"maxPages": 1,
"schema": {
"additionalProperties": false,
"properties": {
"priceText": {
"description": "Price text including currency as printed; null if absent",
"type": [
"string",
"null"
]
},
"title": {
"description": "Exact book title printed on the page",
"type": [
"string",
"null"
]
}
},
"required": [
"title",
"priceText"
],
"type": "object"
},
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
}'Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
actions | JSON request bodybody | array | null | No | maxItems: 5 Nested fields and variants
Nested fields and variantsobjectNested fields and variants
objectNested fields and variants
objectNested fields and variants
|
factCheck | JSON request bodybody | boolean | No | |
followSubdomains | JSON request bodybody | boolean | No | |
includeFrames | JSON request bodybody | boolean | No | |
instructions | JSON request bodybody | string | No | maxLength: 2000 |
maxAgeMs | JSON request bodybody | integer | null | No | minimum: 0 · maximum: 2592000000 |
maxDepth | JSON request bodybody | integer | No | minimum: 0 |
maxPages | JSON request bodybody | integer | No | minimum: 1 · maximum: 50 |
pdf | JSON request bodybody | object | No | additionalProperties: false Nested fields and variants
|
schema | JSON request bodybody | object | Yes | Nested fields and variants
|
settleAnimations | JSON request bodybody | boolean | No | |
stopAfterMs | JSON request bodybody | integer | No | minimum: 10000 · maximum: 110000 |
tags | JSON request bodybody | array | No | maxItems: 20 Nested fields and variants
|
timeoutOpts | JSON request bodybody | object | No | additionalProperties: false Nested fields and variants
|
url | JSON request bodybody | string | Yes | minLength: 1 · format: uri |
waitForMs | JSON request bodybody | integer | null | No | minimum: 0 · maximum: 30000 |
zdr | JSON request bodybody | string | No | enum: "enabled", "disabled" |
Required markers inside a nested object or variant apply when that object or variant is used.
Sample response
Sample response · Documented HTTP 200 Published documentation example. Verify the actual response after an approved call.
{
"cache_metadata": {
"age_ms": 12682395,
"status": "hit"
},
"data": {
"priceText": "£51.77",
"title": "A Light in the Attic"
},
"key_metadata": {
"credits_consumed": 10
},
"metadata": {
"maxCrawlDepth": 0,
"numBlocked": 0,
"numFailed": 0,
"numSkipped": 0,
"numSucceeded": 1,
"numUrls": 1
},
"request_id": "6e1701d4-1675-474b-a39a-15f6d065ed76",
"status": "ok",
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"urls_analyzed": [
"https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
]
}Usage billing
A billing credit measures provider usage. Credits consumed depend on the operation and request options; one credit is not necessarily one call.
Agent integration
Copy the resource contract without sharing an API key.
View API Markdown
# Extract Structured Data
Extract Structured Data with the Context.dev API. Supply a schema and a URL. Sample fields include titles. Use the result as input for a related analysis or application.
## Available implementations
context-dev · Context.dev — Extract Structured Data: https://openany.si/markets/apis/capabilities/context-dev-extract-structured-data?offering=6fef4136-9846-47f9-bedf-a13fcc111a21 · $0.002 / billing credit
## Selected API contract
Documentation: https://openany.si/markets/apis/capabilities/context-dev-extract-structured-data
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract
Price: $0.002 / billing credit
Pricing note: A billing credit measures provider usage. Credits consumed depend on the operation and request options; one credit is not necessarily one call.
Provider: context-dev
Contract revision: 3
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.
Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.
## Prepared request
```bash
curl \
'https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract' \
-X POST \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"maxDepth": 0,
"maxPages": 1,
"schema": {
"additionalProperties": false,
"properties": {
"priceText": {
"description": "Price text including currency as printed; null if absent",
"type": [
"string",
"null"
]
},
"title": {
"description": "Exact book title printed on the page",
"type": [
"string",
"null"
]
}
},
"required": [
"title",
"priceText"
],
"type": "object"
},
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
}'
```
## API contract
```json
{
"resource_type": "api",
"name": "Context.dev — Extract Structured Data",
"endpoint": "https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract",
"method": "POST",
"content_type": "application/json",
"execution_mode": "sync",
"authentication": {
"type": "bearer",
"environment_variable": "OPENANY_API_KEY"
},
"inputs": [
{
"description": "Crawl a website and return JSON matching a caller-supplied JSON Schema.",
"json_schema": {
"additionalProperties": false,
"properties": {
"actions": {
"items": {
"discriminator": {
"mapping": {
"perform": "#/components/schemas/WebScrapePerformAction",
"scroll": "#/components/schemas/WebScrapeScrollAction",
"wait": "#/components/schemas/WebScrapeWaitAction"
},
"propertyName": "do"
},
"oneOf": [
{
"additionalProperties": false,
"properties": {
"do": {
"enum": [
"wait"
],
"type": "string"
},
"timeMs": {
"maximum": 30000,
"minimum": 0,
"type": "integer"
}
},
"required": [
"do",
"timeMs"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"action": {
"maxLength": 500,
"minLength": 1,
"type": "string"
},
"do": {
"enum": [
"perform"
],
"type": "string"
}
},
"required": [
"do",
"action"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"amount": {
"anyOf": [
{
"maximum": 100000,
"minimum": 1,
"type": "integer"
},
{
"enum": [
"viewport",
"max"
],
"type": "string"
}
]
},
"container": {
"maxLength": 2000,
"minLength": 1,
"type": "string"
},
"direction": {
"enum": [
"up",
"down",
"left",
"right"
],
"type": "string"
},
"do": {
"enum": [
"scroll"
],
"type": "string"
},
"maxScrolls": {
"maximum": 50,
"minimum": 1,
"type": "integer"
}
},
"required": [
"do"
],
"type": "object"
}
]
},
"maxItems": 5,
"type": [
"array",
"null"
]
},
"factCheck": {
"default": false,
"type": "boolean"
},
"followSubdomains": {
"default": false,
"type": "boolean"
},
"includeFrames": {
"default": false,
"type": "boolean"
},
"instructions": {
"maxLength": 2000,
"type": "string"
},
"maxAgeMs": {
"default": 604800000,
"maximum": 2592000000,
"minimum": 0,
"type": [
"integer",
"null"
]
},
"maxDepth": {
"minimum": 0,
"type": "integer"
},
"maxPages": {
"default": 5,
"maximum": 50,
"minimum": 1,
"type": "integer"
},
"pdf": {
"additionalProperties": false,
"default": {
"shouldParse": true
},
"properties": {
"end": {
"minimum": 1,
"type": "integer"
},
"shouldParse": {
"default": true,
"type": "boolean"
},
"start": {
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"schema": {
"additionalProperties": {},
"type": "object"
},
"settleAnimations": {
"default": false,
"type": "boolean"
},
"stopAfterMs": {
"default": 80000,
"maximum": 110000,
"minimum": 10000,
"type": "integer"
},
"tags": {
"items": {
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"maxItems": 20,
"type": "array"
},
"timeoutOpts": {
"additionalProperties": false,
"properties": {
"behavior": {
"default": "fail",
"enum": [
"fail",
"return-partial"
],
"type": "string"
},
"milliseconds": {
"maximum": 300000,
"minimum": 1000,
"type": "integer"
}
},
"required": [
"milliseconds"
],
"type": "object"
},
"url": {
"format": "uri",
"minLength": 1,
"type": "string"
},
"waitForMs": {
"maximum": 30000,
"minimum": 0,
"type": [
"integer",
"null"
]
},
"zdr": {
"default": "disabled",
"enum": [
"enabled",
"disabled"
],
"type": "string"
}
},
"required": [
"url",
"schema"
],
"type": "object"
},
"location": "body",
"name": "body",
"nullable": false,
"pointer": "",
"required": true,
"type": "object"
}
],
"billing": {
"currency": "USD",
"mode": "usage",
"priceMicroUsd": "2000",
"rounding": "ceil",
"unit": "credit",
"unitQuantity": "1"
},
"examples": [
{
"http_status": 200,
"name": "Documentation example (source abbreviated)",
"request": {
"body": {
"maxDepth": 0,
"maxPages": 1,
"schema": {
"additionalProperties": false,
"properties": {
"priceText": {
"description": "Price text including currency as printed; null if absent",
"type": [
"string",
"null"
]
},
"title": {
"description": "Exact book title printed on the page",
"type": [
"string",
"null"
]
}
},
"required": [
"title",
"priceText"
],
"type": "object"
},
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
},
"headers": {},
"path": {},
"query": {}
},
"response_body": {
"cache_metadata": {
"age_ms": 12682395,
"status": "hit"
},
"data": {
"priceText": "£51.77",
"title": "A Light in the Attic"
},
"key_metadata": {
"credits_consumed": 10
},
"metadata": {
"maxCrawlDepth": 0,
"numBlocked": 0,
"numFailed": 0,
"numSkipped": 0,
"numSucceeded": 1,
"numUrls": 1
},
"request_id": "6e1701d4-1675-474b-a39a-15f6d065ed76",
"status": "ok",
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"urls_analyzed": [
"https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
]
}
}
]
}
```Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect the error and usage record before retrying a paid operation. |
Examples
Documentation example (source abbreviated)
Published documentation example. Verify the actual response after an approved call.
Prepare your environment
Use a terminal with cURL installed.
Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.
Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.
Terminal · macOS / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'Run the request
Paste the complete command below into your terminal.
Values to replace before running 1
Review these request fields before running. Keep the published provider and request method unchanged.
body- Crawl a website and return JSON matching a caller-supplied JSON Schema.
Terminal · cURLcurl \ 'https://api.openany.si/v1/agent-apis/context-dev/v1/web/extract' \ -X POST \ -H "Authorization: Bearer $OPENANY_API_KEY" \ -H 'Content-Type: application/json' \ --data-raw '{ "maxDepth": 0, "maxPages": 1, "schema": { "additionalProperties": false, "properties": { "priceText": { "description": "Price text including currency as printed; null if absent", "type": [ "string", "null" ] }, "title": { "description": "Exact book title printed on the page", "type": [ "string", "null" ] } }, "required": [ "title", "priceText" ], "type": "object" }, "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html" }'Check the response
Sample response · Documented HTTP 200
Sample response{ "cache_metadata": { "age_ms": 12682395, "status": "hit" }, "data": { "priceText": "£51.77", "title": "A Light in the Attic" }, "key_metadata": { "credits_consumed": 10 }, "metadata": { "maxCrawlDepth": 0, "numBlocked": 0, "numFailed": 0, "numSkipped": 0, "numSucceeded": 1, "numUrls": 1 }, "request_id": "6e1701d4-1675-474b-a39a-15f6d065ed76", "status": "ok", "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html", "urls_analyzed": [ "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html" ] }