PDF Generator API
Convert any URL into PDFs. Perfect for generating invoices, reports, and archiveswith full control over layout, and styling.
Copy, paste, and ship
import requests
url = "https://api.geekflare.com/url2pdf"
payload = {"url": "https://example.com", "format": "a4"}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Why Geekflare PDF API
Layout & Formatting
Full control over page orientation and standard formats to fit your document needs.
Styling
Adjust scaling and set custom margins to ensure your data fits perfectly on the page.
Add Timestamp
Automatically overlay timestamps on your documents. Essential for archives and compliance.
Rotating Proxies
We rotate residential proxies for you to generate PDFs from worldwide location without getting blocked.
Headless Browser
We render JavaScript just like a real user so the PDF looks exactly the same as the webpage.
Global Network
Requests are routed through our global edge network to ensure low latency.
Simple, transparent pricing
Build more with Geekflare
Extract Metadata
Check Site Loadtime
Frequently Asked Questions
The generated PDF URLs are stored on our CDN for 30 days. If you need longer retention, please contact us.
PDF generation consumes 5 credits per request.
Yes, by default, we use a desktop viewport, but you can instruct the API to emulate a mobile device. This allows you to capture the responsive mobile layout of the website in your PDF.