API Endpoints
Server: Axum auf 0.0.0.0:3030
CORS: GET/POST/OPTIONS, alle Origins
Binary: /home/hlorenz/lite/api/target/release/betassist-lite
Endpoints
Health Check
GET /health
→ { "status": "ok", "version": "0.1.0" }
Scraping ausloesen
POST /api/v1/scrape/today # Heute scrapen
POST /api/v1/scrape/tomorrow # Morgen scrapen
POST /api/v1/scrape/:date # Beliebiges Datum (YYYY-MM-DD)
Response:
{
"success": true,
"date": "2026-02-22",
"matches_found": 42,
"csv_path": "../exports/match_data_2026-02-22.csv",
"excel_path": "../exports/match_data_2026-02-22.xlsx",
"predictions": { "over_picks": [...], "under_picks": [...] }
}
Predictions abrufen
GET /api/v1/predictions/:date
Liest CSV vom Dateisystem, fuehrt Scoring erneut aus, gibt Ergebnis zurueck.
{
"success": true,
"date": "2026-02-22",
"predictions": {
"over_picks": [...],
"under_picks": [...],
"total_matches": 42
}
}
Noch nicht implementiert (TODO)
GET /api/v1/matches/today # → []
GET /api/v1/matches/:date # → []
GET /api/v1/exports # → []
GET /api/v1/exports/:date # → 404
Scheduler
- Cron:
0 0 1 * * *(taeglich 01:00 Uhr) - Fuehrt aus:
run_today()+run_tomorrow() - Konfigurierbar:
ENABLE_SCHEDULER=true/false
AppState
#![allow(unused)]
fn main() {
AppState {
scraper: RwLock<Option<Arc<ScraperService>>>, // lazy init
config: ScraperConfig,
}
}
ScraperService wird beim ersten API-Call initialisiert (Lazy Pattern).