Skip to content

Introduction

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 property
iracing.member // Member-related endpoints
iracing.series // Series and seasons data
iracing.results // Race results and lap data
iracing.stats // Statistics and standings
iracing.car // Car information and assets
iracing.track // Track data and configurations
iracing.league // League management
iracing.hosted // Hosted session data
// ... and many more
// Full IntelliSense support
const member = await iracing.member.get({
custIds: [123456]
});
// Type-safe access to response data
console.log(member.members[0].displayName);
console.log(member.members[0].licenses[0].irating);
// Compile-time error checking
member.members[0].wrongProperty; // ❌ TypeScript Error

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 performance
const stats = await iracing.stats.memberCareer({
custId: 123456
});

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