Public API
Fetch John Snow Code snippets via REST API. Read only, no API key, and open CORS.
BASE URL
https://johnsnow-snippet.vercel.appGET
/api/v1/snippetsSnippet List
Fetch the latest snippets. Filter by search, category, language, tag, limit up to 50, and offset.
curl "https://johnsnow-snippet.vercel.app/api/v1/snippets?limit=10&language=javascript"
GET
/api/v1/snippets/:slugSnippet Detail
Fetch a single snippet complete with its code content.
curl "https://johnsnow-snippet.vercel.app/api/v1/snippets/example-slug"
GET
/api/v1/snippets/:slug/rawRaw Code
Code content as plain text. Add download=1 to download it directly as a file.
curl "https://johnsnow-snippet.vercel.app/api/v1/snippets/example-slug/raw?download=1" -o snippet.js
PAGE
/embed/:slugEmbed Widget
Display the snippet on a blog or website via iframe. The Embed button is also available on the code detail page.
<iframe src="https://johnsnow-snippet.vercel.app/embed/example-slug" width="100%" height="420" style="border:0" loading="lazy"></iframe>