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/v1

Authentication

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.

PlanRate LimitMonthly Quota
Free10 requests / min100 PDFs
Pro100 requests / min10,000 PDFs
EnterpriseCustomUnlimited

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

OptionTypeDescription
formatstringPaper format. Options: `Letter`, `Legal`, `Tabloid`, `Ledger`, `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`. Default: `A4`.
landscapebooleanPaper orientation. `true` for landscape, `false` for portrait. Default: `false`.
printBackgroundbooleanPrint background graphics. Default: `true`.
scalenumberScale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.
marginobjectPaper margins. Defaults to `1cm` on all sides. Units: `px`, `in`, `cm`, `mm`.