{
  "markdown": "# SentimentFX\n\nFull-stack crypto sentiment intelligence platform. Scrapes financial news headlines, scores them with FinBERT (a finance-specific transformer model), and correlates sentiment against live GBP crypto prices to surface predictive signals.\n\n**Live:** [sentimentfx.org](https://sentimentfx.org) · [app.sentimentfx.org](https://app.sentimentfx.org) · [developers.sentimentfx.org](https://developers.sentimentfx.org)\n\n---\n\n## What it does\n\n- Scrapes headlines every hour from GNews API + CoinTelegraph/CoinDesk RSS feeds\n- Scores each headline with FinBERT (`positive_prob - negative_prob` → range -1 to +1)\n- Fetches daily GBP prices via yfinance\n- Computes Pearson correlation across 0–7 day lags to find the best predictive signal\n- Exposes a public metered API with Stripe billing for developers\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Backend | Python 3.11, FastAPI, SQLAlchemy |\n| AI Model | FinBERT (ProsusAI/finbert) |\n| Database | PostgreSQL |\n| Auth | Supabase (email + Google OAuth) |\n| Payments | Stripe (subscriptions + metered API billing) |\n| Frontend | React, Recharts, Vite |\n| Data | GNews API, feedparser (RSS), yfinance |\n| Email | Resend |\n| Deploy | Railway (backend), Vercel (frontend) |\n\n## Features\n\n**Dashboard**\n- Sentiment vs price chart with 7/30/90/ALL day ranges\n- Pearson correlation with lag analysis (0–7 days)\n- Momentum vs contrarian signal detection\n- Paginated headline feed with per-article sentiment scores\n- GBP/USD currency toggle\n- CSV export (Pro)\n\n**Tickers:** BTC, ETH, SOL, XRP, DOGE\n\n**Access tiers**\n- Free — BTC only, 30 day history\n- Pro (£11.99/mo or £99.99/yr) — all tickers, full history, CSV export, sentiment alerts\n\n**Developer API** (`api.sentimentfx.org/v1/`)\n- `/v1/sentiment/{ticker}` — scored headlines\n- `/v1/summary/{ticker}` — daily averaged sentiment\n- `/v1/prices/{ticker}` — daily GBP closing prices\n- `/v1/correlation/{ticker}` — Pearson r across lag periods\n- Metered billing at £0.01/call after 100 free calls\n- Rate limited via slowapi\n\n## Architecture\n\n```\nGNews API + RSS feeds\n        ↓\n   scraper.py → FinBERT (sentiment.py) → headlines table\n                                              ↓\nyfinance → prices.py → prices table    /dashboard/{ticker}\n                                              ↓\n                                       React + Recharts\n```\n\nAPScheduler runs `scrape_all()` on a cron trigger at the top of every hour.\n\n## Getting Started\n\n### Backend\n\n```bash\ncd backend\npython -m venv venv\nsource venv/Scripts/activate  # Windows: venv\\Scripts\\activate\npip install -r requirements.txt\ncp .env.example .env          # fill in your keys\npython -m uvicorn app.main:app --reload\n```\n\n### Frontend\n\n```bash\ncd frontend\nnpm install\nnpm run dev\n```\n\n\n## Sentiment Scoring\n\nUses FinBERT's output probabilities directly:\n\n```\nscore = positive_probability - negative_probability\n```\n\nRange: -1 (maximally negative) to +1 (maximally positive). Neutral headlines score near 0. This avoids the label × confidence collapse that zeros out neutral predictions.\n\n## API Reference\n\nFull docs at [developers.sentimentfx.org](https://developers.sentimentfx.org)\n\n```bash\n# Generate a free API key\ncurl -X POST https://api.sentimentfx.org/api/keys/generate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\": \"your@email.com\"}'\n\n# Use the key\ncurl https://api.sentimentfx.org/v1/summary/BTC \\\n  -H \"X-API-Key: sfx_your_key_here\"\n```\n\n## Deployment\n\n- **Backend:** Railway via `Procfile` + `nixpacks.toml`. Starts with `uvicorn app.main:app --host 0.0.0.0 --port $PORT`.\n- **Frontend/Landing/Docs:** Vercel, auto-deploys from `main`.",
  "bytes": 3643,
  "sha": "a0d3583e0ca5b0cf52056cf68dfad26c0efe1da8c8d59bf4d0b0406d066ce8a9",
  "repo_slug": "shaelegowski7/crypto-sentiment",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_org_sentimentfx_market_sentiment_1460435b/readme"
}