SnapCode API
Programmatic code screenshots. Fast, customizable, API-first.
Carbon-style Endpoint
Familiar with Carbon.now.sh? Use the same query parameter style:
GET /api/carbon?code=...&theme=dracula&lang=javascriptSupports the same theme names and parameter conventions as Carbon.now.sh.
POST /api/screenshot
curl -X POST https://snapcode.io/api/screenshot \
-H "Content-Type: application/json" \
-d '{\
"code": "console.log(\"Hello World\")",\
"language": "javascript",\
"theme": "dracula",\
"template": "twitter",\
"format": "png"\
}'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | string | required | Source code to render (max 10,000 chars) |
| language | string | optional | Syntax highlighting language. Default: javascript |
| theme | string | optional | One of 28 themes. Default: dracula |
| template | string | optional | Size preset: twitter / blog / square / wide / carbon. Default: twitter |
| format | string | optional | png / svg / jpeg. Default: png |
| windowChrome | string | optional | mac / win / none. Default: mac |
| background | string | optional | gradient / solid / transparent. Default: gradient |
| watermark | boolean | optional | Free tier always true. Pro+ can disable |
| width | number | optional | Custom width (overrides preset) |
| height | number | optional | Custom height (overrides preset) |
Response
{
"url": "https://cdn.snapcode.io/abc123.png",
"cacheHit": false,
"durationMs": 245,
"size": 42100
}Features
Currently Available
- ✓REST API with JSON parameters
- ✓SVG fast path (< 500ms typical)
- ✓PNG / JPEG via Puppeteer pool
- ✓28 syntax highlighting themes (Shiki engine)
- ✓6 size presets + custom dimensions
- ✓3 window styles (macOS / Windows / None)
- ✓3 backgrounds (gradient / solid / transparent)
- ✓Content-hash deduplication + CDN caching
- ✓Carbon-style query parameter API
- ✓JWT authentication + session management
- ✓Polar.sh subscription + webhook handling
- ✓GDPR data export / account deletion
Coming Soon
- ◌GitHub Action — auto screenshot on PR (CIShot)
- ◌Mintlify / Docusaurus component (DocsInk)
- ◌Custom font upload
- ◌Team dashboard + shared templates
Need More?
Check the Pricing page for rate limits and subscription plans, or review our Privacy Policy and Terms of Service.