Public API
FutureLedger's read endpoints are open and unauthenticated. Endpoints marked admin require the admin JWT and are documented here for completeness, not for public use. A few admin endpoints (outcome suggestions, the ingestion extraction step) call the Anthropic API and spend real money per request — noted individually below. All routes are prefixed with /api. This page is generated from the real backend controllers, not a separate spec — if something here is wrong, the code is the source of truth.
Search
Unified search across figures, topics, and statements.
- GET
/api/searchSearch by free text, optionally scoped to one entity type.
Query params: q (required) · type: all | figure | topic | statement (default all)
Figures
Public figures and their track record.
- GET
/api/figuresList figures.
Query params: topicId · page · pageSize
- GET
/api/figures/:slugGet one figure by slug, with stats and statements.
- GET
/api/figures/by-id/:idGet one figure by id.
- GET
/api/figures/:id/statsOverall and per-topic FigureStats rows for a figure.
- GET
/api/accuracy/figure/:idOverall accuracy, per-topic accuracy breakdown, resolved/total counts.
- GET
/api/accuracy/figure/:id/timelineAccuracy and resolved-prediction count per year (bucketed by when each outcome was resolved, not made).
- POST
/api/figures(admin)Create a figure.
- PUT
/api/figures/:id(admin)Update a figure.
- DELETE
/api/figures/:id(admin)Delete a figure.
- POST
/api/import/figures/preview(admin)Validate a batch of figures (CSV-style rows) without creating anything — returns per-row errors/resulting slugs.
- POST
/api/import/figures/commit(admin)Create the figures from a previously-previewed batch.
Topics
A two-level hierarchy: top-level categories and their sub-topics.
- GET
/api/topicsList categories with their sub-topics nested.
- GET
/api/topics/categoriesList top-level categories only.
- GET
/api/topics/difficultyEvery topic with domain difficulty, statement count, and figure count.
- GET
/api/topics/:id/subtopicsList one category's sub-topics.
- GET
/api/topics/:idGet one topic, with its figures and statements.
- GET
/api/accuracy/topic/:idDomain difficulty (mean accuracy across every figure active in this topic) and a per-figure ranking.
- POST
/api/topics(admin)Create a topic.
- PUT
/api/topics/:id(admin)Update a topic.
- DELETE
/api/topics/:id(admin)Delete a topic.
Statements & outcomes (predictions and their resolutions)
A statement is a prediction; an outcome resolves it.
- GET
/api/statementsList/filter statements.
Query params: figureId · topicId · status · predictionType · q · dateMadeFrom · dateMadeTo · page · pageSize
- GET
/api/statements/:idGet one statement, with its outcome if resolved.
- GET
/api/statements/clustersGroups of near-duplicate statements (shared topic, close dates, overlapping keywords — no AI).
- GET
/api/outcomesList outcomes.
- GET
/api/outcomes/:idGet one outcome.
- GET
/api/outcomes/:id/audit(admin)Edit history for one outcome.
- POST
/api/statements(admin)Create a statement.
- PUT
/api/statements/:id(admin)Update a statement.
- DELETE
/api/statements/:id(admin)Delete a statement.
- POST
/api/outcomes(admin)Create (resolve) an outcome.
- PUT
/api/outcomes/:id(admin)Update an outcome.
- DELETE
/api/outcomes/:id(admin)Delete an outcome.
- POST
/api/outcomes/suggest/:statementId(admin)AI-generated outcome suggestion (market data or news evidence) for one unresolved statement. Suggest-only — never writes to the database on its own. Spends real money on the Anthropic API per call.
- POST
/api/outcomes/suggest/bulk(admin)The same suggestion, for up to 20 statements in one request (processed sequentially). Each call still costs money per statement.
Query params: body: { statementIds: string[] }
Market data
A thin wrapper over Yahoo Finance’s unofficial chart endpoint — in-memory cached (1 hour). Public, no cost, no API key required.
- GET
/api/market/priceCurrent price for a ticker symbol.
Query params: symbol (required)
- GET
/api/market/historyHistorical daily closes for a symbol and date range.
Query params: symbol (required) · start (required, ISO date) · end (required, ISO date)
News
Aggregated headlines from four curated RSS feeds (WSJ, BBC, CNBC, Fox Business) — in-memory cached (30 minutes). Public, no cost.
- GET
/api/newsAll recent articles from every configured feed, flattened into one list.
Ingestion (admin tool)
Pull candidate predictions out of an article or transcript. Each step is a separate call — url/transcript are free (no LLM); extract spends real money on the Anthropic API; commit only ever matches an existing figure/topic, it never creates one.
- POST
/api/ingest/url(admin)Fetch a URL and extract clean article text via Readability. Guarded against SSRF (rejects localhost, private/link-local IPs, and the cloud metadata address, including through redirects).
Query params: body: { url: string }
- POST
/api/ingest/transcript(admin)Normalize raw transcript text — strips timestamps and bracketed stage directions like [applause], but keeps speaker labels (needed for figure attribution in the next step).
Query params: body: { text: string }
- POST
/api/ingest/extract(admin)LLM call: extract candidate predictions (figure, topic, statement text, type, market symbol, target date, confidence) from clean text. Returns at most 20 candidates; nothing is written to the database.
Query params: body: { text: string } (50–20,000 characters)
- POST
/api/ingest/commit(admin)Create real statements from up to 20 reviewed/edited candidates. Each item needs a real figureId (and optional topicId) — no auto-creation of new figures or topics. Per-item success/failure, not all-or-nothing.
Leaderboards
Ranks figures by accuracy, with optional topic and date-range filtering.
- GET
/api/leaderboardTop figures by accuracy. Adding startDate/endDate computes live from outcomes resolved in that window instead of the all-time cache.
Query params: topicId · sortBy: averageAccuracyScore | correctPredictions | resolvedPredictions · limit (max 100) · minPredictions · startDate (ISO date) · endDate (ISO date)
- GET
/api/leaderboard/rank/:figureIdOne figure's rank within the full (unlimited) sorted leaderboard.
Query params: topicId · sortBy · minPredictions
Compare
Side-by-side comparison of 2–5 figures.
- GET
/api/compare/figuresAccuracy, rank, per-topic breakdown, and recent activity for each figure.
Query params: slugs (required, comma-separated, 2–5 figures)
Homepage data
Aggregated data behind the homepage.
- GET
/api/homeTrending figures, recent predictions/resolutions, and top topics by activity.
- GET
/api/home/featuredThis week’s featured figure — deterministically picked from the trending pool by the current week number, not stored or randomly generated, so it’s stable all week and rotates on its own.
System
Infrastructure and admin-auth endpoints, documented for completeness rather than for public use.
- GET
/api/healthBasic liveness check.
- POST
/api/auth/loginAdmin login. Single hardcoded admin credential (email/password from environment variables) — there is no public user-account system yet.
Query params: body: { email: string, password: string }