Feature Deep-Dive

Developer API — automate PDF generation

Everything the Chrome extension does, available as a REST API. Send a URL or raw HTML, get back a professionally styled PDF with content extraction, template selection, and all the same site-specific parsing. Integrate PDF generation into your applications, scripts, and CI/CD pipelines without any browser automation or headless Chrome overhead.

API access on Pro+ ($12/mo). Full docs at api.prettypdfprinter.com/docs.

Feature Deep-Dive

API endpoints

Three endpoints cover the full PDF generation workflow. Send HTML you control, point at a URL for server-side fetch, or query your document library programmatically.

POST /v1/generate

Send HTML plus options in the request body. You control the input HTML — fetch it yourself, generate it from a template engine, or capture it from a browser. The server applies content extraction, wraps it in your chosen template, and returns the PDF binary. Use this endpoint when you already have the HTML or need full control over the input.

POST /v1/generate/url

Send a URL in the request body. The server fetches the page, applies site-specific parsing and content extraction, selects your template, and returns the finished PDF. This is the simplest integration path — one HTTP call with a URL, one PDF back. Ideal for automation scripts and scheduled jobs where you do not need to preprocess the page.

GET /v1/documents

List your generated documents and access your PDF library via API. Filter results by date range, search by content, and paginate through your history. Each document record includes metadata — title, source URL, template used, page count, and file size. Use this endpoint to build dashboards, audit trails, or integrate PDF retrieval into your own application.

Feature Deep-Dive

Authentication and rate limits

API access is secured with API keys and governed by per-tier rate limits. Every request must be authenticated, and every tier has clearly defined throughput boundaries.

API key authentication

Authenticate every request by including your API key in the X-API-Key header. Generate keys from the Pretty PDF dashboard under Settings. Each key is scoped to your account and can be revoked individually without affecting your other keys. You can create multiple keys — one per application, environment, or team member — to track usage separately and limit blast radius if a key is compromised.

Rate limits by tier

Rate limits are applied per minute on a rolling window. When you exceed your limit, the API returns an HTTP 429 (Too Many Requests) response with a Retry-After header indicating how many seconds to wait before your next request. Monthly PDF quotas are tracked separately and reset on your billing cycle date.

  • Pro+ — 10 requests per minute, 100 PDFs per month. Suitable for individual developers, personal automation, and low-volume integrations.
  • API Scale — 30 requests per minute, 500 PDFs per month. Designed for teams running scheduled pipelines, CI/CD integrations, and multi-user applications.
  • Enterprise — Custom request and volume limits. Contact sales for dedicated capacity, SLA guarantees, and priority support.

Implement exponential backoff in your client code to handle 429 responses gracefully. Queue requests when approaching the per-minute limit rather than sending bursts that will be rejected.

Feature Deep-Dive

Request options

Control template selection, page size, content extraction mode, and image handling through request parameters. Every option has a sensible default so you can start with a simple request and add parameters as needed.

Parameter Type Default Description
template string clean PDF template to apply. Options: clean, minimal, corporate, academic, dark. Each template uses different typography, spacing, and color schemes optimized for its use case.
page_size string A4 Output page dimensions. Options: A4 (210 x 297 mm), Letter (8.5 x 11 in), Legal (8.5 x 14 in). Affects layout, margins, and content reflow.
capture_mode string article Content extraction mode. article: extract main content and remove clutter. full: keep the complete page. selection: render only the HTML fragment provided, no extraction.
site_type string auto Site-specific parser to use. Auto-detected from the URL when not specified. Explicit values: github, stackoverflow, medium, devto, substack, notion, reddit, confluence.
include_images boolean true Whether to include images in the PDF output. Set to false to generate a text-only document, reducing file size and generation time for image-heavy pages.
Feature Deep-Dive

Use cases

The API fits anywhere you need to turn a URL or HTML into a PDF without opening a browser. Here are four patterns that developers use most.

Automated reports

Generate weekly or monthly PDF reports from dashboards and data views. Point the API at your reporting dashboard URL on a cron schedule, and the server fetches, extracts, and renders the content into a styled PDF. Attach the result to an email, upload it to Slack, or archive it in S3 — all without spinning up a headless browser.

Documentation pipelines

Convert documentation pages to PDF on every deploy. Add a step to your GitHub Actions or GitLab CI pipeline that calls the API for each documentation URL and commits the generated PDFs to your release artifacts. Keep offline-readable copies of your docs in sync with every release without maintaining a separate PDF toolchain.

Content archival

Scheduled crawl and PDF generation for compliance and records retention. Feed a list of URLs to the API on a recurring schedule to produce timestamped PDF snapshots. Useful for regulatory compliance, legal evidence preservation, and organizational knowledge management where you need to prove what a page looked like at a specific point in time.

Test evidence

Capture page states on test failure for QA reports. When an end-to-end test fails, call the API with the page HTML or URL to generate a PDF snapshot of the failing state. Attach the PDF to your test report for visual context that persists after the test environment is torn down. No screenshots to manage — the PDF preserves full text, links, and layout.

Frequently asked questions about the developer API

The API uses API key authentication. Include your key in the X-API-Key header with every request. You can generate and manage API keys from your Pretty PDF dashboard. Each key is scoped to your account and inherits the rate limits of your subscription tier. Keys can be revoked at any time from the dashboard without affecting your other keys.
Yes. Include the template parameter in your request body with one of the five available template names: clean, minimal, corporate, academic, or dark. If you omit the template parameter, the API defaults to your profile's preferred template. Each template applies different typography, spacing, and color schemes to the generated PDF, so you can match the output style to your use case — corporate for business reports, academic for research papers, dark for developer documentation.
Yes. The API applies the same content extraction pipeline used by the Chrome extension. When you send HTML or a URL, the server runs site-specific parsing for 8 supported platforms (GitHub, Medium, Stack Overflow, Notion, Dev.to, Substack, Reddit, Confluence) and trafilatura-based extraction for all other sites. Ads, navigation, cookie banners, and other clutter are removed automatically. You can control extraction behavior with the capture_mode parameter — set it to article for extraction, full for the complete page, or selection if you are sending a pre-selected HTML fragment.
The API returns an HTTP 429 (Too Many Requests) response with a Retry-After header indicating how many seconds to wait before sending the next request. Rate limits are applied per minute and reset on a rolling window. Pro+ accounts are limited to 10 requests per minute and 100 PDFs per month. API Scale accounts get 30 requests per minute and 500 PDFs per month. Enterprise accounts receive custom limits. If you consistently hit rate limits, consider upgrading your plan or implementing request queuing in your application.
Yes. The POST /v1/generate endpoint accepts any HTML in the html field. You can send HTML you have generated from a template engine, built from data, or assembled from any source. The content extraction and template styling will be applied to your HTML just as they would be to a captured webpage. If you want to skip content extraction and render your HTML exactly as provided, set capture_mode to full. This is useful when you are generating reports, invoices, or other documents where every element in your HTML is intentional.

Get your API key and start generating PDFs

One HTTP call. One styled PDF. No browser automation, no headless Chrome, no maintenance overhead.

Get your API key