Fetch a web page as markdown
Turn any URL into clean markdown with the Flux web fetch endpoint, using the same API key and base URL as your chat requests.
Web fetch turns a URL into clean, LLM-ready markdown in a single call. You send a URL, you get back the page content as markdown — no HTML parsing, no scraping boilerplate. It uses the same API key and base URL (https://api.fluxrouter.ai) as your chat requests, and it's metered like any other Flux call.
Reach for it when you want to ground a model on a live page: pull an article, a doc, or a changelog and hand the markdown straight to a completion.
Make a request
POST /v1/fetch with a JSON body containing the url.
curl https://api.fluxrouter.ai/v1/fetch \
-H "Authorization: Bearer $FLUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com" }'
import requests
resp = requests.post(
"https://api.fluxrouter.ai/v1/fetch",
headers={"Authorization": f"Bearer {FLUX_API_KEY}"},
json={"url": "https://example.com"},
)
page = resp.json()
print(page["markdown"])
From the Flux CLI, the same fetch is one command:
fluxrouter fetch https://example.com
Request fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | — | The page to fetch. Must be an http or https URL. |
render | boolean | No | false | Set true to render JavaScript before extracting content. Use it for single-page apps and pages that need a browser to paint. |
Most pages need only url. Reach for render: true when a plain fetch comes back empty or missing content because the page builds itself with JavaScript. Rendered fetches cost more (see Billing).
curl https://api.fluxrouter.ai/v1/fetch \
-H "Authorization: Bearer $FLUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://app.example.com/dashboard", "render": true }'
fluxrouter fetch https://app.example.com/dashboard --render
Response
A successful fetch returns the page as markdown:
{
"markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
"format": "markdown",
"url": "https://example.com"
}
| Field | Type | Description |
|---|---|---|
markdown | string | The page content, converted to markdown. |
format | string | The content format. Currently always markdown. |
url | string | The URL that was fetched. |
Errors
| Status | Meaning | What to do |
|---|---|---|
400 | The request body wasn't valid JSON, or url was missing or empty. | Send a JSON body with a non-empty url. |
400 | The target URL is blocked. | The URL must be a public http/https address. Private, loopback, and link-local addresses are rejected. Mass-scraping of major social-media sites is not supported. |
401 | The API key is missing or invalid. | Send a valid Authorization: Bearer key. |
402 | Web fetch is a paid capability and this key isn't eligible yet. | Use a key on a paid plan. See Plans and what's included. |
502 | The page couldn't be fetched (the site failed or returned an error). | Retry, or check the URL is reachable. |
503 | The render tier is temporarily unavailable. | Retry shortly, or drop render if you don't need it. |
Billing
Web fetch is a paid capability, available on paid plans. It's metered per fetch and rolls up to the same single bill as your other usage:
- Standard fetch (no
render): $0.005 per fetch. - Rendered fetch (
render: true): $0.02 per fetch.
You're only charged for successful fetches. Blocked URLs and failed fetches are not billed. Repeated fetches of the same URL within a short window are served from cache and not re-billed.
Notes
- Web fetch is for retrieving public web pages. It does not log into sites or fetch authenticated content.
- The endpoint always returns markdown — it's built to feed model context, not to mirror raw HTML.
- To have a model search the web and answer with citations instead of fetching one known URL, use grounded web search.