Fetch API
Turn a URL into markdown, HTML or plain text with one request.
Sometimes an agent only needs to read a page. The Fetch API opens a URL in a real browser and returns its content as markdown, HTML or plain text, without you creating or releasing a session.
Request
POST/v1/fetch
curl -X POST https://api.staging.boxline.dev/v1/fetch \
-H "x-api-key: $BOXLINE_API_KEY" \
-H "content-type: application/json" \
-d '{"url": "https://example.com", "format": "markdown"}'| Field | Description |
|---|---|
url | The page to fetch. Required. |
format | "markdown", "html" or "text". |
timeoutMs | How long to wait for the page, in milliseconds. |
waitUntil | "load", "domcontentloaded" or "networkidle". |
Response
{
"url": "https://example.com",
"finalUrl": "https://example.com/",
"status": 200,
"title": "Example Domain",
"content": "# Example Domain\n\nThis domain is for use in …",
"ms": …
}finalUrl is the address after redirects and status the HTTP status of the page. In the SDK: await client.fetch(url, { format: "markdown" }).
Choosing a format
- markdown keeps headings, links and lists while dropping markup, which makes it a compact input for a model.
- html gives you the markup when you need to parse it yourself.
- text returns just the readable text.
When a task needs clicks, logins or downloads, use a full browser session instead.
These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.