REST API v1
API Documentation
Every PDF tool available as a REST endpoint. Get started with 1,000 free API calls per month.
Authentication
Use API keys via X-API-Key header. Create keys in the dashboard.
File Upload
Send files via multipart/form-data. Max 100MB per file (Pro plan).
Webhooks
Get notified when async operations complete. Configure in dashboard.
Quick Start
# 1. Get your API key from the dashboard # 2. Make your first request: curl -X POST https://pdf.yantra.tools/api/v1/pdf/merge \ -H "X-API-Key: ypdf_live_sk_your_key_here" \ -F "files[][email protected]" \ -F "files[][email protected]" # Response: # { # "success": true, # "document": { # "id": "doc_abc123", # "download_url": "https://pdf.yantra.tools/dl/...", # "pages": 42, # "size_bytes": 2457600 # } # }
All Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/pdf/merge | Merge multiple PDFs |
| POST | /api/v1/pdf/split | Split PDF by pages |
| POST | /api/v1/pdf/compress | Compress PDF |
| POST | /api/v1/pdf/convert | Convert file to PDF |
| POST | /api/v1/pdf/convert/html | Convert HTML to PDF |
| POST | /api/v1/pdf/convert/url | Convert URL to PDF |
| POST | /api/v1/pdf/export | Export PDF to other format |
| POST | /api/v1/pdf/ocr | OCR scanned PDF |
| POST | /api/v1/pdf/watermark | Add watermark |
| POST | /api/v1/pdf/rotate | Rotate pages |
| POST | /api/v1/pdf/page-numbers | Add page numbers |
| POST | /api/v1/pdf/metadata | Read/write metadata |
| POST | /api/v1/pdf/flatten | Flatten forms/annotations |
| POST | /api/v1/pdf/protect | Password protect |
| POST | /api/v1/pdf/unlock | Remove password |
| POST | /api/v1/pdf/compress | Compress/optimize |
| POST | /api/v1/pdf/repair | Repair damaged PDF |
| POST | /api/v1/pdf/extract/text | Extract text |
| POST | /api/v1/pdf/extract/metadata | Extract metadata |
| POST | /api/v1/documents | Upload document |
| GET | /api/v1/documents | List documents |
| GET | /api/v1/documents/:id | Get document info |
| GET | /api/v1/documents/:id/download | Download document |
| DELETE | /api/v1/documents/:id | Delete document |
Interactive API explorer available at the API server
Open Swagger UI