Introduction
Welcome to the RapidPDF API documentation. Our API allows you to generate high-quality PDF documents from HTML content or URLs with a single HTTP request.
Base URL
https://api.rapidpdf.com/v1Authentication
Authenticate your requests using the `Authorization` header with your API Key.
Authorization: Bearer YOUR_API_KEY
You can generate an API key from your dashboard.
Rate Limits
Our API enforces rate limits to ensure fair usage and stability. Limits are applied per API key.
| Plan | Rate Limit | Monthly Quota |
|---|---|---|
| Free | 10 requests / min | 100 PDFs |
| Pro | 100 requests / min | 10,000 PDFs |
| Enterprise | Custom | Unlimited |
Rate limit headers (`X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`) are included in every response.
Interactive Demo
Test the API directly from your browser. If you are logged in, requests will be made using your API key.
POST /api/v1/generate
Request Body (JSON)
Response
Click "Run Request" to verify the output...
Authenticated as: Guest(Rate limited to 10 req/min. Log in for higher limits)
Endpoints
POST/generate
Generates a PDF from HTML content or a URL.
Request Body
{
"html": "<h1>Hello World</h1>",
"url": "https://example.com", // Optional, use either html or url
"format": "A4", // Optional, default: A4
"landscape": false, // Optional, default: false
"printBackground": true, // Optional, default: true
"margin": { // Optional
"top": "1cm",
"right": "1cm",
"bottom": "1cm",
"left": "1cm"
},
"scale": 1 // Optional, default: 1
}
Response
Returns the generated PDF file as a binary stream (blob) with `Content-Type: application/pdf`.
PDF Options Reference
| Option | Type | Description |
|---|---|---|
| format | string | Paper format. Options: `Letter`, `Legal`, `Tabloid`, `Ledger`, `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`. Default: `A4`. |
| landscape | boolean | Paper orientation. `true` for landscape, `false` for portrait. Default: `false`. |
| printBackground | boolean | Print background graphics. Default: `true`. |
| scale | number | Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2. |
| margin | object | Paper margins. Defaults to `1cm` on all sides. Units: `px`, `in`, `cm`, `mm`. |