API 文档

为 E-Ink 显示器生成 800×480 BMP 图像,以 1bit、B/W/R 或 Spectra 6 模式显示 F1 比赛赛程。

800×480 BMP 1bit / B/W/R / B/W/R/Y / Spectra 6 E-Ink REST API
GET /calendar.bmp

将 F1 赛历生成为 BMP 图片 (800×480),适用于 1bit、4-bit B/W/R、4-bit B/W/R/Y 和 Spectra 6 E-Ink 显示器。

参数

Parameter 类型 说明
lang string 日历文本的语言代码
可选值: cs, de, en, es, fr, it, ja, nl, pl, pt-BR, sk, tr, zh-CN (默认: en)
year integer 指定比赛的赛季年份
可选 — 例如 2026
round integer 指定比赛的轮次编号 (1-24)
可选 — 例如 5
tz string 赛程时间使用的时区 (IANA 格式)
可选 — 例如 America/New_York, Europe/Prague
display string 适用于 1bit、B/W/R、B/W/R/Y 或 Spectra 6 显示器的输出模式
可选值: 1bit, bwr, bwry, spectra6 (默认: 1bit)
weather boolean 启用或禁用天气叠加层
可选值: true, false
weather_type string 要渲染的天气数据类型
可选值: race_day, current

响应

Content-Type image/bmp
尺寸 800×480
色深 1bit / 4-bit B/W/R / 4-bit B/W/R/Y / Spectra 6
Cache 1 hour
打开图片

代码示例

# Download next race calendar
curl -o calendar.bmp "https://f1.rhiz3k.freeddns.org/calendar.bmp"

# With Czech language and timezone
curl -o calendar.bmp "https://f1.rhiz3k.freeddns.org/calendar.bmp?lang=cs&tz=Europe/Prague"

# Specific race (year and round)
curl -o calendar.bmp "https://f1.rhiz3k.freeddns.org/calendar.bmp?year=2025&round=5"

# B/W/R/Y output for four-color E-Ink
curl -o calendar.bmp "https://f1.rhiz3k.freeddns.org/calendar.bmp?display=bwry"
import httpx

async def get_f1_calendar(lang: str = "en", tz: str = "Europe/Prague"):
    """Download F1 calendar as BMP image."""
    async with httpx.AsyncClient() as client:
        response = await client.get(
            "https://f1.rhiz3k.freeddns.org/calendar.bmp",
            params={"lang": lang, "tz": tz}
        )
        response.raise_for_status()

        with open("calendar.bmp", "wb") as f:
            f.write(response.content)

        print("Calendar saved as calendar.bmp")

# Usage
import asyncio
asyncio.run(get_f1_calendar(lang="cs"))
// Fetch and display calendar
async function loadF1Calendar(lang = 'en', tz = 'Europe/Prague') {
    const url = new URL('https://f1.rhiz3k.freeddns.org/calendar.bmp');
    url.searchParams.set('lang', lang);
    url.searchParams.set('tz', tz);

    const response = await fetch(url);
    const blob = await response.blob();

    // Display in img element
    const img = document.getElementById('calendar');
    img.src = URL.createObjectURL(blob);
}

// Download as file
async function downloadCalendar() {
    const response = await fetch('/calendar.bmp?lang=cs');
    const blob = await response.blob();

    const link = document.createElement('a');
    link.href = URL.createObjectURL(blob);
    link.download = 'f1-calendar.bmp';
    link.click();
}

E-Ink 显示器使用方式

获取 /calendar.bmp 并直接显示在您的 E-Ink 显示器上。建议刷新间隔:每 1 到 6 小时一次。兼容任意 800×480 的 E-Ink 显示器(例如 Waveshare 7.5"、LaskaKit)。

适用于 LaskaKit / zivyobraz.eu:

  1. 1 在 zivyobraz.eu 中选择内容来源:图片 URL
  2. 2 粘贴 URL: https://f1.rhiz3k.freeddns.org/calendar.bmp?lang=cs&tz=Europe/Prague
  3. 3 将刷新间隔设置为 1-6 小时
GET /teams.bmp

生成 BMP 图片,以 1bit、B/W/R、B/W/R/Y 或 Spectra 6 输出模式显示所有 F1 车队、车手、照片和积分。

参数

Parameter 类型 说明
lang string 日历文本的语言代码
可选值: cs, de, en, es, fr, it, ja, nl, pl, pt-BR, sk, tr, zh-CN (默认: en)
year integer 车队数据的赛季年份
可选 — 例如 2026
display string 显示输出模式
可选值: 1bit, bwr, bwry, spectra6 (默认: 1bit)

响应

Content-Type image/bmp
尺寸 800×480
色深 1-bit / 4-bit / Spectra 6
Cache no-store
打开图片

其他端点

GET /api/teams/{year}

获取某赛季所有车队及车手和积分(JSON)

GET /api/standings/leader

获取当前锦标赛领先者(车手和车队)

GET /api/races/{year}

指定赛季的全部比赛列表

GET /api/race/{year}/{round}

包含赛程的详细比赛信息

GET /api/stats

请求统计(最近 1 小时和 24 小时)

GET /health

服务健康检查

GET /api

JSON API — JSON 格式的 API 文档