GET
/api/assetsSearch the catalog with full-text relevance, media type, orientation and sorting.
Developers
A typed, read-mostly API over the catalog. Search runs on SQLite FTS5, responses are validated with Zod, and saved items are scoped to an httpOnly anonymous session.
/api/assetsSearch the catalog with full-text relevance, media type, orientation and sorting.
/api/suggestPrefix suggestions for the search combobox.
/api/savedList saved asset ids for the anonymous session.
/api/savedSave or remove an asset. Creates the session cookie on first write.
/api/healthReadiness probe with catalog size and process uptime.
/api/openapiThis contract as an OpenAPI 3.1 document.
curl -s "http://localhost:3000/api/assets?q=autumn&type=image&pageSize=6" \
-H "accept: application/json"{
"items": [
{
"id": "woman",
"slug": "portrait-in-autumn-light",
"title": "Portrait in autumn light",
"author": "Elise Varga",
"type": "image",
"tags": ["autumn", "people"],
"width": 900,
"height": 1200,
"premium": true
}
],
"total": 8,
"page": 1,
"pageSize": 6,
"totalPages": 2
}The first write creates a signed, httpOnly session cookie. Store it and send it with subsequent requests. No API key is required for this demo.
curl -s -X POST "http://localhost:3000/api/saved" \
-H "content-type: application/json" \
-b cookies.txt -c cookies.txt \
-d '{"assetId":"arch","action":"save"}'| Name | Type | Default | Notes |
|---|---|---|---|
q | string | — | Quoted FTS5 prefix tokens; operators are stripped. |
type | enum | all | image, vector, video, music, editorial, sound. |
orientation | enum | all | horizontal, vertical, square. |
sort | enum | relevance | relevance, popular, newest. |
page | integer | 1 | 1-based; capped at 100. |
pageSize | integer | 24 | 1–48. |