Skip to content

Stats Service

The Stats service provides comprehensive access to member statistics, season standings, time trial results, qualifying results, and world records.

const statsService = iracing.stats;

Get a member’s personal best lap times.

Returns: Promise<StatsMemberBestsResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)
  • carId?: number - Filter to a specific car

Description: Returns the member’s personal best lap times across all tracks.


Get a member’s career statistics.

Returns: Promise<StatsMemberCareerResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)

Description: Returns career-wide statistics including starts, wins, top fives, and more.


Get division statistics for a member.

Returns: Promise<StatsMemberDivisionResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • eventType: number (required) - The event type

Description: Returns the member’s division-level statistics for a specific season and event type.


Get a member’s season recap.

Returns: Promise<StatsMemberRecapResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)
  • year?: number - Filter by year
  • season?: number - Filter by season quarter (1-4)

Description: Returns a recap of the member’s performance for a season or year.


Get a member’s recent race results.

Returns: Promise<StatsMemberRecentRacesResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)

Description: Returns the member’s most recent race results.


Get a quick summary of a member’s statistics.

Returns: Promise<StatsMemberSummaryResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)

Description: Returns a concise summary of the member’s racing statistics.


Get a member’s yearly statistics.

Returns: Promise<StatsMemberYearlyResponse>

Parameters:

  • custId?: number - Customer ID (defaults to authenticated user)

Description: Returns yearly aggregated statistics for the member.

Get driver standings for a season.

Returns: Promise<StatsSeasonDriverStandingsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • division?: number - Filter by division
  • raceWeekNum?: number - Standings up to a specific week

Description: Returns driver championship standings for a specific season and car class.

The SDK validates seasonId + carClassId as a known pair before calling the API when validateSemanticParams is enabled.


Get supersession standings for a season.

Returns: Promise<StatsSeasonSupersessionStandingsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • division?: number - Filter by division
  • raceWeekNum?: number - Standings up to a specific week

Description: Returns supersession standings for a specific season and car class.

The SDK validates seasonId + carClassId as a known pair before calling the API when validateSemanticParams is enabled.


Get team standings for a season.

Returns: Promise<StatsSeasonTeamStandingsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • raceWeekNum?: number - Standings up to a specific week

Description: Returns team championship standings for a specific season and car class.

The SDK performs an additional semantic preflight check for this endpoint when validateSemanticParams is enabled (default). It verifies that seasonId and carClassId form a known valid pair from series metadata and throws an IRacingError with status 400 before making the request when the pair is invalid.

Get time trial standings for a season.

Returns: Promise<StatsSeasonTtStandingsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • division?: number - Filter by division
  • raceWeekNum?: number - Standings up to a specific week

Description: Returns time trial standings for a specific season and car class.

The SDK validates seasonId + carClassId as a known pair before calling the API when validateSemanticParams is enabled.


Get time trial results for a specific week.

Returns: Promise<StatsSeasonTtResultsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • raceWeekNum: number (required) - The race week number
  • division?: number - Filter by division

Description: Returns time trial results for a specific week in a season.

The SDK validates seasonId + carClassId as a known pair before calling the API when validateSemanticParams is enabled.


Get qualifying results for a specific week.

Returns: Promise<StatsSeasonQualifyResultsResponse>

Parameters:

  • seasonId: number (required) - The season ID
  • carClassId: number (required) - The car class ID
  • raceWeekNum: number (required) - The race week number
  • division?: number - Filter by division

Description: Returns qualifying results for a specific week in a season.

The SDK validates seasonId + carClassId as a known pair before calling the API when validateSemanticParams is enabled.

Get world records for a car/track combination.

Returns: Promise<StatsWorldRecordsResponse>

Parameters:

  • carId: number (required) - The car ID
  • trackId: number (required) - The track ID
  • seasonYear?: number - Filter by year
  • seasonQuarter?: number - Filter by quarter (1-4)

Description: Returns the world record lap times for a specific car and track combination.

async function getDriverProfile(custId: number) {
const [career, bests, recentRaces, summary] = await Promise.all([
iracing.stats.memberCareer({ custId }),
iracing.stats.memberBests({ custId }),
iracing.stats.memberRecentRaces({ custId }),
iracing.stats.memberSummary({ custId }),
]);
return { career, bests, recentRaces, summary };
}
async function getSeasonProgress(seasonId: number, carClassId: number) {
const [driverStandings, teamStandings, ttStandings] = await Promise.all([
iracing.stats.seasonDriverStandings({ seasonId, carClassId }),
iracing.stats.seasonTeamStandings({ seasonId, carClassId }),
iracing.stats.seasonTtStandings({ seasonId, carClassId }),
]);
return { driverStandings, teamStandings, ttStandings };
}