JSON
POST/extract/json
Fetches a URL and extracts structured data according to a provided JSON schema
JSON
curl https://api.tabstack.ai/v1/extract/json \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $TABSTACK_API_KEY" \
-d '{
"json_schema": {
"properties": {
"stories": {
"items": {
"properties": {
"author": {
"description": "Author username",
"type": "string"
},
"points": {
"description": "Story points",
"type": "number"
},
"title": {
"description": "Story title",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"url": "https://news.ycombinator.com",
"effort": "standard"
}'{
"foo": "bar"
}{
"error": "invalid JSON request body"
}{
"error": "json schema must be a valid object"
}{
"error": "json schema is required"
}{
"error": "url is required"
}{
"error": "failed to fetch URL"
}{
"error": "failed to generate JSON"
}{
"error": "web page is too large"
}Returns Examples
{
"foo": "bar"
}{
"error": "invalid JSON request body"
}{
"error": "json schema must be a valid object"
}{
"error": "json schema is required"
}{
"error": "url is required"
}{
"error": "failed to fetch URL"
}{
"error": "failed to generate JSON"
}{
"error": "web page is too large"
}