Saving web pages as PDFs comes up in many products: "download as PDF" buttons, research and reading tools, legal and compliance records, sending a page to someone offline, or attaching a report page to an email. Browsers can do it by hand; one API request does it from code, for any URL, with the clutter removed.
URL to PDF
curl -X POST "https://shotkit.net/api/take" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","format":"pdf","pdf_paper_format":"a4","block_cookie_banners":true}' \
--fail-with-body -o shot.pdfThis prints the page the way Chrome's print dialog does. Sites with a print stylesheet use it, text stays selectable and links stay clickable.
Exactly as it looks on screen
Print stylesheets often hide navigation and backgrounds. To get the screen version, use the screen media type and print backgrounds:
curl -X POST "https://shotkit.net/api/take" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","format":"pdf","media_type":"screen","pdf_print_background":true,"block_cookie_banners":true,"block_chats":true}' \
--fail-with-body -o shot.pdfOne long page, no page breaks
pdf_fit_one_page puts the whole page on a single PDF page sized to the content. Nothing is cut between pages, which is what you want for archiving or sharing a landing page as it appears:
curl -X POST "https://shotkit.net/api/take" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","format":"pdf","pdf_fit_one_page":true,"pdf_print_background":true,"media_type":"screen"}' \
--fail-with-body -o shot.pdfClean up before printing
block_cookie_banners,block_adsandblock_chatsremove overlays that would otherwise print on every page.hide_selectorsremoves anything else: headers, footers, sidebars, comment sections.stylesadjusts the page for paper, for example"nav, footer { display: none } article { max-width: none }".- Pages behind a login work with
cookiesor anauthorizationheader. See the request options.
Compared to wkhtmltopdf
wkhtmltopdf is still in many codebases but uses an old WebKit engine and was archived in 2023. Modern sites built with flexbox, grid, web fonts and JavaScript often come out broken. This renders in a current Chrome.
Frequently asked questions
Why does my PDF look different from the page in my browser?
The site has a print stylesheet, which Chrome uses when printing. Set media_type: "screen" and pdf_print_background: true to get the on-screen design.
Can I convert a page that requires login?
Yes. Pass the session cookies with cookies or a token with authorization, and the page loads as that user.
Can I combine several URLs into one PDF?
Not in one request. Render each URL and merge the files with a PDF library such as pdf-lib or qpdf.
Are lazy-loaded images included?
Images load as the page is laid out for printing. For pages that load content only on scroll, full_page_scroll: true scrolls through the page first.