API & embeds
API & embed contracts
f1-proxy edge function
All upstream traffic funnels through web/src/lib/api/f1ApiFetch.ts → Supabase f1-proxy (when VITE_F1_PROXY_ENABLED=true) with a Postgres api_cache layer: 8s timeout, stale fallback, api_metrics logging, per-path TTLs (supabase/functions/_shared/cacheTtl.ts). Client never paginates Jolpica — laps/pitstops pagination happens server-side at ingest.
Vercel rewrites (vercel.json)
/api/ergast/:path* → https://api.jolpi.ca/ergast/:path* (same-origin, no CORS)
/api/openf1/:path* → https://api.openf1.org/v1/:path* (same-origin, no CORS)
bot user-agents → /api/og (social preview image)
Optional same-origin bases: VITE_ERGAST_BASE=/api/ergast, VITE_OPENF1_BASE=/api/openf1.
Embeddable widgets
Source: web/docs/README-embed.md. Free to use with attribution; data subject to upstream terms.
<iframe src="https://www.f1datastop.com/embed/driver-standings?season=2025&theme=dark"
width="400" height="600"></iframe>
| Endpoint | Shows |
|---|---|
/embed | overview |
/embed/driver-standings | driver standings |
/embed/constructor-standings | constructor standings |
| Param | Options | Default |
|---|---|---|
season | 1950–present | current year |
theme | light | dark | light |
font | any web-safe font (URL-encoded) | Inter |
Self-contained iframes (no external CSS/JS needed), responsive at width="100%", minimal F1 DataStop attribution footer. CSP must allow iframes from the app host.