URL to PDF API
Print any web page to PDF, one flat credit
The page as a browser prints it — on the paper you choose, or as one continuous page that looks like the site — with a link to the file you can hand straight to a user.
By Roger Campos · Last updated: October 2026
TL;DR
POST a URL to /pdf and get the whole rendered page back as a PDF: JavaScript run, web fonts and lazy-loaded images in, text selectable, links working, headings as bookmarks. pdf_options set the paper, orientation, margins, scale and stylesheet, or put the page on one long sheet; every option is included in the same 1 credit.
Free plan, no credit card. 1,000 credits a month.
Try it now — no signup
Your result will appear here.
Enter a URL above, or pick one of the example pages.
The request
One POST, one bearer token
curl -X POST https://urlpipe.dev/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/blog/post", "sync": true, "pdf_options": {"paper_size":"letter","margin":15}, "page_options": {"block_cookie_banners":true}}'import requests
res = requests.post(
"https://urlpipe.dev/pdf",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"url": "https://example.com/blog/post", "sync": True, "pdf_options": {"paper_size": "letter", "margin": 15}, "page_options": {"block_cookie_banners": True}},
)const res = await fetch("https://urlpipe.dev/pdf", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://example.com/blog/post", sync: true, pdf_options: {"paper_size":"letter","margin":15}, page_options: {"block_cookie_banners":true} }),
})$ch = curl_init("https://urlpipe.dev/pdf");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["url" => "https://example.com/blog/post", "sync" => true, "pdf_options" => ["paper_size" => "letter", "margin" => 15], "page_options" => ["block_cookie_banners" => true]]),
]);
$response = curl_exec($ch);JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9DcmVhdG9yIChDaHJvbWl1bSkK…
X-Result-Url: https://urlpipe.dev/… (no key needed, valid 30 days)Defaults
What a PDF captures by default
With no options you get the page on A4 portrait, printed the way the browser's own Print does: with the site's print stylesheet if it has one — many hide their navigation and ads for print — and with background colours. The whole page is printed, not just the fold: it is scrolled through first, so images that load on scroll are on every sheet.
The body of the response is the PDF, Base64-encoded. Decode it and save it as a .pdf file, or skip the bytes and use the link in the X-Result-Url header.
pdf_options
Every PDF option
All optional, all included in the price. Out-of-range values are refused before anything is spent.
| Option | Values | What it does |
|---|---|---|
| paper_size | letter, legal, tabloid, a3, a4, a5 — default a4 | The paper the page is printed on |
| landscape | true / false (default) | Turn the paper sideways |
| margin | 0–50 mm, default 10 | The margin on every side |
| scale | 10–200 %, default 100 | Lower it to fit a wide page on narrow paper |
| print_background | true (default) / false | Background colours and images; off gives a lighter, ink-friendly PDF |
| media | print (default) / screen | The site's print stylesheet, or the page as it looks on screen |
| single_page | true / false (default) | The whole page on one sheet as tall as the document — no page break cuts through it |
What the page waits for and what it loses before it is printed is set with page_options: block_cookie_banners, block_ads, remove_selectors, wait_for_selector and delay. The /pdf reference has every detail.
In practice
Save the file, or hand over a link
curl -s https://urlpipe.dev/pdf \
-H "Authorization: Bearer $URLPIPE_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "sync": true}' | base64 --decode > page.pdfEvery PDF response carries an X-Result-Url header: a signed link to the same file that needs no API key and stays valid for the 30 days the result is kept. Put it in an email, a download button or a ticket, with nothing to proxy. An async request gets the same link in its webhook payload as result_url.
Use cases
What people build with it
- Archives and evidence. Terms of service, prices, policies and articles as they stood on a given day, as documents with searchable text. labels tie each one to a case or client.
- Reports from dashboards. A web report or dashboard printed to Letter or A4 to send to someone who will not log in.
wait_for_selectorholds the print until the charts are drawn. - Read-later and offline copies. Documentation and long articles as one continuous
single_pagePDF with working links and bookmarks. - Invoices and receipts you render as HTML. If the page is public, print it with
media: "print"and your own print stylesheet decides the layout.
Pricing
A flat price, whatever the options
A PDF costs 1 credit — A4 or Letter, one sheet or twenty, print or screen styles. The expensive dimensions are capped rather than metered: a 20 MB file, 10 seconds each of delay and wait_for_selector. A PDF you already made is reused for free while it is fresher than max_age, and a failed one costs nothing.
/scrape
A PDF and a screenshot from one visit
/scrape reads several operations off one page load, so a PDF, a screenshot and the metadata describe the same render. Each operation is billed as usual.
Limits
What it does not do
- No HTML input. It prints a URL; it does not take a string of HTML to render.
- No headers, footers or page numbers of your own. What the page and its print stylesheet draw is what is printed.
- No interaction before printing. It can wait for an element, but not click, log in or fill a form.
- No files over 20 MB. Turn off
print_backgroundor remove what you do not need withpage_optionsto bring one under. - Public pages only. Private and intranet addresses are refused.
Pricing
What it costs
| Call | Credits | Free (calls/mo) | Starter (calls/mo) | Pro (calls/mo) | Scale (calls/mo) |
|---|---|---|---|---|---|
| 1 credit | 1,000 | 20,000 | 55,000 | 175,000 |
Cache hits and failed requests cost nothing. Paid plans are never cut off: past the allowance, extra credits are $1.50 per 1,000 credits. See every plan.
FAQ
Frequently asked questions
letter, legal, tabloid, a3, a4, a5, portrait or landscape, with margins from 0 to 50 mm and a scale from 10 to 200 percent. Or single_page: true puts the whole page on one sheet as tall as the document.
Set pdf_options.media to screen. By default the page is printed with its print stylesheet, the way the browser's own Print does, which often hides navigation and ads.
No. Every PDF costs 1 credit, whichever options you use.
Yes. The PDF is printed by Chrome, so text stays text: you can select and search it, links work and headings become bookmarks.
No. The API prints public URLs; it does not render an HTML string you send.
Read the X-Result-Url response header. It is a signed link to the PDF that needs no API key and stays valid for 30 days.
Make your first request in five minutes.
Free plan, no card. Confirm your email and your API key is live — you'll be making real requests in minutes.