Public
Like
F1Rankings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A REST API that provides current Formula 1 championship standings for both drivers and constructors. The API attempts to fetch real-time data from live F1 sources and falls back to current 2024 season data when live APIs are unavailable.
- Real-time data attempts: Tries to fetch live F1 data from multiple sources
- Reliable fallback: Uses current 2024 F1 season data when live APIs are unavailable
- Multiple endpoints: Separate endpoints for drivers, constructors, or both
- Clean JSON responses: Well-structured data with metadata
- CORS enabled: Works with web applications
- Health check: Monitor API status
Returns both driver and constructor standings in a single response.
Response:
{ "season": "2024", "drivers": [ { "position": 1, "driver": "Max Verstappen", "nationality": "Dutch", "team": "Red Bull Racing", "points": 393, "wins": 9 } // ... more drivers ], "constructors": [ { "position": 1, "constructor": "McLaren", "nationality": "British", "points": 593, "wins": 5 } // ... more constructors ], "source": "Static data (Live API unavailable)", "note": "This data reflects the 2024 F1 season standings as of October 2024...", "lastUpdated": "2024-10-10T00:00:00Z" }
Returns only the driver championship standings.
Response:
{ "season": "2024", "standings": [ { "position": 1, "driver": "Max Verstappen", "nationality": "Dutch", "team": "Red Bull Racing", "points": 393, "wins": 9 } // ... more drivers (complete top 20) ], "source": "Static data (Live API unavailable)", "note": "This data reflects the 2024 F1 season standings...", "lastUpdated": "2024-10-10T00:00:00Z" }
Returns only the constructor championship standings.
Response:
{ "season": "2024", "standings": [ { "position": 1, "constructor": "McLaren", "nationality": "British", "points": 593, "wins": 5 } // ... more constructors (complete top 10) ], "source": "Static data (Live API unavailable)", "note": "This data reflects the 2024 F1 season standings...", "lastUpdated": "2024-10-10T00:00:00Z" }
Health check endpoint for monitoring.
Response:
{ "status": "healthy", "timestamp": "2024-10-10T02:02:41.123Z", "version": "1.0.0" }
position
: Championship position (number)driver
: Full name of the driver (string)nationality
: Driver's nationality (string)team
: Constructor/team name (string)points
: Total championship points (number)wins
: Number of race wins (number)
position
: Championship position (number)constructor
: Team/constructor name (string)nationality
: Constructor's nationality (string)points
: Total championship points (number)wins
: Number of race wins (number)
season
: F1 season year (string)source
: Data source information (string)note
: Additional context about the data (string, optional)lastUpdated
: ISO timestamp of last data update (string)
# Get all standings curl https://your-val-url.web.val.run/ # Get only driver standings curl https://your-val-url.web.val.run/drivers # Get only constructor standings curl https://your-val-url.web.val.run/constructors # Health check curl https://your-val-url.web.val.run/health
- Primary: Ergast F1 API (HTTPS)
- Secondary: Ergast F1 API (HTTP)
- Fallback: Current 2024 F1 season data
The API includes up-to-date 2024 F1 championship standings including:
- Driver Championship: Max Verstappen leading with 393 points
- Constructor Championship: McLaren leading with 593 points
- Complete standings for all 20 drivers and 10 constructors
- Graceful fallback when live APIs are unavailable
- Timeout protection (5 seconds per API call)
- Detailed logging for debugging
- Clear source attribution in responses
- Framework: Hono (fast HTTP framework)
- Runtime: Deno on Val Town
- Language: TypeScript
- APIs: Ergast F1 API (when available)
- Integration with additional F1 data sources
- Caching layer for improved performance
- Historical season data endpoints
- Race results and calendar information
- WebSocket support for real-time updates
- Rate limiting for production use
- The API prioritizes reliability over real-time accuracy
- Fallback data is manually curated and reflects recent F1 standings
- Live API integration attempts are made on every request
- All timestamps are in ISO 8601 format