Generate PDF documents from any web page.
Basic PDF
curl -X POST https://api.snapopa.com/capture \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "pdf"
}'
const response = await fetch('https://api.snapopa.com/capture', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com',
format: 'pdf',
}),
});
const data = await response.json();
console.log(data.data.fileUrl);
import requests
response = requests.post(
'https://api.snapopa.com/capture',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'url': 'https://example.com',
'format': 'pdf',
}
)
data = response.json()
print(data['data']['fileUrl'])
Full Page PDF
Capture the entire scrollable page as PDF:
{
"url": "https://example.com",
"format": "pdf",
"isFullPage": true
}
PDFs with isFullPage: true will have continuous pages matching the full page height.
Download PDF Directly
Get the raw PDF file instead of a JSON response:
curl -X POST https://api.snapopa.com/capture \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"format": "pdf",
"responseType": "file"
}' \
-o document.pdf
PDF Features
- Vector text - Text is selectable and searchable
- Links preserved - Clickable links work in the PDF
- Print-ready - Suitable for printing
- Accurate rendering - Matches browser display
Use Cases
- Invoices - Generate printable invoices from web apps
- Reports - Convert dashboards to PDF reports
- Documentation - Export docs for offline reading
- Archives - Long-term document preservation
Best Practices
For best PDF results:
{
"url": "https://example.com",
"format": "pdf",
"isFullPage": true,
"waitUntil": "networkidle",
"timeout": 60000
}
- Use
isFullPage - Captures complete content
- Wait for content - Use
networkidle for dynamic pages
- Increase timeout - Complex pages need more time
- Test print styles - Check
@media print CSS