JSON
POST/generate/json
Fetches URL content, extracts data, and transforms it using AI based on custom instructions. Use this to generate new content, summaries, or restructured data.
Body Parameters
instructions: string
Instructions describing how to transform the data
json_schema: unknown
JSON schema defining the structure of the transformed output
url: string
URL to fetch content from
formaturi
nocache: optional boolean
Bypass cache and force fresh data retrieval
JSON
curl https://api.tabstack.ai/v1/generate/json \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $TABSTACK_API_KEY" \
-d "{
\"instructions\": \"For each story, categorize it (tech/business/science/other) and write a one-sentence summary explaining what it's about in simple terms.\",
\"json_schema\": {
\"properties\": {
\"summaries\": {
\"items\": {
\"properties\": {
\"category\": {
\"description\": \"Story category (tech/business/science/etc)\",
\"type\": \"string\"
},
\"summary\": {
\"description\": \"One-sentence summary of the story\",
\"type\": \"string\"
},
\"title\": {
\"description\": \"Story title\",
\"type\": \"string\"
}
},
\"type\": \"object\"
},
\"type\": \"array\"
}
},
\"type\": \"object\"
},
\"url\": \"https://news.ycombinator.com\",
\"effort\": \"standard\"
}"{
"error": "invalid JSON request body"
}{
"error": "failed to fetch URL"
}Returns Examples
{
"error": "invalid JSON request body"
}{
"error": "failed to fetch URL"
}