OpenAPI 3.1 Reference
learnalgorithms.dev API
Privacy-preserving REST API written with the Python standard library and SQLite. Stores no personal data or IP addresses. Click any endpoint below to inspect its schema or try live public requests.
Public endpoints
GET/healthLiveness check
Returns 200 OK when the API container is healthy and ready to serve requests.
curl -i https://api.learnalgorithms.dev/health
GET/popularMost read lessons of the last 7 days
Fetched server-to-server from Matomo and cached in memory for 15 minutes. Degrades gracefully to an empty list if Matomo is unreachable.
curl -i https://api.learnalgorithms.dev/popular
GET/feedback/summaryAggregated helpfulness votes for one lesson
Query parameter: page (e.g. /concepts/sorting/quicksort). Rate-limited per IP.
curl -i "https://api.learnalgorithms.dev/feedback/summary?page=/concepts/sorting/quicksort"
POST/feedbackSubmit anonymous lesson feedbackOrigin: learnalgorithms.dev
Stores a helpful/not-helpful vote with an optional comment (max 500 chars). Protected against bots with a honeypot field, minimum time on page (1 s), and one row per page, client, and day (same-day vote/comment updates allowed).
{
"page": "/concepts/sorting/quicksort",
"helpful": true,
"comment": "The partition trace made it click!",
"elapsed": 12000,
"website": "",
"client": "11111111-1111-4111-8111-111111111111"
}POST/eventsRecord anonymous student/usage telemetry eventsOrigin: learnalgorithms.dev
Accepts a single event or a batch (max 20 events, 4 KB body). Allowed eventType values: page_view, page_leave, lesson_complete, lesson_uncomplete, cheat_sheet_filter, cheat_sheet_compare, visualizer_interact, search, details_open, resource_click, web_vitals.
{
"events": [
{
"sessionId": "11111111-1111-4111-8111-111111111111",
"eventType": "page_leave",
"page": "/concepts/sorting/quicksort",
"durationMs": 45000,
"scrollPct": 85
}
]
}POST/surveySubmit anonymous course satisfaction survey (1–5)Origin: learnalgorithms.dev
Records four 1–5 ratings (clarity, usefulness, tools, overall) plus an optional comment. One updatable row per client and day; no personal data or IPs stored.
{
"clarity": 5,
"usefulness": 5,
"tools": 4,
"overall": 5,
"comment": "The Cheat Sheet and Knowledge Graph are super useful.",
"elapsed": 8000,
"website": ""
}POST/questionsAsk an anonymous private questionOrigin: learnalgorithms.dev
Stores a question (up to 2,000 characters) with no account, contact data or IP, and returns a one-time ticket. Only a SHA-256 hash of the ticket is stored. Questions are never sent to the external LLM.
{
"page": "/concepts/sorting/quicksort",
"question": "Why is the pivot swapped at the end of the partition?",
"elapsed": 8000,
"website": ""
}POST/questions/statusCheck the answers of your ticketsOrigin: learnalgorithms.dev
Up to 20 tickets, kept in the asker's browser. Returns the status (pending or answered) and the answer of the known ones.
{ "tickets": ["K7Q4-MXP2-D9RT"] }Integrations & Webhooks
POST/webhooks/githubReceive GitHub issue eventsHMAC-SHA256
Verifies X-Hub-Signature-256 in constant time using GITHUB_WEBHOOK_SECRET and stores issue events idempotently by X-GitHub-Delivery.
Admin & Teaching Innovation Analytics
GET/admin/statsAggregated learning analytics summaryBearer Token
Query parameter: days (1–365, default 30). Returns totals (events, sessions, activeDays), events by type, top pages with average duration and scroll depth, lesson completions, and daily activity.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/stats?days=30"
GET/admin/eventsExport anonymized telemetry events (JSON or CSV)Bearer Token
Query parameters: days (1–365, default 30), limit (1–5000, default 500), format (json | csv). With format=csv downloads learnalgorithms-events.csv ready for Excel, R, SPSS, or Python.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/events?days=30&format=csv" -o learnalgorithms-events.csv
GET/admin/feedbackLatest qualitative feedback votes and commentsBearer Token
Returns the latest 200 feedback entries stored in SQLite with Cache-Control: no-store.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/feedback"
GET/admin/issuesLatest GitHub issue webhook eventsBearer Token
Returns the latest 200 GitHub issue events recorded via POST /webhooks/github.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/issues"
GET/admin/surveyAggregated course satisfaction survey resultsBearer Token
Query parameter: days (0 = all time, 1–3650, default 30). Returns total responses, 1–5 averages, score distribution, and recent comments.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/survey?days=30"
GET/admin/questionsAnonymous questions inboxBearer Token
Query parameter: status (all | pending | answered). POST /admin/questions/{id}/answer answers one privately (only the holder of the ticket sees it); DELETE /admin/questions/{id} removes it.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/questions?status=pending"
GET/admin/tasksTeacher's private to-do listBearer Token
POST /admin/tasks creates one task (or several with {"tasks": [...]}); POST /admin/tasks/{id} updates fields; DELETE /admin/tasks/{id} removes it. Fields: title, description, due (optional deadline, YYYY-MM-DD), priority (1 high, 2 medium, 3 low), done; the entry date is set automatically, and tasks done more than 10 days ago are deleted.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/tasks"
GET/admin/docs/{name}Private Markdown documents (e.g. the roadmap)Bearer Token
Returns the current content and the list of saved versions. POST /admin/docs/{name} with {"content": "..."} saves a new version (unchanged content is not duplicated; the last 100 versions are kept); GET /admin/docs/{name}/versions/{id} returns one version.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/docs/roadmap"
GET/admin/reportConsolidated ETL teaching report (JSON or Markdown)Bearer Token
Query parameters: days (0–3650, default 30), format (json | md). Consolidates telemetry, daily activity, devices, Matomo, NLP, feedback, survey, Core Web Vitals, and Green Software (SWDM).
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/report?days=30&format=md"
POST/admin/report/interpretAI-assisted pedagogical interpretation of the ETL reportBearer Token
Query parameters: days (0–3650), lang (en | es), detail (brief | detailed). Protected with OWASP LLM guardrails (PII redaction, indirect prompt-injection sanitization, dedicated rate limit).
curl -X POST -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/report/interpret?days=30&lang=en&detail=detailed"
GET/admin/metricsPrometheus text exposition metrics (0.0.4)Bearer Token
Live process uptime, HTTP request count, SQLite DB size, all-time telemetry/feedback totals, and rolling 30-day Web Vitals p95.
curl -H "Authorization: Bearer <ADMIN_TOKEN>" "https://api.learnalgorithms.dev/admin/metrics"