Getting Started

Send HTML, a URL, or a stored template, get back a signed download link to your PDF.

Quick Example

const response = await fetch('https://convert.pdfshot.com/convert', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    html: '<h1>Hello World</h1>',
    options: { format: 'A4' }
  })
})

const { url } = await response.json()

Response:

{
  "success": true,
  "url": "https://pdf.pdfshot.com/abc123...",
  "expiresAt": "2025-01-01T13:00:00.000Z"
}

How It Works

  1. Send a request with HTML content, a URL, or a template ID
  2. PDFShot renders the page to PDF
  3. Get a signed URL to download your PDF (valid for 1 hour)

Using Templates

For repeated documents like invoices, create a template in your Dashboard, then render with variables:

const response = await fetch('https://convert.pdfshot.com/convert', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    templateId: 'your-template-id',
    variables: {
      customerName: 'Acme Corp',
      invoiceNumber: 'INV-001',
      total: 125.00
    }
  })
})

const { url } = await response.json()

Templates use Handlebars syntax for variable substitution. See the Templates Guide for more details.

Get Your API Key

  1. Sign up for a free account
  2. Go to your Dashboard
  3. Create a new API key
  4. Copy the key (you'll only see it once)
The free tier includes 5 render minutes per month. That's roughly 150 typical single-page documents.

Base URL

All API requests go to:

https://convert.pdfshot.com

Next Steps