@manzxy
Developer & maintainer of SnippetHub — platform snippet code open untuk komunitas developer Indonesia.
Ada pertanyaan, laporan bug, atau mau kolaborasi? Reach out lewat salah satu kontak di bawah.
Semua endpoint tersedia untuk scraping dan integrasi. Base URL: /api
snippet_key_hash.
curl https://your-domain.vercel.app/api/snippets
const res = await fetch('/api/snippets'); const snippets = await res.json(); console.log(snippets);
[
{
"id": 1,
"created_at": "2026-01-15T10:00:00Z",
"author": "devuser",
"title": "Fetch + Retry",
"description": "Wrapper fetch dengan auto-retry",
"language": "JavaScript",
"tags": ["fetch", "async"],
"code": "async function fetchWithRetry...",
"likes": 12,
"views": 87
}
]
"like", "unlike", atau "view"await fetch('/api/snippets', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'like', id: 1 }) });
{ "likes": 13 } // atau "views" untuk action view
"fetch, async, api"import requests payload = { 'author': 'devuser', 'title': 'Hello World', 'description': 'Contoh snippet', 'language': 'Python', 'tags': 'hello, contoh', 'code': 'print("Hello, World!")', 'snippetKey': 'mykey1' } res = requests.post('https://your-domain.vercel.app/api/snippet-create', json=payload) print(res.json())
{ "ok": true }
{ "ok": true }
curl -X DELETE https://your-domain.vercel.app/api/snippet-action \ -H 'Content-Type: application/json' \ -d '{"id": 1, "snippetKey": "mykey1"}'
{ "ok": true }