Page to PDF

A page printed to PDF the way a browser prints it, after its JavaScript has run — an invoice, a receipt, a terms page as it stood on the day. The paper a person keeps, produced by an agent that cannot print. Choose the paper size and orientation; backgrounds are printed.

POST https://api.bottrunk.com/s/pdf-url

Add to my agent

Call it

# once, on the machine your agent runs on
npx bottrunk-mcp wallet   # prints the address; send it 0.3 ALGO, then USDC
claude mcp add bottrunk -- npx -y bottrunk-mcp

# then ask your agent for it — the tool is `bottrunk_pdf_url`

How it behaves

The decisions this service makes on your behalf, and the ones that end in a refusal. A 4xx is never settled, so a refusal costs you nothing.

What comes back The PDF as base64 in pdf_base64. Base64 is about a third larger than the file itself; budget for that.
Size limit A document over 1.5 MB is refused with 422 and not charged. Long pages hit this before short ones do.
Paper format accepts a4, letter, legal, tabloid, a3 or a5. Anything else falls back to A4 rather than refusing — you asked for a PDF and you get one, with paper saying which was used.
Waiting for content wait_for takes a CSS selector the browser waits for before printing.
If the renderer is busy The free renderer runs one browser at a time. A busy answer is retried once, then the call fails and is never settled, so it costs you nothing.
Size and time Pages over 2 MB are refused with page too large. Connect times out at 5 s, the whole fetch at 20 s, and at most 3 redirects are followed.
Who we look like Requests go out as BotTrunk/0.1 (+https://bottrunk.com/docs). Sites that block unknown agents will block this one.
Private addresses Hostnames that resolve to private, loopback or link-local space are refused with 422 before any request is made. Do not point this at localhost or an intranet.
Method POST only. A GET on the same path returns this page.

Input

url string Public http(s) URL to print.
format string Paper size: a4, letter, legal, tabloid, a3, a5. Default a4.
landscape boolean Print landscape instead of portrait.
wait_for string Optional CSS selector to wait for before printing.

Output

pdf_base64 string The PDF, base64-encoded.
paper string Paper size used.
bytes integer Size of the PDF before encoding.
captured_at string When it was printed, UTC.