POST /v1/fetch

The exact contract for Flux page reading: request fields, the Markdown response, caching and every error, in fetch's own error shape.

Read a public web page and get it back as Markdown. For a guided tour, see Read a web page.

EndpointPOST https://api.fluxrouter.ai/v1/fetch (there is no /fetch without /v1)
BodyJSON
AuthAuthorization: Bearer sk-flux... (or x-api-key) on a paid, cleared plan
StreamingNo
StatusLive

Request fields

FieldTypeRequiredDefaultNotes
urlstringYesnoneThe page to read. A public http or https URL.
renderbooleanNofalsetrue renders the page's JavaScript in a browser first. For pages that build themselves in the browser. Priced separately from a plain read.
bash
curl https://api.fluxrouter.ai/v1/fetch \
  -H "Authorization: Bearer $FLUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com", "render": false }'

Response

200 with:

json
{
  "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
  "format": "markdown",
  "url": "https://example.com"
}
FieldTypeMeaning
markdownstringThe page content as Markdown.
formatstringAlways markdown today.
urlstringThe URL that was read.

Caching and billing

  • A read of the same URL within 6 hours is served from the cache and not billed.
  • Otherwise each read is billed once: priced per call. A rendered read is priced separately.
  • Blocked URLs and failed reads are not billed.
  • A read that takes longer than 25 seconds fails.
  • Page reads do not count against the shared per-minute limit for audio and search.

Errors

Fetch has its own error shape: error is a string, sometimes with a message next to it. It is not the {"error": {...}} object the other abilities use.

json
{ "error": "social_blocked", "message": "social-media mass-scrape is not supported" }
StatuserrorMeaningFix
400body must be JSONThe body did not parse.Send a JSON body.
400url requiredurl is missing or empty.Send a non-empty url.
400blocked target: ...The URL points at a private, loopback, link-local or cloud metadata address.Use a public URL.
400social_blockedThe URL is on a major social network.These sites cannot be read.
401unauthorizedThe key is missing, wrong, revoked or expired.Check the key on your keys page.
402upgrade_requiredPage reading needs a paid, cleared plan. Not charged.Upgrade in Billing.
402credit_unresolvedYour credit balance could not be checked. Not charged.Retry shortly.
402otherYour balance or a spend cap stopped the read. Not charged.Add credit, or raise the cap. See Spend caps.
404not foundPage reading is not switched on for this account.Contact support.
502provider failed: ...The site failed, returned an error or took too long. Not charged.Retry, or check the URL loads in a browser.
503capability_unavailableRendering is unavailable for a while. Not charged.Retry later, or drop render.

Fixes in more detail are on Read a page problems.

From the tools server

The web_fetch tool on the Flux tools server takes url only (it always does a plain read) and calls this endpoint with your key, so it bills the same. Its result carries markdown, format and url, plus cost_microcents. Errors come back as tool results; see the tools server reference.