Developer Platform

PDF generation API for developers

Convert any URL or raw HTML into a professionally styled PDF with a single API call. Smart content extraction removes ads and clutter. 5 templates. Site-specific parsers for 8 platforms. Built on WeasyPrint for print-quality output.

API access on Pro+ ($12/mo). 100 PDFs/month included.

Endpoints

Two endpoints, two integration patterns

Choose the endpoint that fits your workflow. Both return the PDF binary directly in the response.

POST /v1/generate

Send HTML content plus options. Full control over input. Useful when you've already fetched the page or want to send custom HTML. Pass the html field in the request body along with optional template, page_size, and url for link resolution.

POST /v1/generate/url

Send a URL, the server fetches and processes it. Simplest integration — one URL in, one PDF out. The server handles fetching, content extraction, and rendering. Pass the url field along with optional template and page_size.

Code examples

Authenticate with the X-API-Key header. The response body is the PDF binary — write it directly to a file. All examples use the /v1/generate/url endpoint for brevity.

cURL

curl -X POST https://api.prettypdfprinter.com/v1/generate/url \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/article", "template": "clean"}' \
  -o output.pdf

Python

import requests

resp = requests.post(
    "https://api.prettypdfprinter.com/v1/generate/url",
    headers={"X-API-Key": "your_api_key"},
    json={"url": "https://example.com/article", "template": "clean"}
)
with open("output.pdf", "wb") as f:
    f.write(resp.content)

JavaScript

const resp = await fetch("https://api.prettypdfprinter.com/v1/generate/url", {
  method: "POST",
  headers: {
    "X-API-Key": "your_api_key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ url: "https://example.com/article", template: "clean" })
});
const pdf = await resp.arrayBuffer();
// Save or stream the PDF binary
Capabilities

What the API includes

The same engine that powers the Chrome extension, available programmatically.

Content Extraction

Same smart extraction as the extension. Ads, navigation, sidebars, cookie banners, and clutter removed automatically. Only the main content reaches the PDF.

Template Selection

Choose from 5 templates via the template parameter: Clean, Minimal, Corporate, Academic, or Dark Mode. Each includes embedded fonts and professional typography.

Site-Specific Parsers

8 platforms with dedicated parsers — GitHub, Medium, Stack Overflow, Dev.to, Substack, Notion, Reddit, and Confluence. Optimized extraction for each site's HTML structure.

Page Size Options

A4, Letter, Legal, or custom dimensions. Set the page_size parameter to match your output requirements. Default is A4.

Custom Headers & Footers

Pro tier feature. Add your company logo, page numbers, custom text, and date stamps to every page. Configured via print profiles or per-request parameters.

Batch Processing

Process multiple URLs in sequence via the API. Build pipelines that convert entire documentation sites, article collections, or report sets into PDFs programmatically.

Pricing

API pricing tiers

API access starts at Pro+. Scale up as your volume grows.

Feature Pro+ ($12/mo) API Scale ($29/mo) Enterprise
Monthly PDF limit 100 500 Custom
Rate limit 10/min 30/min Custom
Content extraction Yes Yes Yes
All templates Yes Yes Yes
Custom branding Yes Yes Yes
Priority support No Yes Yes

Frequently asked questions

Rate limits depend on your plan. Pro+ allows 10 requests per minute, API Scale allows 30 requests per minute, and Enterprise plans get custom rate limits. Requests that exceed the limit receive a 429 response with a Retry-After header.
The API is a standard REST endpoint that works with any language that can make HTTP requests. We provide examples for cURL, Python, and JavaScript, but you can use Go, Ruby, Java, PHP, Rust, or any other language with an HTTP client.
Yes. The API uses the same smart content extraction engine as the Chrome extension. Ads, navigation, sidebars, and clutter are removed automatically. Site-specific parsers provide optimized extraction for GitHub, Medium, Stack Overflow, and 5 other platforms.
Yes. You can specify the template (Clean, Minimal, Corporate, Academic, Dark Mode), page size (A4, Letter, Legal, or custom dimensions), and on Pro tiers, custom headers and footers with logos and page numbers. All options are passed as JSON parameters in the request body.
API access starts with the Pro+ plan at $12/month, which includes 100 PDF generations per month. There is no free API tier, but the Chrome extension offers a free tier with 3 PDFs per month for manual use.

Get your API key and start generating PDFs

Pro+ plan includes 100 PDFs per month, all 5 templates, and smart content extraction.

Get Your API Key