API Reference
All Skrip endpoints return JSON. Errors include a { error: string } body.
List Collections
GET /api/collections
Returns all collections with item counts.
Response:
{
"collections": [
{ "name": "blog", "count": 3 },
{ "name": "docs", "count": 4 }
]
}
Get Collection
GET /api/collections/:name
Returns all items in a collection, sorted alphabetically by slug.
Response:
{
"collection": {
"name": "blog",
"count": 2,
"items": [
{
"slug": "hello-world",
"collection": "blog",
"data": { "title": "Hello World", "date": "2026-01-01" },
"content": "# Hello World\n\nThis is my first post."
}
]
}
}
Get Item
GET /api/collections/:name/:slug
Returns a single content item by collection name and slug.
Response:
{
"item": {
"slug": "hello-world",
"collection": "blog",
"data": { "title": "Hello World", "date": "2026-01-01", "published": true },
"content": "# Hello World\n\nThis is my first post.",
"raw": "---\ntitle: Hello World\n..."
}
}
404 response:
{ "error": "Item not found" }
Frontmatter
{
"title": "API Reference",
"section": "Reference",
"order": 3,
"description": "Complete reference for all Skrip API endpoints."
}API endpoint
GET /api/collections/docs/api-reference