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=javascript

Supports 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

ParameterTypeRequiredDescription
codestringrequiredSource code to render (max 10,000 chars)
languagestringoptionalSyntax highlighting language. Default: javascript
themestringoptionalOne of 28 themes. Default: dracula
templatestringoptionalSize preset: twitter / blog / square / wide / carbon. Default: twitter
formatstringoptionalpng / svg / jpeg. Default: png
windowChromestringoptionalmac / win / none. Default: mac
backgroundstringoptionalgradient / solid / transparent. Default: gradient
watermarkbooleanoptionalFree tier always true. Pro+ can disable
widthnumberoptionalCustom width (overrides preset)
heightnumberoptionalCustom 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.