Docs
Sign inStart free

Content API

Clean, structured extraction from any URL — Markdown and/or JSON, not HTML soup. Synchronous: one request, one response.

POST /v1/content/extract$0.002 / pagesynchronousopen as text

Build Content into your product

Copy one work order and paste it into Claude Code, Cursor, or any coding agent — it finds the right place in your codebase and wires STELQ Content in, so your users get grounded, cited answers at runtime. Every payload references $STELQ_KEY from your environment, never a live secret.

Get a key

01Quickstart

One request to POST /v1/content/extract. Set $STELQ_KEY in your environment and run this as-is — it is generated from the live contract, not transcribed.

submit · cURL
curl -X POST https://api.stelq.com/v1/content/extract \
  -H "Authorization: Bearer $STELQ_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/report","formats":["markdown","json"],"includeMetadata":true,"text_query":"What changed in the revised policy?","text_keywords":["revised policy","effective date"]}'

02Authentication

Every request carries a bearer token in the Authorization header. Copied agent payloads reference the $STELQ_KEY environment variable, so set it in your agent's environment rather than pasting a live secret into a prompt or a chat log.

authorization header
Authorization: Bearer $STELQ_KEY

03Parameters

FieldTypeNotes
urlrequiredstringThe page to extract.
formatsstring[]Any of markdown, json (default ["markdown"]).
includeMetadatabooleanInclude title, language, byline and fetch time (default false).
max_charactersintegerMaximum returned text (default 50000; 0 returns the complete extraction).
text_querystringQuestion or phrase used to preserve relevant excerpts from anywhere in a long page.
text_keywordsstring[]Terms to find across the complete extraction and preserve in the bounded response.
relevant_charactersintegerSpace reserved for matching excerpts (default 5000; 500 to 20000).
request body · JSON
{
  "url": "https://example.com/report",
  "formats": [
    "markdown",
    "json"
  ],
  "includeMetadata": true,
  "text_query": "What changed in the revised policy?",
  "text_keywords": [
    "revised policy",
    "effective date"
  ]
}

04Response

A successful call returns JSON with the result inline.

200 · OK
{
  "url": "https://example.com/report",
  "markdown": "# Report\n\nClean extracted body…",
  "json": {
    "title": "Report",
    "sections": []
  },
  "metadata": {
    "title": "Report",
    "lang": "en",
    "fetchedAt": "2026-06-14T12:00:00Z"
  },
  "text_selection": "head-plus-relevant-excerpts",
  "text_original_characters": 87342,
  "text_truncated": true,
  "text_relevant_characters": 4871
}

05Errors

StatusMeaning
400Invalid request — a field is missing or malformed (the body says which).
401Missing or invalid API key.
402Insufficient balance — top up credits to continue.
429Rate limited — back off and retry after the Retry-After header.
502Upstream temporarily unavailable — safe to retry; not charged.

06Rate limits

Up to 50 requests/second per key.