Learnitas API

Everything in this archive — 50 language notes, 371 computer science term notes, and 206 notes across standalone subjects like founders, finance, physics, chemistry, and electrical engineering — is already public, static content. These three endpoints just expose it as structured JSON instead of HTML, so a script, tool, or AI agent can read the vault directly instead of scraping rendered pages. Read-only, no API key, no account.

GET /api/v1/notes.json

Every note in the vault, with its route and light metadata. No query parameters.

curl https://learnitas.example/api/v1/notes.json
{
  "count": 425,
  "notes": [
    {
      "route": "/languages/python",
      "title": "Python",
      "collection": "languages",
      "category": "Scripting/Dynamic",
      "tags": [...],
      "summary": "A high-level, interpreted, general-purpose language..."
    },
    {
      "route": "/terms/full-stack/rest-api",
      "title": "REST API",
      "collection": "terms",
      "domain": "Full-Stack",
      "tags": [...],
      "summary": "..."
    }
  ]
}

GET /api/v1/notes/{route}.json

One note's full content, including its raw markdown body (with [[wikilinks]]already resolved to real routes). The path mirrors the site's own URLs — take any page route and append .json under /api/v1/notes.

curl https://learnitas.example/api/v1/notes/languages/python.json
curl https://learnitas.example/api/v1/notes/terms/full-stack/rest-api.json
{
  "route": "/languages/python",
  "title": "Python",
  "collection": "languages",
  "domain": "Programming Languages",
  "category": "Scripting/Dynamic",
  "tags": [...],
  "summary": "...",
  "markdown": "**Definition:** ...\n\n## How It Works\n..."
}

GET /api/v1/search.json?q={query}

Matches against note titles, summaries, and tags — not a full-text body search. (This deliberately isn't a wrapper around the site's own Pagefindindex: that index is built for the browser after the production build, not for a server function to query at request time. Good enough for "find notes about X"; read a note's own markdown field via the endpoint above for real content.)

curl "https://learnitas.example/api/v1/search.json?q=rest+api"
{
  "query": "rest api",
  "count": 3,
  "results": [
    { "route": "/terms/full-stack/rest-api", "title": "REST API", "summary": "..." },
    ...
  ]
}

Rate limits

60 requests per minute per IP, tracked in memory on whichever server instance handles the request — best-effort, not a hard distributed guarantee (see theX-RateLimit-Remaining response header). Exceeding it returns429 with a Retry-After header. No API key exists today; one may get added later if this needs tightening, not before.

CORS

All three endpoints send Access-Control-Allow-Origin: * — call them directly from browser JavaScript on any origin, not just server-side.