The 1-line version
curl "https://api.aisnapapi.com/v1/screenshot?url=https://example.com&format=pdf" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o page.pdf
That's the whole API. Set format=pdf and the response body is the binary PDF.
Common use cases
- Invoices and receipts. Render an HTML invoice template on your own domain, then convert to PDF for email or download. Web fonts and CSS keep your invoices on-brand.
- Reports and dashboards. Convert a live dashboard into a shareable PDF report — useful for scheduled email reports or compliance archives.
- Web archiving. Snapshot a news article, support thread, or regulatory document as a permanent PDF record.
- Long-form content export. Let users download a blog post or knowledge-base article as a PDF — without writing a print stylesheet.
- Legal evidence. Time-stamped, immutable copies of web pages for legal or regulatory review.
Generating PDFs from JavaScript apps
The API renders pages in a real Chromium browser, so client-side JavaScript executes before the PDF is generated. If your dashboard or report renders charts asynchronously, add a delay parameter to wait for them:
curl "https://api.aisnapapi.com/v1/screenshot?url=https://app.example.com/report/42&format=pdf&delay=2000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o report.pdf
Node.js: build an invoice PDF endpoint
import express from 'express';
const app = express();
app.get('/invoice/:id.pdf', async (req, res) => {
// Your own server renders the invoice as HTML at /invoice/123
const target = `https://yourdomain.com/invoice/${req.params.id}`;
const r = await fetch(
`https://api.aisnapapi.com/v1/screenshot?url=${encodeURIComponent(target)}&format=pdf`,
{ headers: { Authorization: `Bearer ${process.env.SNAPAPI_KEY}` } }
);
res.type('application/pdf');
r.body.pipe(res);
});
Python: save a PDF of any URL
import requests
r = requests.get(
'https://api.aisnapapi.com/v1/screenshot',
params={'url': 'https://en.wikipedia.org/wiki/PDF', 'format': 'pdf'},
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
open('pdf-article.pdf', 'wb').write(r.content)
Tips for clean PDFs
- Use a print stylesheet. Add
@media print rules in your HTML to hide nav, ads, or sidebars when the page is rendered as PDF.
- Hide cookie banners. Pass a
css parameter to inject CSS that hides the banner before the PDF is captured.
- Wait for late content. If charts or images load asynchronously, add
delay=1500 or higher.
- Use predictable URLs. Render the PDF source on your own server, then let aiSnapApi take the snapshot. You'll always know what's on the page.