One POST returns the document.
PDF rendering uses the JSON endpoint. The response body is the PDF itself, so the same request works from a job runner, backend route, workflow platform, or scheduled report.
curl --fail-with-body https://latchshot.fly.dev/v1/render \
-H "Authorization: Bearer $LATCHSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"url": "https://example.com",
"kind": "pdf",
"paper": "A4",
"landscape": false,
"delay": 250
}' \
--output example.pdf
On success, the response uses application/pdf. Timing, navigation, font fallback, script fallback, and quota information remain in the response headers.
Store the Bearer key in your platform’s secret manager. The Free plan shows the key once and stores only its hash.
Choose the paper contract first.
Paper and orientation should be explicit in code. Leaving them implicit makes a layout look correct on one machine and paginate differently when a browser default changes.
| Option | Values | Default |
|---|---|---|
paper | A4, Letter, Legal | A4 |
landscape | true or false | false |
delay | 0–3000 milliseconds | 0 |
timeout | 3000–30000 milliseconds | 15000 |
waitUntil | load, domcontentloaded, networkidle | domcontentloaded |
Latchshot does not currently accept raw HTML, custom margins, header/footer templates, or arbitrary page scripts. It renders a public URL into the selected paper size.
Prepare the page for print.
The API can stabilize a browser process, but the source page still owns pagination. For reports you control, add a print stylesheet and test it with realistic content lengths.
@media print {
nav, .screen-only { display: none; }
article { max-width: none; }
h2, h3 { break-after: avoid; }
figure, table { break-inside: avoid; }
}
- Keep essential content in the document flow rather than a scrollable panel.
- Avoid fixed-height containers that clip dynamic text.
- Prevent headings from becoming the final line of a page.
- Test long tables and user-generated text, not only the ideal sample.
Bound retries and record diagnostics.
Treat 400 and 401 as permanent. Retry 429, 502, 503, and 504 only with a strict attempt limit and backoff. A failed direct render does not consume quota, but an unbounded retry loop still creates latency and support work.
For scheduled documents, read GET /v1/usage before the job and keep the previous successful PDF if a new capture fails. The scheduled-report recipe includes a bounded operating pattern.
Public documents, not private sessions.
Latchshot blocks private and special-use network targets and does not accept cookies, credentials, or browser automation scripts. That is useful for public invoices, reports, dashboards, documentation, and certificates that already have a safe public render URL.
It is not the right endpoint for an internal admin page, a logged-in customer account, or a PDF that requires session state. Keep those documents inside your own authenticated rendering boundary.
Only successful documents consume quota.
The same plans cover screenshots and PDFs: Launch is $19 for 2,500 successful renders, Build is $49 for 12,000, and Scale is $149 for 50,000. Automatic overages are off during private beta.
Start with 100 free renders each UTC calendar month, compare real PDFs against the current workflow, and inspect the response diagnostics before moving scheduled production jobs.
Need images instead?
Use the query-string endpoint for a simple PNG or JPEG, or the JSON endpoint for bounded capture controls.