Skip to content

About

Project Mirador codebase and Stelthar API

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

532 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stelthar API

Real-time, government-backed data fact-checking for a better, more transparent internet.

Install Extension β€’ Report Bug β€’ Request Feature


πŸ“’ Updates

November 19, 2025 - Project Mirador Chrome extension is now live on the Chrome Web Store!

Install: Search for "Project Mirador" on the Chrome Web Store or use the link above.


πŸ“‘ Table of Contents


🎯 About

This repository contains the codebase for Project Mirador and the Stelthar API.

Stelthar API provides real-time, government-backed data fact-checking for a better, more transparent version of the internet.

The Problem

Disinformation erodes public trust, and traditional fact-checking is slow, unreliable, or both.

The Solution

Stelthar's fact-checking API verifies claims by comparing them against official government data sources. Highlight any text, and our browser extension provides an evidence-based verdict, a confidence score, and links to the primary sources.

This reduces verification time from hours to seconds, empowering users to challenge misinformation with auditable proof.


✨ Key Features

  • Real-time claim verification against official government data sources
  • Evidence-based verdicts: Supported, Mostly accurate, Contradicted, Misleading, or Can't verify (with the reason)
  • Whole passages: highlight a paragraph or an article and every claim in it is checked on its own
  • Confidence as a tier (High, Medium or Low), never a percentage that looks more exact than it is
  • Direct links to the primary sources used for verification
  • Browser extension that checks highlighted text in a side panel, with no access to the pages you visit
  • API-first design for easy integration into apps, dashboards, and extensions

πŸ” How It Works

  1. Highlight: Select any text claim on a webpage
  2. Verify: Right-click and choose Check with Project Mirador; the answer opens in the side panel
  3. Review: Receive an instant verdict with:
    • A verdict for each claim: Supported, Mostly accurate, Contradicted, Misleading, or Can't verify
    • The official figure, how the claim was read (measure, place, period) and a confidence tier
    • Links to official government sources
    • Relevant data points used for verification

Under the Hood:

  • Your claim is sent to the Stelthar API
  • The API queries multiple government databases (Data.gov, BLS, BEA, etc.)
  • Fixed rules compare the claim with the agency's figure; a model is used only when no data series covers the claim
  • Results are returned with full source attribution

πŸš€ Getting Started

Chrome Extension

  1. Visit the Chrome Web Store
  2. Click "Add to Chrome"
  3. Pin the extension to your toolbar for easy access
  4. Highlight text on any webpage, right-click, and choose Check with Project Mirador
  5. Or click the icon (or press Cmd/Ctrl+Shift+Y) to type a claim or look up a figure

API Usage

The Stelthar API powers Project Mirador and is available for integration into your own applications.

Quick Example:

// Check every claim in a passage (call this from a server, not a web page)
fetch('https://stelthar-api.vercel.app/v2/check', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    text: "Inflation hit 9.1% in June 2022. Gas averaged $7 a gallon in June 2022."
  })
})
.then(response => response.json())
.then(data => console.log(data));

See the API Documentation section below for detailed endpoint information.


πŸ›  Tech Stack

Backend

  • Language: Python
  • Hosting: Vercel (API hosting)

Frontend

  • Languages: JavaScript, HTML, CSS
  • Platform: Chrome Extension

Data Sources

Structured (return actual numbers β€” always preferred):

  • USAspending.gov β€” federal agency budgets & obligations by fiscal year (no API key)
  • Treasury Fiscal Data β€” national debt / public debt outstanding (no API key)
  • Bureau of Economic Analysis (BEA) β€” GDP, personal income, government receipts & expenditures by function, trade (12 NIPA tables)
  • Bureau of Labor Statistics (BLS) β€” unemployment, CPI, core CPI, PPI, labor force participation, employment level, average hourly earnings
  • U.S. Census Bureau (ACS) β€” population, income, poverty, age, home value, education, insurance coverage, by state or nationally

Keyword search (return dataset descriptions, not values β€” supplement only):

  • Data.gov catalog
  • Congress.gov (bills & legislation)

AI & Intelligence

  • Most checks use no model at all. For a claim no data series covers: Anthropic's Claude (dataset tools, then web search), behind hard daily call and spend caps (backend/utils/spend_guard.py). Gemini runs only if chosen with AI_SEARCH_PROVIDER=gemini.

Development Tools

  • API Testing: Postman
  • Version Control: Git & GitHub

πŸ— Architecture

Stelthar runs a tiered evidence engine. Cheap, exact sources run first; a model is only called when no official series covers the claim.

Tier What runs Cost Typical latency
1 β€” structured Deterministic claim parser β†’ BLS, BEA, Census ACS, Treasury 0 model calls 0.3–1s
2 β€” grounded One web-search call (Claude by default; Gemini if chosen) 1 model call 3–8s
  • Parse: metric, year (calendar vs fiscal), month, geography, comparator ("more than", "under") and the precision the claim was written to.
  • Fetch: the exact series for that metric, with the period and geography read from the agency's response β€” never copied from the request.
  • Assess: compares within the claim's written precision (and the survey's margin of error for Census), and fails closed on period or geography mismatch.
  • Verdicts: Supported, Mostly accurate, Contradicted, Misleading, or No verdict with a machine-readable reason saying what would have to change. Mostly accurate means the claim is off by one step in its last written digit and within 5% ("Texas unemployment was 4.1%" when BLS reports 4.0%); the headline states the gap.

Model resilience. GEMINI_MODEL is a preference, not a single point of failure: if Google retires it, the API falls through GEMINI_FALLBACK_MODELS (default gemini-3.8-flash, then the gemini-flash-latest alias) and keeps serving. GET /health shows the model in use and which source keys are set.


πŸ“– API Documentation

Base URL

https://stelthar-api.vercel.app

Endpoints

Endpoint Purpose
POST /v2/check Check every claim in a passage (up to 8,000 characters), or on a public page given as {"url": ...}. One claim gets the full check; two or more, and any page, are checked on free official data only. What the site and extension 2.2 call.
POST /v2/verify Check one claim, with the full pipeline.
POST /v2/lookup "What is the official figure?" β€” value plus ready-to-paste citations.
GET /c?claim=... A claim's check as a page to send someone, with the verdict in the link preview. Free data only.
POST /mcp The checks as Model Context Protocol tools (check_text, check_page, check_claim, find_figure). Free data only.
POST /verify One claim, v1-compatible response (what extensions before 2.2 call).
POST /v1/verify Legacy multi-pass planner, kept for comparison. Off unless ENABLE_LEGACY_V1=true.
GET /health Model in use, configured sources (details need X-Health-Token).

Every check carries a display block: the verdict, each figure compared (claim beside official, with the gap), how the claim was read, the sources (agency, dataset, series, link) and a ready-to-paste citation. The extension's side panel and the site render this block.

The site documents the API at /developers and the rules behind each verdict at /methodology. What changed in 2.2, its switches and how to roll each part back: docs/release-2.2.md.

POST /verify

{ "claim": "Inflation hit 9% in June 2022" }

Response (abridged β€” sources, evidence, citations and parsed are also returned):

{
    "verdict": "Supported",
    "verdict_detail": "Supported",
    "confidence": 0.9,
    "confidence_tier": "High",
    "summary": "Claim says 9%. BLS reports 9.06% for June 2022 (M06 2022 vs M06 2021, not seasonally adjusted).",
    "evidence_links": [
        {
            "finding": "CPI-U inflation rate (year over year): 9.06% (June 2022 (M06 2022 vs M06 2021, not seasonally adjusted)) \u2014 BLS",
            "source_url": "https://data.bls.gov/timeseries/CUUR0000SA0"
        }
    ],
    "headline": "Claim says 9%. BLS reports 9.06% for June 2022 (M06 2022 vs M06 2021, not seasonally adjusted).",
    "reason": null,
    "claim_value": "9%",
    "official_value": "9.06% (June 2022 (M06 2022 vs M06 2021, not seasonally adjusted))",
    "caveats": [],
    "tier": "structured",
    "model_calls": 0,
    "elapsed_seconds": 0.0,
    "degraded": false
}

search_suggestions_html is set when the grounded tier answered. Any UI that shows grounded citations must render it (Google Search grounding terms).

Coverage (tier 1, exact figures, no AI):

Area Claims it answers Source
Jobs Unemployment rate β€” national, by state, and for Black, White, Hispanic, Asian, women, men, teens (16–19), youth (16–24), veterans; labor-force participation; payrolls; hourly earnings BLS (CPS, LAUS, CES)
Prices Inflation, core inflation, PPI; average prices of gas, eggs, milk, ground beef, coffee, electricity (latest month for "is…" claims) BLS (CPI, Average Price Data)
Federal budget Deficit, revenue, spending by fiscal year; national debt Treasury (Monthly Treasury Statement, Debt to the Penny)
Economy GDP, real GDP growth (annual and quarterly, annual rate), personal income BEA (NIPA)
People Population, median household income, poverty, uninsured, home value, bachelor's degree β€” national or by state Census ACS 1-year

Also checked exactly: two-point claims ("unemployment fell from 8.1% in 2020 to 3.6% in 2023" β€” each value against its own year). Everything else goes to tier 2 (AI search with citations, behind spend limits); an AI verdict with no source behind it is never shown.


🀝 Contributing

Any contributions you make are greatly appreciated.

Development Setup

  1. Clone the repository

    git clone https://github.com/RadoKyselak/Project-Mirador.git
    cd Project-Mirador
  2. Install dependencies

    # Backend dependencies
    pip install -r backend/requirements.txt -r backend/requirements-dev.txt
    
    # Frontend - load the extension in Chrome
    # Navigate to chrome://extensions/
    # Enable "Developer mode"
    # Click "Load unpacked" and select the extension directory
  3. Set up environment variables

    cp .env.example .env
    # Add your API keys for government data sources and Gemini
  4. Run tests

    make test

Contribution Guidelines

  • Fork the repository
  • Create a feature branch (git checkout -b feature/AmazingFeature)
  • Commit your changes (git commit -m 'Add some AmazingFeature')
  • Push to the branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

⚠️ Disclaimer

Stelthar API uses publicly available U.S. Government open data sources but is not affiliated with or endorsed by any governmental agency.

Verdicts and confidence scores are algorithmic estimates β€” they assist, not replace, human judgment. Always verify critical information through multiple sources.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“§ Contact

Rado Kyselak - Developer


Open Truth. Verified Data.

Project Mirador - Powered by Stelthar API

About

Project Mirador codebase and Stelthar API

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages