API 文档
为 E-Ink 显示器生成 800×480 BMP 图像,以 1bit、B/W/R、B/W/R/Y 或 Spectra 6 模式显示 F1 比赛赛程。
GET
/calendar.bmp
将 F1 赛历生成为 BMP 图片 (800×480),适用于 1bit、4-bit B/W/R、4-bit B/W/R/Y 和 Spectra 6 E-Ink 显示器。
未同时指定 year 和 round 或 race_key 时,将选择下一场比赛。请从 /api/races/{year} 复制 round 或 race_key。 例外:指定 race_key 但未提供 year 时返回 HTTP 400。
赛道风格: track_style=relief · 地图来源: track_source=jules · 强调色: track_accent=all.
高度和色彩分区仅为装饰。仅使用屏幕支持的颜色。 使用全部四色时请设置 display=spectra6.
GET /api/tracks — 所有风格、颜色和赛道. GET /api/tracks/{circuit_id} — 作者与许可.
GET /api/tracks/{circuit_id}.{svg|png|bmp} · GET /preview/configure/calendar.png — 相同的 track_style、track_source、track_accent 参数.
参数
| Parameter | 类型 | 说明 |
|---|---|---|
| lang | string |
日历文本的语言代码
可选值: cs, de, en, es, fr, it, ja, nl, pl, pt-BR, sk, tr, zh-CN (默认:
en)
|
| year | integer |
指定比赛的赛季年份
可选 — 例如 2026
|
| round | integer |
赛季比赛列表中的轮次编号;未提供 year 时忽略
可选 — 例如 ?year=2026&round=5
|
| race_key | string |
来自 /api/races/{year} 的比赛标识符;需要 year
可选 — 例如 2026-round-6-monaco-2026-06-07
|
| tz | string |
赛程时间使用的时区 (IANA 格式)
可选 — 例如 America/New_York,
Europe/Prague
(默认: Europe/Prague)
|
| display | string |
适用于 1bit、B/W/R、B/W/R/Y 或 Spectra 6 显示器的输出模式
可选值: 1bit,
bwr,
bwry,
spectra6 (默认:
1bit)
|
| weather | boolean |
启用或禁用天气叠加层
可选值: true,
false
(默认: true)
|
| weather_type | string |
要渲染的天气数据类型
可选值: off,
race_day,
race,
current
(默认: race_day)
|
| track_style | string |
赛道风格
可选值: relief, poster, clean, lino, riso, screenprint, contours, geometric, blueprint, ribbon, mosaic, halftone, negative, papercut, typographic, artdeco, stencil, pixel
(默认: relief)
|
| track_source | string |
地图来源
可选值: jules, commons
(默认: jules)
|
| track_accent | string |
强调色
可选值: 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
(默认: all)
|
响应
image/bmp
800×480
1bit / 4-bit B/W/R / 4-bit B/W/R/Y / Spectra 6
public, max-age=3600
BMP 响应包含 ETag。发送 If-None-Match,图片未更改时将收到 304。
代码示例
# Download next race calendar
curl -o calendar.bmp "https://f1.inkycloud.click/calendar.bmp"
# With Czech language and timezone
curl -o calendar.bmp "https://f1.inkycloud.click/calendar.bmp?lang=cs&tz=Europe/Prague"
# Specific race (year and round)
curl -o calendar.bmp "https://f1.inkycloud.click/calendar.bmp?year=2026&round=6"
# B/W/R/Y output for four-color E-Ink
curl -o calendar.bmp "https://f1.inkycloud.click/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.inkycloud.click/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.inkycloud.click/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 在 zivyobraz.eu 中选择内容来源:图片 URL
-
2
粘贴 URL:
https://f1.inkycloud.click/calendar.bmp?lang=cs&tz=Europe/Prague - 3 将刷新间隔设置为 1-6 小时
GET
/teams.bmp
生成 BMP 图片,以 1bit、B/W/R、B/W/R/Y 或 Spectra 6 输出模式显示所有 F1 车队、车手、照片和积分。
图片署名与许可(赛道图稿 CC BY 4.0,Open-Meteo 天气数据 CC BY 4.0):参见 Credits。响应还包含带 rel="license" 的 Link 标头。
参数
| 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)
|
| extra | string | 可选面板:none(默认)、countdown、flags、track、weather。仅使用本地赛季数据和缓存天气;不可用时不显示面板。 |
| tz | string | Optional IANA timezone for extra panels showing a time or date: countdown, flags, track, weather. Defaults to the server's DEFAULT_TIMEZONE; ignored for none or unavailable panels. Invalid values return HTTP 400. Also supported by /preview/configure/teams.png. |
响应
image/bmp
800×480
1-bit / 4-bit / Spectra 6
no-cache
其他端点
/api/teams/{year}
获取某赛季所有车队及车手和积分(JSON)
/api/standings/leader
获取当前锦标赛领先者(车手和车队)
/api/standings/leader/{year}
/api/races/{year}
指定赛季的全部比赛列表
/api/race/{year}/{round}
包含赛程的详细比赛信息
/api/stats
最近 24 小时的请求统计
GET /api/stats/history
每小时请求历史;limit:1–720(默认 168)。
GET / POST /api/perf-metrics
GET:性能汇总;hours:1–720(默认 24)。POST:Web Vitals 数值;访客和设备元数据将被忽略。
GET /preview/{screen_type}.png
GET /preview/configure/{screen_type}.png
日历或车队的 PNG 预览;lang 选择语言。配置预览还接受 display,以及日历的 weather_type(默认 off)。
extra — 可选面板:none(默认)、countdown、flags、track、weather。仅使用本地赛季数据和缓存天气;不可用时不显示面板。
track_style, track_source, track_accent — 赛道风格, 地图来源, 强调色 (calendar).
GET /health/ready
检查数据库、可写存储和图片的新鲜度;就绪时返回 HTTP 200,否则返回 503。
/health
服务健康检查
配置 ADMIN_API_TOKEN 后,统计读取 API 需要 X-Admin-Token 或 Authorization: Bearer <token>。设置 MINIMAL_DATA_MODE=true 时,所有统计 API 均返回 410。
超过请求频率限制的请求返回 429,并附带 Retry-After。