Skip to content
Get started

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 ParametersJSONExpand Collapse
instructions: string

Instructions describing how to transform the data. Maximum 20,000 characters.

maxLength20000
json_schema: unknown

JSON schema defining the structure of the transformed output

url: string

URL to fetch content from

formaturi
effort: optional "min" or "standard" or "max"

Fetch effort level controlling speed vs. capability tradeoff. “min”: fastest, no fallback (1-5s). “standard”: balanced with enhanced reliability (default, 3-15s). “max”: full browser rendering for JS-heavy sites (15-60s).

One of the following:
"min"
"standard"
"max"
geo_target: optional GeotargetGeoTarget { country }

Optional geotargeting parameters for proxy requests

country: optional string

Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., “US”, “GB”, “JP”). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

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" \
    --max-time 300 \
    -d '{
          "instructions": "For each story, categorize it (tech/business/science/other) and write a one-sentence summary describing the story 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"
        }'
{
  "foo": "bar"
}
{
  "error": "invalid JSON request body"
}
{
  "error": "json schema must be a valid object"
}
{
  "error": "instructions are required"
}
{
  "error": "json schema is required"
}
{
  "error": "url is required"
}
{
  "error": "failed to fetch URL"
}
{
  "error": "web page is too large"
}
{
  "error": "failed to transform data"
}
Returns Examples
{
  "foo": "bar"
}
{
  "error": "invalid JSON request body"
}
{
  "error": "json schema must be a valid object"
}
{
  "error": "instructions are required"
}
{
  "error": "json schema is required"
}
{
  "error": "url is required"
}
{
  "error": "failed to fetch URL"
}
{
  "error": "web page is too large"
}
{
  "error": "failed to transform data"
}