Clean, structured extraction from any URL — Markdown and/or JSON, not HTML soup. Synchronous: one request, one response.
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.
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.
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"]}'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: Bearer $STELQ_KEY
| Field | Type | Notes |
|---|---|---|
| urlrequired | string | The page to extract. |
| formats | string[] | Any of markdown, json (default ["markdown"]). |
| includeMetadata | boolean | Include title, language, byline and fetch time (default false). |
| max_characters | integer | Maximum returned text (default 50000; 0 returns the complete extraction). |
| text_query | string | Question or phrase used to preserve relevant excerpts from anywhere in a long page. |
| text_keywords | string[] | Terms to find across the complete extraction and preserve in the bounded response. |
| relevant_characters | integer | Space reserved for matching excerpts (default 5000; 500 to 20000). |
{
"url": "https://example.com/report",
"formats": [
"markdown",
"json"
],
"includeMetadata": true,
"text_query": "What changed in the revised policy?",
"text_keywords": [
"revised policy",
"effective date"
]
}A successful call returns JSON with the result inline.
{
"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
}| Status | Meaning |
|---|---|
| 400 | Invalid request — a field is missing or malformed (the body says which). |
| 401 | Missing or invalid API key. |
| 402 | Insufficient balance — top up credits to continue. |
| 429 | Rate limited — back off and retry after the Retry-After header. |
| 502 | Upstream temporarily unavailable — safe to retry; not charged. |
Up to 50 requests/second per key.