Staan
Getting Started

Fetch API

Get the main content of 1 to 10 web pages from their URLs, as markdown or plain text, in a single API call — so your agent does not have to fetch and parse them itself. PDF and DOCX files are supported too.

Code
POST https://api.staan.ai/v1/fetch

Each page is served from the Staan index when it holds a version that is fresh enough for you, and fetched live otherwise. You only pay for the URLs returned with content.

Beta

The Fetch API is in beta and is opened on request: write to support@staan.ai to have it enabled on your account. Parameters and response fields may still change.

Not sure which endpoint to use?

Use Fetch API to read pages whose URLs you already have. To find those URLs from a query, use Web Search API, then fetch only the results you need. If you want the full content of every result by default, use Web Search for AI API.

Quick start

TerminalcURL
curl -X POST "https://api.staan.ai/v1/fetch" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls": ["https://betterweb.qwant.com/"]}'
Python
import requests response = requests.post( "https://api.staan.ai/v1/fetch", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"urls": ["https://betterweb.qwant.com/"]}, ) data = response.json() for page in data["results"]: print(page["title"], page["content"][:200])
TypeScriptTypeScript
const res = await fetch('https://api.staan.ai/v1/fetch', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ urls: ['https://betterweb.qwant.com/'] }), }); const { results, errors } = await res.json();

Authentication

Every request must include an Authorization header:

Code
Authorization: Bearer YOUR_API_KEY

The key must have access to the Fetch API. Without it, the request gets 403 SCOPE_NOT_GRANTED.

Parameters

Parameters are sent as a JSON body. Only urls is required.

ParameterTypeDefaultDescription
urlsstring[]—URLs to fetch, 1 to 10 per call, http or https. Duplicates are fetched and billed once.
formatstringmarkdownFormat of the extracted content: markdown or text.
include_imagesbooleanfalseKeeps the images of the main content, as ![description](URL) with absolute URLs. Requires the markdown format.
include_raw_htmlbooleanfalseAlso returns the raw HTML of the page in raw_html, even when no main content could be extracted from it.
max_agenumber—Maximum age, in seconds, of a cached version. 0 always fetches live, -1 never does. See Freshness.
JSONBody example — at most one hour old, as plain text
{ "urls": ["https://betterweb.qwant.com/", "https://www.qwant.com/mobile-apps"], "format": "text", "max_age": 3600 }

Validation

  • Unknown parameters are rejected with a 400 that names them, instead of being silently ignored — a typo never goes unnoticed.
  • A URL sent without a scheme (example.com/page) gets https://, and is returned that way in url. Other schemes (mailto:, ftp:…) are rejected.
  • include_images with format: "text" is rejected with a 400.

Freshness: cache or live

A page can come from two places:

  • the cache — the Staan index (pages already crawled) and the pages fetched live recently;
  • a live fetch, made during your request.

max_age sets how old a cached version you accept:

max_ageA cached version exists and is fresh enoughNo cached version, or too old
omittedServed, whatever its ageLive fetch
N (seconds)Served if it is at most N seconds oldLive fetch
0IgnoredLive fetch
-1Served, whatever its agenot_found error — never a live fetch
  • A failed live fetch returns an error for that URL, never an older cached version: when you set max_age, you know whether you got fresh content.
  • A page fetched live is then reused for up to 4 hours (1 hour with include_raw_html) by the requests that use the same format, include_images and include_raw_html.
  • With include_raw_html or include_images, pages are fetched live more often — and are therefore slower — since not every indexed version keeps its HTML and images.
  • PDF and DOCX files are always fetched live.

In the response, source tells where each page came from (cache or live), and fetched_at when that version was retrieved: this is the date compared to max_age.

Response

Each requested URL appears once, either in results with its content or in errors.

JSONExample response
{ "request_id": "01906c9e-7e3f-7000-8000-abc123def456", "results": [ { "url": "https://betterweb.qwant.com/", "final_url": "https://betterweb.qwant.com/en/", "title": "Better Web by Qwant", "content": "# Better Web\n\nQwant commits to a more responsible web...", "file_type": "html", "content_format": "markdown", "metadata": { "description": "Qwant's commitments for a better web.", "language": "en", "site_name": "Qwant", "published_at": "2026-03-12T00:00:00.000Z", "image": "https://betterweb.qwant.com/cover.png" }, "fetched_at": "2026-11-15T08:42:10.000Z", "source": "cache" } ], "errors": [ { "url": "https://www.example.com/missing", "status": "not_found", "message": "The page was not found (HTTP 404)", "http_status": 404 } ], "usage": { "urls_billed": 1 } }

Response fields

FieldTypeAlways presentDescription
request_idstringYesRequest identifier — include in support tickets.
results[].urlstringYesRequested URL, with https:// added when it was sent without a scheme.
results[].final_urlstringNoURL of the served content, after redirects.
results[].titlestringNoPage title.
results[].contentstring | nullYesMain content of the page. null when it could not be extracted and the page is returned for its raw_html only.
results[].content_errorstringNoWhy content is null: extraction_failed, or too_short (often a page that requires JavaScript).
results[].content_formatstringYesFormat of content actually returned: markdown or text. It can differ from the requested format — see the note below.
results[].file_typestringYeshtml for a web page, pdf or docx for a file.
results[].raw_htmlstringNoRaw HTML of the page, with include_raw_html only.
results[].metadata.descriptionstringNoDescription of the page.
results[].metadata.languagestringNoLanguage of the content (ISO 639-1), detected from its text.
results[].metadata.site_namestringNoName of the website.
results[].metadata.published_atstringNoPublication date (ISO 8601, to the day), or modification date when it is the only one available. Best effort.
results[].metadata.imagestringNoMain image of the page.
results[].fetched_atstringNoWhen the served version was retrieved (ISO 8601): crawl date for the index, fetch date for a live fetch.
results[].sourcestringYeslive: fetched during this request. cache: served from the index or a previous fetch.
errors[].urlstringYesRequested URL.
errors[].statusstringYesError category — see Errors.
errors[].messagestringYesHuman-readable message.
errors[].http_statusnumberNoHTTP status code returned by the website, when it answered (e.g. 404, 403, 503).
usage.urls_billednumberYesNumber of billed URLs — see Billing.

Requested format vs returned format

content_format is text even when you asked for markdown in two cases: PDF and DOCX files, and some indexed versions that are only stored as plain text. Read content_format rather than assuming the requested format.

PDF and DOCX files

Files are handled without any parameter: the type is detected from the file itself, whatever the URL looks like (with or without .pdf).

  • Plain text only, whatever the requested format (content_format: "text"): no images, no raw HTML, no markdown headings or tables.
  • The title and creation date of the file are returned in title and metadata.published_at, when the file declares them.
  • Files are always fetched live.
  • Limits: 20 MB per file, no OCR. A scanned, protected or corrupted PDF returns an error.
  • Any other binary file (image, archive…) returns unsupported.

Errors

A URL that could not be served does not fail the whole request: the call returns 200, and the URL is listed in errors with a status.

statusWhen
timeoutThe live fetch took longer than 20 seconds.
blockedThe domain cannot be fetched (blocked domain, IP address), or the website denied access (HTTP 401 or 403).
not_foundThe page does not exist (HTTP 404 or 410), or is not in the cache with max_age: -1.
unsupportedBinary file other than PDF or DOCX, or page with no usable content (less than 50 characters — usually a page that requires JavaScript).
errorAny other failure: other HTTP error from the website, content that could not be extracted, internal error.

With include_raw_html, a page with no usable content is not an error: it is returned in results with content: null, a content_error and its raw_html.

Errors on the request itself use HTTP status codes:

HTTPErrorCause
400invalid parameterUnknown parameter, invalid URL, more than 10 URLs, invalid value
403SCOPE_NOT_GRANTEDThe key does not have access to the Fetch API
403KEY_DISABLEDThe key is disabled
429too many requestsRate limit exceeded

Billing

usage.urls_billed is the number of URLs returned in results:

  • URLs in errors are not billed;
  • a URL sent twice in the same request is fetched and billed once;
  • a page returned only for its raw_html (content: null) is billed;
  • a page served from the cache is billed like a page fetched live.

Limits

LimitValue
URLs per request10
Live fetch time20 seconds per URL, content extraction included
File size20 MB (PDF, DOCX)
Rate limitSet per account, separately from search — excess traffic is rejected with a 429

Known limitations:

  • JavaScript-rendered pages and pages behind a login (YouTube, Facebook, Instagram, TikTok…) are not supported: they return unsupported.
  • include_raw_html makes responses heavy — several hundred kilobytes for a single news homepage.
  • include_images is experimental: some images can be missing, some are decorative (icons, logos), and captions or photo credits can end up in the text.
  • There is no market or language parameter: live fetches request the English version of a page when the website offers several.
Last modified on