Skip to main content
🚀 Now Live

Generate PDFs from Google Docs via API

The simplest REST API to programmatically generate PDFs from Google Docs templates. Send JSON, receive a pixel-perfect PDF. No libraries or servers required.

Try Live Demo
Workflow

How to Generate PDFs from Google Docs via API

1
Google Docs

Create Template

Design your document in Google Docs. Use mustache syntax like {{name}} or {{invoice_id}} for dynamic fields.

2
{ "name": "..." }

Send JSON Data

Make a simple POST request to our API with the template ID and your data. We handle the variable replacement securely.

3
PDF

Receive PDF

Get back a high-quality PDF stream instantly. Save it, email it, or display it to your users directly.

Interactive Demo

Try the Google Docs to PDF API

No signup required. Paste a Google Doc ID with {{variables}} and generate a PDF.

docsrender.netlify.app/demo

Don't have one? Use the default ID above to test.

A Simple REST API for PDF Generation

Integrate PDF generation into your stack with a single REST API call. We handle the Google Docs authorization, rate limits, and PDF conversion complexity.

  • Standard JSON payload

  • Returns standard binary stream (application/pdf)

  • 99.9% Uptime SLA

Read the full documentation
POST /docs/render
curl -X POST https://docs-render-api-307616438192.europe-west1.run.app/docs/render \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice_v1",
    "variables": {
      "customer_name": "Acme Corp",
      "invoice_number": "INV-2024-001",
      "total_amount": "$500.00"
    }
  }' \
  --output result.pdf

Who Uses Our Document Automation API?

SaaS Founders

Automate invoice PDFs, receipts, and reports. Update templates without deploying code.

Automation Pros

Generate PDFs from Zapier, Make, and n8n workflows. Standard REST API with JSON input.

Agencies

Automate client reports, contracts, and proposals. Design templates in Google Docs, generate PDFs at scale.

Developers

Replace wkhtmltopdf, Puppeteer, and heavy PDF libraries with a single API call. No server-side dependencies.

Integrate the PDF Generation API in 5 Minutes

Follow these steps to start generating PDFs from Google Docs programmatically.

1

Create a Google Doc Template

Open Google Docs and create a new document. Add placeholders using double curly braces where you want dynamic data to appear.

// Example content in Google Doc
Hello {{customer_name}},

Thank you for your purchase of {{product_name}}.
Total: {{price}}
2

Get Document ID

Grab the ID from your document's URL. You'll need this for the API call.

docs.google.com/document/d/1qW1eY8eK9i8tO.../edit
3

Connect Google Account

Authenticate with Google to generate your API key and allow us to read your templates.

GET https://docs-render-api-307616438192.europe-west1.run.app/auth/google/start
x-api-key: YOUR_KEY
4

Send API Request

Make a POST request with your Template ID and the data you want to inject.

POST https://docs-render-api-307616438192.europe-west1.run.app/docs/render
Content-Type: application/json
x-api-key: YOUR_KEY

{
  "template_id": "1qW1eY8eK9i8tO...",
  "variables": {
    "customer_name": "Acme Corp",
    "price": "$999.00"
  }
}

Receive PDF

The API responds with a standard PDF file stream. Save it, upload it, or email it immediately.

PDF Generation API Pricing

Pay-as-you-go credits. No monthly subscriptions. Credits never expire.

Starter Pack

$9.99

100 Credits

  • $0.10 per PDF
  • Full API Access
Most Popular

Professional

$24.99

300 Credits

  • $0.08 per PDF
  • Priority Support
  • Never expires

Enterprise

$69.99

1000 Credits

  • $0.07 per PDF
  • Best Value