惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
腾讯CDC
D
Docker
The Cloudflare Blog
量子位
爱范儿
爱范儿
L
LangChain Blog
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
Vercel News
Vercel News
MyScale Blog
MyScale Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a Code Screenshot REST API because Carbon and Ray...
The Flutter Guy · 2026-06-28 · via DEV Community

The Flutter Guy

The itch I had to scratch

Every time I wrote a technical blog post or generated docs, I needed code screenshots. I'd open Carbon, paste my snippet, tweak the theme, hit export, download the file. Repeat for every snippet. It was manual, slow, and couldn't be automated.

Carbon is beautiful. Ray.so is slick. But neither has a REST API. If you want code screenshots in a pipeline — you're on your own.

So I built SnapMyCode.

What it is

SnapMyCode is a code screenshot service with three ways to use it:

  1. Snap — paste code, pick a theme, download instantly. No account needed, unlimited quick use.
  2. Editor — visual canvas editor. Arrange multiple code snippets, customize everything, export as a single image.
  3. REST API — the real reason I built this.

The API

curl -X POST https://api.snapmycode.in/api/v1/image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code": "const greet = (name) => `Hello, ${name}!`", "theme": "tokyo-night", "language": "javascript"}' \
  --output screenshot.png

POST your code, get back a PNG. Or SVG. Or JPEG. Or WebP. 19 themes, 27 languages, line highlighting, custom font size and padding.

Why this matters for developers

  • Docs generators: auto-produce code screenshots at build time
  • Blog pipelines: never manually screenshotting code again
  • GitHub Actions: generate README screenshots on push
  • Portfolio sites: consistent code image style across all posts
  • Discord/Slack bots: share beautiful code snippets automatically
  • Content creators: automate your entire code-to-social pipeline

How it's built

The rendering stack is Playwright + Chromium on Google Cloud Run — full headless browser, not a canvas hack. This means pixel-perfect output at any resolution.

Syntax highlighting: Shiki v4 (the same library VS Code uses internally).

Backend: Fastify v5 + Node.js, TypeScript throughout. Auth: Firebase. Data: Firestore. Frontend: Next.js + Tailwind v4 on Vercel.

What makes it different vs Carbon and Ray.so

Feature SnapMyCode Carbon Ray.so
REST API
SVG export
Multi-snippet editor
Line highlighting
PNG/JPEG/WebP
19 themes
Free tier

Pricing

  • Free: 10 API renders/day + unlimited quick paste — enough to try everything
  • Pro: $9/mo — 500 renders/day
  • Enterprise: $49/mo — 1000 renders/day + priority rendering + email support

Try it

snapmycode.in — free to start, no credit card.

Curious what other devs think — especially those who've tried to automate code screenshots before. What was your workaround? Would love to hear.