{"service":"F1 E-Ink Calendar API","version":"1.4.0","statistics":{"enabled":true,"aggregate_only":true,"disabled_response":"410 when MINIMAL_DATA_MODE=true","performance_sample_rate":0.1,"privacy":"Performance ingestion discards unknown and legacy visitor metadata. Default storage: hourly usage totals and coarse performance histograms.","read_authentication":{"required":false,"description":"Public unless ADMIN_API_TOKEN is configured. Applies to GET only.","headers":["X-Admin-Token: <token>","Authorization: Bearer <token>"],"unauthorized_status":401}},"rate_limits":{"enabled":true,"window_seconds":60,"scope":"Shared per bucket in minimal or aggregate-only mode; otherwise per IP","image_requests":120,"data_api_requests":120,"statistics_reads":60,"performance_posts":30,"render_concurrency":4,"render_variant_concurrency":2,"render_slot_wait_seconds":5.0,"exceeded_response":"429 with Retry-After header","overloaded_response":"503 with Retry-After; cached images do not wait"},"description":"Generate 800x480 BMP images for E-Ink displays showing F1 race schedules","endpoints":{"/":{"method":"GET","description":"Interactive preview page with live image generation"},"/calendar.bmp":{"method":"GET","description":"Generate F1 calendar as BMP image (800x480)","parameters":{"track_style":{"type":"string","default":"relief","values":["relief","poster","clean","lino","riso","screenprint","contours","geometric","blueprint","ribbon","mosaic","halftone","negative","papercut","typographic","artdeco","stencil","pixel"]},"track_source":{"type":"string","default":"jules","values":["jules","commons"]},"track_accent":{"type":"string","default":"all","values":["all","mono","red","yellow","blue","green","warm","red-blue","red-green","yellow-blue","yellow-green","cool","red-yellow-blue","red-yellow-green","red-blue-green","yellow-blue-green"]},"lang":{"type":"string","description":"Language code for calendar text","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"],"default":"en","example":"?lang=cs"},"year":{"type":"integer","description":"Season year; combine with round or race_key to select a race","example":"?year=2026","optional":true},"round":{"type":"integer","description":"Round number from /api/races/{year}; ignored without year","example":"?year=2026&round=5","optional":true},"race_key":{"type":"string","description":"Race identifier for a bundled race from /api/races/{year}, including cancelled races without a round. Remote-only races are not selectable. Requires year; omission of year returns 400.","optional":true},"tz":{"type":"string","description":"Timezone for schedule times (IANA format)","example":"?tz=America/New_York","default":"Europe/Prague","optional":true},"display":{"type":"string","description":"Display output mode","values":["1bit","bwr","bwry","spectra6"],"default":"1bit","example":"?display=bwry","optional":true},"weather":{"type":"boolean","description":"Enable or disable weather overlay","values":[true,false],"default":true,"example":"?weather=false","optional":true},"weather_type":{"type":"string","description":"Weather source to render ('race' normalizes to 'race_day'; 'off' disables weather). 'weekend' adds a second line to the status box with the qualifying (and, when it fits, sprint) and race forecasts from the same single Open-Meteo request as race_day; sessions beyond the 16-day forecast or without a published time are left out","values":["race_day","race","current","weekend","off"],"default":"race_day","example":"?weather_type=current","optional":true},"countdown":{"type":"string","description":"Countdown in the status box: hours (days and hours), days (whole days in tz, changes at local midnight), auto (whole days until 48 h before the start, then days and hours) or off (race date). Invalid values return 422.","values":["hours","days","auto","off"],"default":"hours","example":"?countdown=auto","optional":true},"weekend_mode":{"type":"string","description":"auto: during the race weekend (from 12 h before the first session) mark finished sessions (start plus a conservative duration estimate, the real end is unknown), highlight the running or next session, count down to it with its short label and show this weekend's qualifying and race podiums (from Jolpica, fetched only after those sessions) with the season above each column. off: unchanged. Invalid values return 422.","values":["off","auto"],"default":"off","example":"?weekend_mode=auto","optional":true},"temp_unit":{"type":"string","description":"Temperature unit of the drawn weather: c (Celsius) or f (Fahrenheit, converted when drawing from the same cached Celsius data, without extra weather requests). Invalid values return 422.","values":["c","f"],"default":"c","example":"?temp_unit=f","optional":true},"format":{"type":"string","description":"bmp: the default bytes, unchanged. png: lossless PNG with exactly the same pixel indices and panel palette (1-bit greyscale for 1bit, indexed for bwr/bwry/spectra6; no dithering or extra colours), about 10-15 KB instead of 48-385 KB. The path stays .bmp; Content-Type, Content-Length and ETag describe the bytes sent. Invalid values return 422.","values":["bmp","png"],"default":"bmp","example":"?format=png","optional":true},"rotate":{"type":"string","description":"180 turns the image upside down losslessly (still 800x480, same BMP bit depth) for a panel mounted with its connector on the other side. 90/270 are not offered: they need a portrait layout. Invalid values return 422.","values":["0","180"],"default":"0","example":"?rotate=180","optional":true},"theme":{"type":"string","description":"dark (experimental): white text and lines on a black background; red, yellow and the Spectra 6 colours keep their roles and flags keep their colours. Large black areas can ghost on some panels, so prefer a full refresh. Rendered on demand (never pregenerated). light keeps the default output. Invalid values return 422.","values":["light","dark"],"default":"light","example":"?theme=dark","optional":true}},"response":{"content_type":"image/bmp; image/png with format=png","dimensions":"800x480","color_depth":"1-bit monochrome, 4-bit indexed B/W/R, 4-bit indexed B/W/R/Y, or indexed Spectra 6","cache_control":"public, max-age=3600; no-store for rendering errors","conditional_requests":"Send If-None-Match with the previous ETag for a body-free 304 response when unchanged","refresh_hint":"X-Next-Refresh-Seconds on 200 and 304: seconds until the image is next expected to change (60-86400, at most 3600 while hourly refreshed weather is shown; 300 for an error image). A hint for the client's sleep length, not a promise that the ETag stays unchanged."},"examples":["/calendar.bmp","/calendar.bmp?lang=cs","/calendar.bmp?year=2026&round=1","/calendar.bmp?lang=en&tz=America/Los_Angeles","/calendar.bmp?display=bwr","/calendar.bmp?display=bwry","/calendar.bmp?display=spectra6&weather_type=current","/calendar.bmp?countdown=auto&weather=false","/calendar.bmp?weekend_mode=auto&display=bwry","/calendar.bmp?weather_type=weekend&temp_unit=f&tz=America/New_York","/calendar.bmp?display=spectra6&format=png&rotate=180","/calendar.bmp?display=bwr&theme=dark"]},"/teams.bmp":{"method":"GET","description":"Generate F1 teams and drivers BMP image (800x480)","parameters":{"tz":{"type":"string","description":"IANA timezone; applies only to teams extra panels showing a time or date: countdown, flags, track, weather. An invalid timezone returns 400.","default":"Europe/Prague","optional":true},"extra":{"type":"string","description":"Optional teams panel; local data and cached weather only. Unavailable panels fall back to none.","values":["none","countdown","flags","track","weather"],"default":"none","example":"?extra=countdown","optional":true},"lang":{"type":"string","description":"Language code for teams text","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"],"default":"en","example":"?lang=cs"},"year":{"type":"integer","description":"Season year for team data; defaults to the newest bundled season at or before the current season, when available","default":2026,"example":"?year=2026","optional":true},"display":{"type":"string","description":"Display output mode","values":["1bit","bwr","bwry","spectra6"],"default":"1bit","example":"?display=bwr","optional":true},"temp_unit":{"type":"string","description":"Temperature unit of the weather panel (extra=weather): c or f. Invalid values return 422.","values":["c","f"],"default":"c","example":"?temp_unit=f","optional":true},"format":{"type":"string","description":"bmp: the default bytes, unchanged. png: lossless PNG with exactly the same pixel indices and panel palette (1-bit greyscale for 1bit, indexed for bwr/bwry/spectra6; no dithering or extra colours), about 10-15 KB instead of 48-385 KB. The path stays .bmp; Content-Type, Content-Length and ETag describe the bytes sent. Invalid values return 422.","values":["bmp","png"],"default":"bmp","example":"?format=png","optional":true},"rotate":{"type":"string","description":"180 turns the image upside down losslessly (still 800x480, same BMP bit depth) for a panel mounted with its connector on the other side. 90/270 are not offered: they need a portrait layout. Invalid values return 422.","values":["0","180"],"default":"0","example":"?rotate=180","optional":true},"theme":{"type":"string","description":"dark (experimental): white text and lines on a black background; red, yellow and the Spectra 6 colours keep their roles and flags keep their colours. Large black areas can ghost on some panels, so prefer a full refresh. Rendered on demand (never pregenerated). light keeps the default output. Invalid values return 422.","values":["light","dark"],"default":"light","example":"?theme=dark","optional":true}},"response":{"content_type":"image/bmp; image/png with format=png","dimensions":"800x480","color_depth":"1-bit monochrome, 4-bit indexed B/W/R, 4-bit indexed B/W/R/Y, or indexed Spectra 6","cache_control":"no-cache; no-store for rendering errors","conditional_requests":"Send If-None-Match with the previous ETag for a body-free 304 response when unchanged","refresh_hint":"X-Next-Refresh-Seconds on 200 and 304: seconds until the image is next expected to change (60-86400, at most 3600 while hourly refreshed weather is shown; 300 for an error image). A hint for the client's sleep length, not a promise that the ETag stays unchanged."},"examples":["/teams.bmp","/teams.bmp?lang=cs","/teams.bmp?year=2026","/teams.bmp?display=bwr","/teams.bmp?display=spectra6","/teams.bmp?extra=weather&temp_unit=f","/teams.bmp?display=bwr&format=png","/teams.bmp?display=spectra6&extra=flags&theme=dark"]},"/auto.bmp":{"method":"GET","description":"One URL that returns the calendar or the teams BMP directly (no redirect), for displays that can poll a single address such as Živýobraz.eu. Accepts the calendar and teams parameters; each applies to its own screen.","parameters":{"mode":{"type":"string","description":"race_week: calendar from lead_hours before the first session of the next race weekend until the next race is selected (4 h after the start, or after the local race day while the start time is unpublished), teams otherwise, also during the off-season and for cancelled races. daily: calendar on even and teams on odd local days in tz, switching at local midnight. Invalid values return 422.","values":["race_week","daily"],"default":"race_week","example":"?mode=daily","optional":true},"lead_hours":{"type":"integer","description":"race_week: hours before the first session when the calendar appears. Values outside the range return 422.","minimum":0,"maximum":168,"default":48,"example":"?lead_hours=72","optional":true},"lang":{"type":"string","default":"en","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"]},"tz":{"type":"string","description":"IANA timezone for both screens and the daily switch; an invalid timezone returns 400","default":"Europe/Prague","optional":true},"display":{"type":"string","default":"1bit","values":["1bit","bwr","bwry","spectra6"]},"weather":{"type":"boolean","description":"Calendar only","default":true,"optional":true},"weather_type":{"type":"string","description":"Calendar only","values":["race_day","race","current","weekend","off"],"default":"race_day","optional":true},"countdown":{"type":"string","description":"Calendar only","values":["hours","days","auto","off"],"default":"hours","example":"?countdown=auto","optional":true},"weekend_mode":{"type":"string","description":"Calendar only","values":["off","auto"],"default":"off","example":"?weekend_mode=auto","optional":true},"temp_unit":{"type":"string","description":"Calendar weather and teams weather panel","values":["c","f"],"default":"c","example":"?temp_unit=f","optional":true},"track_style":{"type":"string","default":"relief","values":["relief","poster","clean","lino","riso","screenprint","contours","geometric","blueprint","ribbon","mosaic","halftone","negative","papercut","typographic","artdeco","stencil","pixel"]},"track_source":{"type":"string","default":"jules","values":["jules","commons"]},"track_accent":{"type":"string","default":"all","values":["all","mono","red","yellow","blue","green","warm","red-blue","red-green","yellow-blue","yellow-green","cool","red-yellow-blue","red-yellow-green","red-blue-green","yellow-blue-green"]},"extra":{"type":"string","description":"Teams only; defaults to countdown on this URL","values":["none","countdown","flags","track","weather"],"default":"countdown","optional":true},"year":{"type":"integer","description":"Teams only: season year; the calendar always shows the next race","optional":true},"format":{"type":"string","description":"bmp: the default bytes, unchanged. png: lossless PNG with exactly the same pixel indices and panel palette (1-bit greyscale for 1bit, indexed for bwr/bwry/spectra6; no dithering or extra colours), about 10-15 KB instead of 48-385 KB. The path stays .bmp; Content-Type, Content-Length and ETag describe the bytes sent. Invalid values return 422.","values":["bmp","png"],"default":"bmp","example":"?format=png","optional":true},"rotate":{"type":"string","description":"180 turns the image upside down losslessly (still 800x480, same BMP bit depth) for a panel mounted with its connector on the other side. 90/270 are not offered: they need a portrait layout. Invalid values return 422.","values":["0","180"],"default":"0","example":"?rotate=180","optional":true},"theme":{"type":"string","description":"dark (experimental): white text and lines on a black background; red, yellow and the Spectra 6 colours keep their roles and flags keep their colours. Large black areas can ghost on some panels, so prefer a full refresh. Rendered on demand (never pregenerated). light keeps the default output. Invalid values return 422.","values":["light","dark"],"default":"light","example":"?theme=dark","optional":true}},"response":{"content_type":"image/bmp; image/png with format=png","dimensions":"800x480","active_screen":"X-Active-Screen: calendar or teams","cache_control":"As the active screen; max-age never exceeds the seconds until the next switch","conditional_requests":"ETag of the active screen (the same as its direct URL); a 304 is returned only while the client already shows that screen","refresh_hint":"X-Next-Refresh-Seconds on 200 and 304: seconds until the image is next expected to change (60-86400, at most 3600 while hourly refreshed weather is shown; 300 for an error image). A hint for the client's sleep length, not a promise that the ETag stays unchanged. Never later than the next switch."},"examples":["/auto.bmp","/auto.bmp?lang=cs&tz=Europe/Prague&display=bwry","/auto.bmp?mode=daily&tz=America/New_York","/auto.bmp?lead_hours=72&extra=flags","/auto.bmp?display=bwry&format=png&rotate=180"]},"/api":{"method":"GET","description":"API documentation (this endpoint)"},"/preview/{screen_type}.png":{"method":"GET","description":"400px-wide browser preview of the next race or default teams season","parameters":{"screen_type":{"type":"string","in":"path","values":["calendar","teams"]},"lang":{"type":"string","default":"en","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"]}},"response":{"content_type":"image/png"}},"/preview/configure/{screen_type}.png":{"method":"GET","description":"Full-size browser preview of the next race or default teams season; weather and track options apply only to calendar","parameters":{"tz":{"type":"string","description":"IANA timezone; applies only to teams extra panels showing a time or date: countdown, flags, track, weather. An invalid timezone returns 400.","default":"Europe/Prague","optional":true},"screen_type":{"type":"string","in":"path","values":["calendar","teams"]},"lang":{"type":"string","default":"en","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"]},"display":{"type":"string","default":"1bit","values":["1bit","bwr","bwry","spectra6"]},"weather_type":{"type":"string","default":"off","values":["off","current","race","race_day","weekend"]},"extra":{"type":"string","description":"Optional teams panel; applies only to teams","default":"none","values":["none","countdown","flags","track","weather"]},"countdown":{"type":"string","description":"Calendar countdown; applies only to calendar","values":["hours","days","auto","off"],"default":"hours","example":"?countdown=auto","optional":true},"weekend_mode":{"type":"string","description":"Calendar weekend mode; applies only to calendar","values":["off","auto"],"default":"off","example":"?weekend_mode=auto","optional":true},"temp_unit":{"type":"string","description":"Calendar weather and teams weather panel","values":["c","f"],"default":"c","example":"?temp_unit=f","optional":true},"theme":{"type":"string","description":"light (default, pregenerated) or dark (experimental, rendered on demand into the variant cache)","values":["light","dark"],"default":"light","example":"?theme=dark","optional":true},"track_style":{"type":"string","default":"relief","values":["relief","poster","clean","lino","riso","screenprint","contours","geometric","blueprint","ribbon","mosaic","halftone","negative","papercut","typographic","artdeco","stencil","pixel"]},"track_source":{"type":"string","default":"jules","values":["jules","commons"]},"track_accent":{"type":"string","default":"all","values":["all","mono","red","yellow","blue","green","warm","red-blue","red-green","yellow-blue","yellow-green","cool","red-yellow-blue","red-yellow-green","red-blue-green","yellow-blue-green"]}},"response":{"content_type":"image/png"}},"/api/tracks":{"method":"GET","description":"Track artwork choices and catalogue","parameters":{"lang":{"type":"string","default":"en","values":["cs","de","en","es","fr","it","ja","nl","pl","pt-BR","sk","tr","zh-CN"]}}},"/api/tracks/{circuit_id}":{"method":"GET","description":"Per-file attribution"},"/api/tracks/{circuit_id}.{svg|png|bmp}":{"method":"GET","description":"Attributed standalone artwork","parameters":{"display":{"type":"string","default":"spectra6","values":["1bit","bwr","bwry","spectra6"]},"track_style":{"type":"string","default":"relief","values":["relief","poster","clean","lino","riso","screenprint","contours","geometric","blueprint","ribbon","mosaic","halftone","negative","papercut","typographic","artdeco","stencil","pixel"]},"track_source":{"type":"string","default":"jules","values":["jules","commons"]},"track_accent":{"type":"string","default":"all","values":["all","mono","red","yellow","blue","green","warm","red-blue","red-green","yellow-blue","yellow-green","cool","red-yellow-blue","red-yellow-green","red-blue-green","yellow-blue-green"]}}},"/credits":{"method":"GET","description":"Artwork authors and licences"},"/api/docs":{"method":"GET","description":"API documentation (alias for /api)"},"/api/docs/html":{"method":"GET","description":"HTML API documentation; localized pages use /{lang}/api/docs/html"},"/api/stats":{"method":"GET","description":"Request statistics for the last 24h, including calendar map choices; 410 when MINIMAL_DATA_MODE=true","authentication":{"required":false,"description":"Public unless ADMIN_API_TOKEN is configured. Applies to GET only.","headers":["X-Admin-Token: <token>","Authorization: Bearer <token>"],"unauthorized_status":401},"calendar_map_breakdowns":{"requests.by_track_style":"Counts by requested track_style","requests.by_track_source":"Counts by requested track_source","requests.by_track_accent":"Counts by requested track_accent","legacy":"Historic requests with unrecorded map choices; new requests record resolved defaults even when query parameters are omitted"}},"/api/stats/history":{"method":"GET","description":"Historical hourly request statistics; 410 when MINIMAL_DATA_MODE=true","authentication":{"required":false,"description":"Public unless ADMIN_API_TOKEN is configured. Applies to GET only.","headers":["X-Admin-Token: <token>","Authorization: Bearer <token>"],"unauthorized_status":401},"parameters":{"limit":{"type":"integer","default":168,"minimum":1,"maximum":720,"description":"Maximum number of hourly history entries"}}},"/api/perf-metrics":{"methods":["GET","POST"],"description":"GET: performance summaries. POST: numeric Web Vitals and a known page category only. Both return 410 when MINIMAL_DATA_MODE=true.","authentication":{"required":false,"description":"Public unless ADMIN_API_TOKEN is configured. Applies to GET only.","headers":["X-Admin-Token: <token>","Authorization: Bearer <token>"],"unauthorized_status":401},"parameters":{"hours":{"type":"integer","default":24,"minimum":1,"maximum":720,"description":"GET lookback window in hours"}},"post_body":{"content_type":"application/json","required":["page_path"],"optional":["measurement_version","lcp_ms","cls","fcp_ms","ttfb_ms","inp_ms"],"response":"status=ok, or status=ignored when no numeric metric is supplied"},"measurement_version":3,"legacy_compatibility":"Version markers 1 and 2 remain accepted. Obsolete visitor/device fields and unknown fields are ignored, never stored.","timing_resolution_ms":50,"cls_resolution":0.01},"/api/races/{year}":{"method":"GET","description":"Get list of races for a season","parameters":{"year":{"type":"integer","description":"Season year","in":"path","minimum":1950,"maximum":2027},"tz":{"type":"string","description":"IANA timezone for the F1 service; an invalid timezone returns 400","default":"Europe/Prague","optional":true}}},"/api/race/{year}/{round_num}":{"method":"GET","description":"Get detailed race information","parameters":{"year":{"type":"integer","description":"Season year","in":"path","minimum":1950,"maximum":2027},"tz":{"type":"string","description":"IANA timezone for the F1 service; an invalid timezone returns 400","default":"Europe/Prague","optional":true},"round_num":{"type":"integer","description":"Round number; unavailable races return 404","in":"path","minimum":1,"maximum":30}}},"/api/teams/{year}":{"method":"GET","description":"Teams and drivers for a season; 503 when unavailable","parameters":{"year":{"type":"integer","description":"Season year","in":"path","minimum":1950,"maximum":2027}}},"/api/standings/leader":{"method":"GET","description":"Driver and constructor championship leaders; has_data=false when standings are unavailable","parameters":{"year":{"type":"integer","description":"Season year","in":"query","minimum":1950,"maximum":2027,"default":2026,"optional":true}}},"/api/standings/leader/{year}":{"method":"GET","description":"Driver and constructor championship leaders for a season; has_data=false when standings are unavailable","parameters":{"year":{"type":"integer","description":"Season year","in":"path","minimum":1950,"maximum":2027}}},"/health":{"method":"GET","description":"Process liveness check"},"/health/ready":{"method":"GET","description":"SQLite, persistent storage, and generation readiness check"}},"e_ink_usage":{"description":"For E-Ink displays, fetch /calendar.bmp and display directly","recommended_refresh":"Every 1-6 hours (images regenerate hourly)","display_compatibility":"800x480 E-Ink displays using the matching display output mode"}}