Crypto Data Source API (Dual Mode)
Updated: 2025-11-11T20:56:45.223511Z
This backend is designed to support both frontend shapes you used:
- Classic
/api/*endpoints (status/providers/categories/charts/logs/failures/freshness/config/keys/custom/add). - Alternate aliases and extras that some UIs expect:
/health,/info,/api/rate-limits,/api/alerts,/api/logs?type=..., plus synthetic Hugging Face helpers under/api/hf/*.
Files
app.pyβ FastAPI application (single file, nofrontend/folder needed). Place yourindex.htmlnext to it if you want static SPA routing.requirements.txtβ minimal, conflict-free pins tested for HF Spaces.
Run (local)
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 7860
Endpoints
/β servesindex.htmlif present; else JSON hint/ws/liveβ live events (live_metrics,status_update,provider_status_change,new_alert)/healthβ alias of/api/health/infoβ status-like payload/api/health/api/status/api/providers/api/categories/api/charts/health-history?hours=24/api/charts/compliance?days=7/api/freshness/api/logs(optional?type=connection|error)/api/failures(alias exposed also at/api/alerts)/api/rate-limits/api/config/keys/api/custom/add(POST query params:name,url,category, optionaltest_field)/api/markets,/api/ticker/{symbol}(via ccxt)/api/hf/health,/api/hf/refresh(POST),/api/hf/registry?type=models|datasets,/api/hf/search?q=&kind=,/api/hf/run-sentiment(POST JSON:{"text": "..."})
All non-critical data are synthetic to keep it lightweight on Spaces.