🚀 Auto-Generated
Automatically generated from the official iRacing API documentation, ensuring complete coverage and staying up-to-date with API changes.
The iRacing Data Client is a comprehensive TypeScript SDK for interacting with the iRacing Data API. It provides a fully typed, auto-generated client that makes it easy to access iRacing’s extensive data services.
The iRacing Data API is the official REST API provided by iRacing.com that allows developers to access racing data, member information, session results, and more. This API powers many community tools and applications in the iRacing ecosystem.
🚀 Auto-Generated
Automatically generated from the official iRacing API documentation, ensuring complete coverage and staying up-to-date with API changes.
📘 TypeScript First
Every API response is fully typed with IntelliSense support, compile-time checking, and Zod validation.
🔐 OAuth2 Auth
Handles iRacing’s OAuth2 authentication automatically with token management and automatic refresh.
⚡ Performance
S3 link following, intelligent error handling, and response caching (coming soon) for optimal performance.
The SDK is organized into service classes, each corresponding to a specific area of the iRacing API:
const iracing = new IRacingDataClient(options);
// Each service is accessible as a propertyiracing.member // Member-related endpointsiracing.series // Series and seasons datairacing.results // Race results and lap datairacing.stats // Statistics and standingsiracing.car // Car information and assetsiracing.track // Track data and configurationsiracing.league // League managementiracing.hosted // Hosted session data// ... and many more// Full IntelliSense supportconst member = await iracing.member.get({ custIds: [123456]});
// Type-safe access to response dataconsole.log(member.members[0].displayName);console.log(member.members[0].licenses[0].irating);
// Compile-time error checkingmember.members[0].wrongProperty; // ❌ TypeScript Errorinterface MemberInfo { custId: number; displayName: string; helmet: HelmetData; licenses: License[]; memberSince: string; clubs: Club[]; // ... and much more}The SDK automatically handles:
Case Conversion
Converts between snake_case (API) and camelCase (SDK) automatically
S3 Presigned URLs
Transparently follows iRacing’s S3 redirect pattern for data access
Parameter Validation
Validates all parameters using Zod schemas before sending requests
Response Caching *(coming soon)*
Will intelligently cache responses based on API-provided expiration headers
try { const data = await iracing.member.info();} catch (error) { if (error instanceof IRacingError) { if (error.isMaintenanceMode) { console.log("iRacing is in maintenance mode"); } else if (error.isRateLimited) { console.log("Rate limited, please slow down"); } else if (error.isUnauthorized) { console.log("Authentication failed"); } }}Perfect for analyzing racing performance, creating statistical models, and tracking improvement over time.
// Analyze driver performanceconst stats = await iracing.stats.memberCareer({ custId: 123456});Automate league operations, manage rosters, and track standings.
// Get league standingsconst standings = await iracing.league.seasonStandings({ leagueId: 789, seasonId: 456});Build Discord bots that provide real-time racing information.
// Get recent race resultsconst races = await iracing.stats.memberRecentRaces({ custId: memberId});Create web applications for the iRacing community.
// Search for hosted sessionsconst sessions = await iracing.results.searchHosted({ startRangeBegin: new Date()});72+ Endpoints
Complete coverage of all iRacing Data API endpoints
15 Service Classes
Logically organized services for different API areas
Full Type Definitions
TypeScript types for every request and response
Zod Validation
Runtime validation for all API parameters
Smart Caching *(coming soon)*
Response caching with automatic expiration
Error Types
Specific error handling for different scenarios
Installation
Get the Data Client installed in your project
Quick Start
See a complete working example