URL to PDF API for developers
The HTML to PDF service that turns any URL into a professional PDF document. Convert web pages to PDF with full browser control, custom formatting, and enterprise-grade reliability.
Send the URL Get a PDF back
1.6
secs
P95 cold response
-
loading…
99.9
%
SLA Guaranteed
Everything you need,
one API call away
Any paper size, any orientation
Generate PDFs in A0 to A6, Letter, Legal, or Tabloid. Switch between portrait and landscape with a single API parameter.
Fastest PDF generation API
Sub-second cached responses with optimized cold starts. The fastest HTML to PDF rest API with a global edge network for low latency worldwide.
Pixel-perfect margins
Custom margin control in cm, mm, or px. Fine-tune document spacing for professional reports, invoices, and compliance documentation.
Screen & print media types
Choose between screen and print CSS media types. Capture the web layout as-is or switch to print stylesheets for clean, optimized PDF output.
Full browser control
Inject CSS, execute JavaScript, click elements, scroll, and wait for selectors automate any interaction before PDF generation.
Simple REST integration
A single REST endpoint that works from any language or framework. No SDKs required just an HTTP call with your URL to convert HTML to PDF.
HTML to PDF API
in
Microlink web to PDF API delivers enterprise-grade document conversion through a developer-friendly HTML to PDF web service.
The following examples show how to use the Microlink API with CLI, cURL, JavaScript, Python, Ruby, PHP & Golang, targeting 'https://basecamp.com/shapeup/0.3-chapter-01' URL with 'pdf' API parameter:
CLI Microlink API example
microlink https://basecamp.com/shapeup/0.3-chapter-01&pdf.format=A4&pdf.margin=0.35cmcURL Microlink API example
curl -G "https://api.microlink.io" \
-d "url=https://basecamp.com/shapeup/0.3-chapter-01" \
-d "pdf.format=A4" \
-d "pdf.margin=0.35cm"JavaScript Microlink API example
import mql from '@microlink/mql'
const { data } = await mql('https://basecamp.com/shapeup/0.3-chapter-01', {
pdf: {
format: "A4",
margin: "0.35cm"
}
})Python Microlink API example
import requests
url = "https://api.microlink.io/"
querystring = {
"url": "https://basecamp.com/shapeup/0.3-chapter-01",
"pdf.format": "A4",
"pdf.margin": "0.35cm"
}
response = requests.get(url, params=querystring)
print(response.json())Ruby Microlink API example
require 'uri'
require 'net/http'
base_url = "https://api.microlink.io/"
params = {
url: "https://basecamp.com/shapeup/0.3-chapter-01",
pdf.format: "A4",
pdf.margin: "0.35cm"
}
uri = URI(base_url)
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
response = http.request(request)
puts response.bodyPHP Microlink API example
<?php
$baseUrl = "https://api.microlink.io/";
$params = [
"url" => "https://basecamp.com/shapeup/0.3-chapter-01",
"pdf.format" => "A4",
"pdf.margin" => "0.35cm"
];
$query = http_build_query($params);
$url = $baseUrl . '?' . $query;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET"
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #: " . $err;
} else {
echo $response;
}Golang Microlink API example
package main
import (
"fmt"
"net/http"
"net/url"
"io"
)
func main() {
baseURL := "https://api.microlink.io"
u, err := url.Parse(baseURL)
if err != nil {
panic(err)
}
q := u.Query()
q.Set("url", "https://basecamp.com/shapeup/0.3-chapter-01")
q.Set("pdf.format", "A4")
q.Set("pdf.margin", "0.35cm")
u.RawQuery = q.Encode()
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
panic(err)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}import mql from '@microlink/mql'
const { data } = await mql('https://basecamp.com/shapeup/0.3-chapter-01', {
pdf: {
format: "A4",
margin: "0.35cm"
}
})Last month usage
641M
reqs per month
7%
cache hit rate
14TB
data served
some clients
Start free, scale when ready
No login required. No credit card needed. URL to PDF API free to use just start calling it.
Free
$0
/month
Free HTML to PDF API 50 requests/day, no login, no credit card.
PDF generation
Custom paper sizes & margins
Screenshots, metadata, and more
CSS & JS injection
Full browser control
Pro
€39
/month
46,000 requests/month for production PDF workflows.
Built on open source,
trusted by developers
The Microlink PDF engine is powered by battle-tested open source libraries used by thousands of developers worldwide. Our HTML to PDF API open source foundation means you can explore the code, contribute, or run it yourself.
Try it live, right now
Skip the setup. Our interactive website to PDF tool lets you test the PDF API instantly paste any URL, configure options, and download the result in real time.
The fastest URL to PDF API built for production workloads
Optimized Chromium infrastructure with global edge caching.
From cold start to document delivery, Microlink converts HTML to PDF faster than any alternative.
From cold start to document delivery, Microlink converts HTML to PDF faster than any alternative.
The best HTML to PDF API, with no compromises.
No more servers to maintain, load balancers, or paying for capacity you don't use our HTML to PDF service API lets you spend more time building, less time configuring, with easy integration via web to PDF API.
Enterprise-Grade Reliability
Production-ready HTML to PDF service at scale. Handle millions of documents with 99.9% uptime SLA and guaranteed performance for business-critical workflows.
Generous Free Tier
Start converting URLs to PDF immediately. No setup fees, no credit card required, and pay-as-you-grow pricing that scales with your document generation needs.
Global Edge Delivery
PDFs are cached and distributed across 240+ edge locations powered by Cloudflare, ensuring lightning-fast document delivery worldwide.
Language-Agnostic REST API
A single REST endpoint for our web to PDF API. Integrate in minutes using official SDKs for Node.js, Python, Ruby, and Go, or standard HTTP requests.
Full Headless Browser Control
Complete Puppeteer and Playwright capabilities. Configure custom viewports, JavaScript execution, CSS injection, and page interaction natively before PDF generation.
Custom Paper & Layout
Full control over paper sizes (A0-A6, Letter, Legal, Tabloid), orientation, margins, scaling, and page ranges for pixel-perfect document output.
Smart TTL Caching
Configure Time-To-Live caching rules to keep your PDFs fresh. Stay up to date with website changes while maintaining sub-second API performance.
Optimized Document Output
Our URL to PDF API generates optimized documents with configurable formatting. Perfect for reports, invoices, contracts, and compliance documentation.
Zero-Config Integration
Interactive documentation packed with live code examples. Copy-paste ready snippets allow you to bypass complex infrastructure setup and ship to production faster.
Enterprise-Grade Reliability
Production-ready HTML to PDF service at scale. Handle millions of documents with 99.9% uptime SLA and guaranteed performance for business-critical workflows.Generous Free Tier
Start converting URLs to PDF immediately. No setup fees, no credit card required, and pay-as-you-grow pricing that scales with your document generation needs.Global Edge Delivery
PDFs are cached and distributed across 240+ edge locations powered by Cloudflare, ensuring lightning-fast document delivery worldwide.
Language-Agnostic REST API
A single REST endpoint for our web to PDF API. Integrate in minutes using official SDKs for Node.js, Python, Ruby, and Go, or standard HTTP requests.Full Headless Browser Control
Complete Puppeteer and Playwright capabilities. Configure custom viewports, JavaScript execution, CSS injection, and page interaction natively before PDF generation.Custom Paper & Layout
Full control over paper sizes (A0-A6, Letter, Legal, Tabloid), orientation, margins, scaling, and page ranges for pixel-perfect document output.
Smart TTL Caching
Configure Time-To-Live caching rules to keep your PDFs fresh. Stay up to date with website changes while maintaining sub-second API performance.Optimized Document Output
Our URL to PDF API generates optimized documents with configurable formatting. Perfect for reports, invoices, contracts, and compliance documentation.Zero-Config Integration
Interactive documentation packed with live code examples. Copy-paste ready snippets allow you to bypass complex infrastructure setup and ship to production faster.
Start now
Get 50 requests/day with zero commitment convert HTML to PDF API free to use, no account, and no credit card. Just call the API and start generating PDFs in seconds.
No login needed
50 reqs/day free
No credit card
Product Information
Everything you need to know about
Microlink HTML to PDF API.
Do I need to manage my own Headless Chrome instances?
No. Microlink acts as a fully managed, "backendless" browser service. We maintain the underlying Chromium infrastructure, manage the instance pool, and handle edge caching.
You simply make a REST API call and receive a structured JSON payload or a PDF document directly the easiest way to convert any URL to PDF without maintaining
Puppeteer
or Playwright
on your own servers.Is there a free tier for the HTML to PDF API?
Yes. Our free HTML to PDF API tier provides 50 requests per day with unrestricted access to all document generation features, including custom paper sizes, margin controls, and CSS injection.
No credit card, account creation, or API key is required to start developing. Try it instantly in the PDF playground or point your code at the endpoint and begin converting.
What paper sizes and formats are supported?
Our URL to PDF API supports all standard paper formats: A0 through A6, Letter, Legal, and Tabloid. You can switch between portrait and landscape orientation with a single parameter.
Fine-tune margins in cm, mm, or px, set custom scaling, and extract specific page ranges for precise document output.
Can I interact with the DOM or run scripts before generating the PDF?
Absolutely. Our web to PDF API provides complete browser control. You can execute arbitrary JavaScript via our functions integration, or use native parameters for page preparation scroll, click, wait for selectors, and inject custom CSS before PDF generation.
It is built to handle complex, dynamic SPA rendering and produce pixel-perfect PDF documents from any web content.
What is your uptime SLA and expected latency?
We guarantee enterprise-grade reliability with a 99.9% uptime SLA. Every request runs in an isolated browser instance to guarantee security and avoid shared-state leaks. Check real-time availability on the status page. Need to generate PDFs from authenticated pages? We support that too.
For latency: PDFs are distributed via Cloudflare's 240+ edge locations, meaning cached responses are delivered in milliseconds. Our optimized Chromium pool handles cold starts efficiently for consistent performance. See our troubleshooting guide for common questions.
What output options are available?
You can generate PDFs in any paper format with configurable margins, orientation, and scaling. Page ranges let you extract exactly the content you need.
You can request a direct PDF binary via the embed parameter, or a JSON payload that includes the PDF URL alongside metadata and performance timings. Need screenshots too? Our API also supports screenshot capture.
How quickly can I integrate this HTML to PDF service into my stack?
In minutes. Visit our documentation for interactive playground examples, official SDKs (Node.js, Python, Ruby, Go), and copy-paste code snippets for any language.
Need architectural advice or have custom requirements? Check our enterprise offering or contact our engineering team at
[email protected]
.
