RapidPDF API Documentation

Use RapidPDF to generate PDF files from HTML content or public URLs. This page covers the core integration flow and API reference for production use.

Base URL

https://api.rapidpdfapp.com/api/v1

Quickstart

  1. Create an account and generate an API key from your dashboard.
  2. Send a x-api-key header with your requests.
  3. Call POST /generate with either htmlContent or url.
  4. Read the returned signed url to view/download the PDF.
Code Examplebash
curl -X POST "https://api.rapidpdfapp.com/api/v1/generate" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "htmlContent":"<h1>Hello from RapidPDF</h1>",
    "pdfOptions":{"format":"A4","printBackground":true}
  }'

Authentication

Authenticate all API calls with your API key:

Code Examplebash
x-api-key: YOUR_API_KEY

Keep API keys server-side and rotate them if exposed.

Endpoints

POST/generate

Generates a PDF from HTML content or a public URL.

GET/health

Returns service health status (and may return 503 when dependencies are unavailable).

Request Schema

Provide exactly one source: htmlContent or url.

Code Examplejson
{
  "htmlContent": "<html><body><h1>Invoice</h1></body></html>",
  "url": "https://example.com/invoice/123",
  "pdfOptions": {
    "format": "A4",
    "landscape": false,
    "printBackground": true,
    "scale": 1,
    "margin": {
      "top": "1cm",
      "right": "1cm",
      "bottom": "1cm",
      "left": "1cm"
    },
    "media": "screen",
    "width": "8.27in",
    "height": "11.69in"
  }
}

Response Schema

Code Examplejson
{
  "success": true,
  "data": {
    "id": "1737048457123.pdf",
    "url": "https://signed-url-to-pdf",
    "expiresAt": "2026-01-17T09:24:17.123Z",
    "size_bytes": 248932
  }
}

Error Handling

StatusMeaning
400Invalid request payload.
401Missing or invalid API key.
422Missing/invalid input content.
429Rate limit exceeded.
500Internal server error.
503Service/dependency unavailable.
Code Examplejson
{
  "success": false,
  "message": "Too Many Requests",
  "retryAfter": 42
}

Rate Limits

Handle throttling gracefully using response headers:

HeaderDescription
RateLimit-LimitRequests allowed in current window.
X-RateLimit-RemainingRequests remaining.
X-RateLimit-ResetReset time (Unix ms timestamp).

PDF Options Reference

OptionTypeDefaultNotes
formatstringA4A4, A3, Letter, Legal, etc.
landscapebooleanfalseLandscape orientation.
printBackgroundbooleanfalseInclude CSS backgrounds.
scalenumber1Typical range 0.1 to 2.
marginobject1cmtop/right/bottom/left with units.
mediastringscreenUse print for print CSS.
width / heightstringCustom page size values.

Interactive Demo

Run sample API requests directly from the browser.

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)