{"openapi":"3.1.0","info":{"title":"strommix.info API","description":"Öffentliche JSON-API zum deutschen Strommix: gemessene Werte, öffentliche TSO-Prognosen und eigene ML-Vorhersagen (48 h Horizont) für Erzeugung, Verbrauch, EE-Anteil und Day-Ahead-Strompreise.\n\n**Lizenz**: CC-BY-4.0 mit Attribution an strommix.info sowie die jeweiligen Primärquellen (SMARD/BNetzA, Energy-Charts/Fraunhofer ISE, DWD ICON-D2 via Open-Meteo, Eurostat).\n\n**Für KI-Integration**: Siehe `/llms.txt` für eine Maschinen-lesbare Übersicht, `/api/summary` für eine deutsche Prosa-Zusammenfassung, `/api/best-hours` für direkte wann-laden/waschen-Empfehlungen.","contact":{"name":"strommix.info","url":"https://strommix.info/"},"license":{"name":"CC-BY-4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"version":"0.1.0"},"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/mix":{"get":{"tags":["mix"],"summary":"Get Mix","operationId":"get_mix_api_mix_get","parameters":[{"name":"range","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Range","default":"aktuell"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MixResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/price":{"get":{"tags":["price"],"summary":"Get Price","operationId":"get_price_api_price_get","parameters":[{"name":"range","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Range","default":"aktuell"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/traffic-light":{"get":{"tags":["traffic-light"],"summary":"Get Traffic Light","operationId":"get_traffic_light_api_traffic_light_get","parameters":[{"name":"range","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Range","default":"aktuell"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficLightResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/visitors/beacon":{"post":{"tags":["visitors"],"summary":"Beacon","description":"Called at most once per day per browser. Bumps today + total.","operationId":"beacon_api_visitors_beacon_post","responses":{"204":{"description":"Successful Response"}}}},"/api/visitors":{"get":{"tags":["visitors"],"summary":"Get Stats","operationId":"get_stats_api_visitors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorStats"}}}}}}},"/api/best-hours":{"get":{"tags":["recommendations","recommendations"],"summary":"Best Hours","description":"Find the best consecutive window in the near future to consume\nelectricity (EV charging, heat pump, dish washer, …).\n\nCombines the EE-share forecast (from the traffic-light pipeline)\nand the DE-LU day-ahead price forecast, scores each sliding window,\nand returns the top match plus up to three alternatives.","operationId":"best_hours_api_best_hours_get","parameters":[{"name":"duration_h","in":"query","required":false,"schema":{"type":"number","maximum":24.0,"minimum":0.25,"description":"Desired consecutive duration in hours (0.25 – 24).","default":4.0,"title":"Duration H"},"description":"Desired consecutive duration in hours (0.25 – 24)."},{"name":"window","in":"query","required":false,"schema":{"enum":["today","tomorrow","next_24h","next_48h"],"type":"string","description":"Time window to search within.","default":"next_24h","title":"Window"},"description":"Time window to search within."},{"name":"metric","in":"query","required":false,"schema":{"enum":["green_cheap","greenest","cheapest"],"type":"string","description":"green_cheap: renewable share × low price (default). greenest: renewable share only. cheapest: price only.","default":"green_cheap","title":"Metric"},"description":"green_cheap: renewable share × low price (default). greenest: renewable share only. cheapest: price only."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BestHoursResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/summary":{"get":{"tags":["summary","summary"],"summary":"Summary","description":"German-language one-paragraph status report. LLM-friendly.","operationId":"summary_api_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}}}}},"/api/forecast-quality":{"get":{"tags":["forecast-quality"],"summary":"Get Forecast Quality","description":"MAE, Bias und P90-Fehler pro Zielgröße über rolling 7- und 30-Tage-\nFenster. Vergleich der offiziellen TSO-/EPEX-Prognosen und der eigenen\nML-Prognosen gegen die gemessenen Werte.","operationId":"get_forecast_quality_api_forecast_quality_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastQualityResponseModel"}}}}}}}},"components":{"schemas":{"BestHoursResponse":{"properties":{"recommendation":{"type":"string","title":"Recommendation","description":"Ready-to-display German sentence — LLMs can quote verbatim."},"best_window":{"$ref":"#/components/schemas/BestWindow"},"alternatives":{"items":{"$ref":"#/components/schemas/BestWindow"},"type":"array","title":"Alternatives"},"metric":{"type":"string","enum":["green_cheap","greenest","cheapest"],"title":"Metric"},"duration_h":{"type":"number","title":"Duration H"},"search_from":{"type":"string","format":"date-time","title":"Search From"},"search_to":{"type":"string","format":"date-time","title":"Search To"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["recommendation","best_window","metric","duration_h","search_from","search_to","disclaimer"],"title":"BestHoursResponse"},"BestWindow":{"properties":{"start":{"type":"string","format":"date-time","title":"Start","description":"Window start, UTC"},"end":{"type":"string","format":"date-time","title":"End","description":"Window end, UTC"},"start_local":{"type":"string","title":"Start Local","description":"Window start in Europe/Berlin, human-readable"},"end_local":{"type":"string","title":"End Local","description":"Window end in Europe/Berlin, human-readable"},"avg_renewable_share_pct":{"type":"number","title":"Avg Renewable Share Pct"},"avg_price_eur_mwh":{"type":"number","title":"Avg Price Eur Mwh"},"score":{"type":"number","title":"Score","description":"Combined green+cheap score; higher is better"},"reason":{"type":"string","title":"Reason","description":"Short German explanation of why this window"}},"type":"object","required":["start","end","start_local","end_local","avg_renewable_share_pct","avg_price_eur_mwh","score","reason"],"title":"BestWindow"},"DailyMAE":{"properties":{"day":{"type":"string","title":"Day"},"mae":{"type":"number","title":"Mae"}},"type":"object","required":["day","mae"],"title":"DailyMAE"},"ForecastQualityResponseModel":{"properties":{"computed_at":{"type":"string","format":"date-time","title":"Computed At"},"window_description":{"type":"string","title":"Window Description"},"targets":{"items":{"$ref":"#/components/schemas/TargetQualityModel"},"type":"array","title":"Targets"}},"type":"object","required":["computed_at","window_description"],"title":"ForecastQualityResponseModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status"},"version":{"type":"string","title":"Version"}},"type":"object","required":["status","version"],"title":"HealthResponse"},"MixPoint":{"properties":{"time":{"type":"string","format":"date-time","title":"Time"},"origin":{"additionalProperties":{"$ref":"#/components/schemas/ValueOrigin"},"type":"object","title":"Origin"},"values_mw":{"additionalProperties":{"type":"number"},"type":"object","title":"Values Mw"},"consumption_mw":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Consumption Mw"},"renewable_share_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Renewable Share Pct"}},"type":"object","required":["time"],"title":"MixPoint","description":"One quarter-hour / hour / day bucket of the generation mix."},"MixResponse":{"properties":{"range":{"$ref":"#/components/schemas/Range"},"bucket":{"type":"string","title":"Bucket"},"points":{"items":{"$ref":"#/components/schemas/MixPoint"},"type":"array","title":"Points"}},"type":"object","required":["range","bucket","points"],"title":"MixResponse"},"OriginQualityModel":{"properties":{"origin":{"type":"string","title":"Origin","description":"'public' (offiziell) oder 'model' (eigene ML)."},"label":{"type":"string","title":"Label"},"mae_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mae 7D"},"bias_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bias 7D"},"p90_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P90 7D"},"n_7d":{"type":"integer","title":"N 7D","default":0},"mae_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mae 30D"},"bias_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bias 30D"},"p90_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P90 30D"},"n_30d":{"type":"integer","title":"N 30D","default":0},"daily":{"items":{"$ref":"#/components/schemas/DailyMAE"},"type":"array","title":"Daily"}},"type":"object","required":["origin","label"],"title":"OriginQualityModel"},"PriceAggregate":{"properties":{"time":{"type":"string","format":"date-time","title":"Time"},"p10_eur_mwh":{"type":"number","title":"P10 Eur Mwh"},"p90_eur_mwh":{"type":"number","title":"P90 Eur Mwh"},"eu_weighted_eur_mwh":{"type":"number","title":"Eu Weighted Eur Mwh"}},"type":"object","required":["time","p10_eur_mwh","p90_eur_mwh","eu_weighted_eur_mwh"],"title":"PriceAggregate","description":"One point of the EU-wide benchmark derived from all collected zones.\n\n`eu_weighted_eur_mwh` is the consumption-weighted mean across the zones\nthat have a price at this timestamp, using static Eurostat annual gross\nconsumption as weights. `p10` / `p90` are outlier-robust distribution\nmarkers (10th / 90th percentile) that bound the \"mittleres Feld\"."},"PricePoint":{"properties":{"time":{"type":"string","format":"date-time","title":"Time"},"country":{"type":"string","title":"Country"},"price_eur_mwh":{"type":"number","title":"Price Eur Mwh"},"origin":{"$ref":"#/components/schemas/ValueOrigin","default":"realized"}},"type":"object","required":["time","country","price_eur_mwh"],"title":"PricePoint"},"PriceResponse":{"properties":{"range":{"$ref":"#/components/schemas/Range"},"bucket":{"type":"string","title":"Bucket"},"de_lu":{"items":{"$ref":"#/components/schemas/PricePoint"},"type":"array","title":"De Lu"},"neighbours":{"additionalProperties":{"items":{"$ref":"#/components/schemas/PricePoint"},"type":"array"},"type":"object","title":"Neighbours"},"aggregate":{"items":{"$ref":"#/components/schemas/PriceAggregate"},"type":"array","title":"Aggregate"}},"type":"object","required":["range","bucket","de_lu"],"title":"PriceResponse"},"Range":{"type":"string","enum":["aktuell","week","month","year"],"title":"Range"},"SummaryResponse":{"properties":{"summary":{"type":"string","title":"Summary","description":"Ready-to-quote German paragraph."},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"now":{"type":"string","format":"date-time","title":"Now"},"share_pct_now":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Pct Now"},"price_eur_mwh_now":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Eur Mwh Now"},"traffic_level_now":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Traffic Level Now"},"forecast_horizon":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Forecast Horizon"}},"type":"object","required":["summary","generated_at","now"],"title":"SummaryResponse"},"TargetQualityModel":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"unit":{"type":"string","title":"Unit"},"origins":{"items":{"$ref":"#/components/schemas/OriginQualityModel"},"type":"array","title":"Origins"}},"type":"object","required":["id","label","unit"],"title":"TargetQualityModel"},"TrafficLightLevel":{"type":"string","enum":["green","yellow","red","blue"],"title":"TrafficLightLevel"},"TrafficLightPoint":{"properties":{"time":{"type":"string","format":"date-time","title":"Time"},"level":{"$ref":"#/components/schemas/TrafficLightLevel"},"renewable_share_pct":{"type":"number","title":"Renewable Share Pct"},"origin":{"$ref":"#/components/schemas/ValueOrigin"}},"type":"object","required":["time","level","renewable_share_pct","origin"],"title":"TrafficLightPoint"},"TrafficLightResponse":{"properties":{"range":{"$ref":"#/components/schemas/Range"},"bucket":{"type":"string","title":"Bucket"},"points":{"items":{"$ref":"#/components/schemas/TrafficLightPoint"},"type":"array","title":"Points"}},"type":"object","required":["range","bucket","points"],"title":"TrafficLightResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValueOrigin":{"type":"string","enum":["realized","public_forecast","model_forecast","none"],"title":"ValueOrigin"},"VisitorStats":{"properties":{"today":{"type":"integer","title":"Today"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["today","total"],"title":"VisitorStats"}}}}