Interface IDataClient
Main client to access the iRacing "/data" API endpoints.
Namespace: Aydsko.iRacingData
Assembly: Aydsko.iRacingData.dll
Syntax
public interface IDataClientMethods
GetBestLapStatisticsAsync(int?, int?, CancellationToken)
The best laps in various cars and tracks for the given customer's career or that or the authenticated user.
Declaration
Task<DataResponse<MemberBests>> GetBestLapStatisticsAsync(int? customerId = null, int? carId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| int? | carId | Car to return statistics for. Should pass null for the first call and then should be an identifier from CarsDriven. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberBests>> | A DataResponse<TData> containing the best laps in a MemberBests object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCarAssetDetailsAsync(CancellationToken)
Retrieves details about the car assets, including image paths and descriptions.
Declaration
Task<DataResponse<IReadOnlyDictionary<string, CarAssetDetail>>> GetCarAssetDetailsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<IReadOnlyDictionary<string, CarAssetDetail>>> | A DataResponse<TData> containing a dictionary which maps the car identifier to a CarAssetDetail object for each car. | 
Remarks
All image paths are relative to https://images-static.iracing.com.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCarClassesAsync(CancellationToken)
Retrieves details about the car classes.
Declaration
Task<DataResponse<CarClass[]>> GetCarClassesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<CarClass[]>> | A DataResponse<TData> containing an array of CarClass objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCareerStatisticsAsync(int?, CancellationToken)
Return a summary of statistics for the given customer's career or that or the authenticated user.
Declaration
Task<DataResponse<MemberCareer>> GetCareerStatisticsAsync(int? customerId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberCareer>> | A DataResponse<TData> containing the statistics in a MemberCareer object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCarsAsync(CancellationToken)
Retrieves details about the cars.
Declaration
Task<DataResponse<CarInfo[]>> GetCarsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<CarInfo[]>> | A DataResponse<TData> containing an array of CarInfo objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCategoriesAsync(CancellationToken)
Retrieves a list of the iRacing Race Categories.
Declaration
Task<DataResponse<Category[]>> GetCategoriesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<Category[]>> | A DataResponse<TData> containing an array of Category objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCountriesAsync(CancellationToken)
Retrieves a list of country lookup values.
Declaration
Task<DataResponse<Country[]>> GetCountriesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<Country[]>> | A DataResponse<TData> containing an array of Country objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetCustomerLeagueSessionsAsync(bool, int?, CancellationToken)
Retrieves customer league sessions
Declaration
Task<DataResponse<CustomerLeagueSessions>> GetCustomerLeagueSessionsAsync(bool mine = false, int? packageId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| bool | mine | If true, return only sessions created by this user. | 
| int? | packageId | If set, return only sessions using this car or track package ID. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<CustomerLeagueSessions>> | A DataResponse<TData> containing an array of CustomerLeagueSessions objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetDivisionsAsync(CancellationToken)
Retrieves a list of the iRacing Divisions.
Declaration
Task<DataResponse<Division[]>> GetDivisionsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<Division[]>> | A DataResponse<TData> containing an array of Division objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetDriverAwardInstanceAsync(int, CancellationToken)
Retrieve information about a particular award.
Declaration
Task<DataResponse<MemberAwardInstance>> GetDriverAwardInstanceAsync(int awardId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | awardId | An award identifier. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberAwardInstance>> | A DataResponse<TData> containing a MemberAwardInstance object with details of the award. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetDriverAwardsAsync(int?, CancellationToken)
Retrieve the awards earned by the given customer or the currently authenticated user.
Declaration
Task<DataResponse<MemberAward[]>> GetDriverAwardsAsync(int? customerId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | A customer identifier to retrieve awards for or leave as null to default to the currently authenticated user. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberAward[]>> | A DataResponse<TData> containing an array of MemberAward objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetDriverInfoAsync(int[], bool, CancellationToken)
Retrieve information about one or more other drivers by their customer identifier.
Declaration
Task<DataResponse<DriverInfo[]>> GetDriverInfoAsync(int[] customerIds, bool includeLicenses, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int[] | customerIds | An array of one or more customer identifiers. | 
| bool | includeLicenses | Indicates if license information should be included. Either true or false to exclude for performance purposes. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<DriverInfo[]>> | A DataResponse<TData> containing an array of DriverInfo objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetDriverStatisticsByCategoryCsvAsync(int, CancellationToken)
Retrieve a comma separated value (CSV) file containing driver statistics for the given category.
Declaration
Task<DriverStatisticsCsvFile> GetDriverStatisticsByCategoryCsvAsync(int categoryId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | categoryId | A valid category identifier. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DriverStatisticsCsvFile> | A Task that resolves to the content of the CSV. | 
See Also
GetEventTypesAsync(CancellationToken)
Retrieves a list of the iRacing Event Types.
Declaration
Task<DataResponse<EventType[]>> GetEventTypesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<EventType[]>> | A DataResponse<TData> containing an array of EventType objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetFlairsAsync(CancellationToken)
Information about the driver flair, or country flag, items available in the system.
Declaration
Task<DataResponse<FlairLookupResponse>> GetFlairsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<FlairLookupResponse>> | A DataResponse<TData> containing a FlairLookupResponse object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeagueAsync(int, bool, CancellationToken)
Get information about a league.
Declaration
Task<DataResponse<League>> GetLeagueAsync(int leagueId, bool includeLicenses = false, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | leagueId | The unique identifier for the league. | 
| bool | includeLicenses | Indicates if license information should be included. Either true or false to exclude for performance purposes. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<League>> | A DataResponse<TData> containing the season and optionally series detail in a Track array. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeagueMembershipAsync(bool, CancellationToken)
Retrieves league membership.
Declaration
Task<DataResponse<LeagueMembership[]>> GetLeagueMembershipAsync(bool includeLeague = false, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| bool | includeLeague | Indicates if league information should be included. Either true or false to exclude for performance purposes. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeagueMembership[]>> | A DataResponse<TData> containing an array of LeagueMembership objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeagueMembershipAsync(int, bool, CancellationToken)
Retrieves league membership.
Declaration
Task<DataResponse<LeagueMembership[]>> GetLeagueMembershipAsync(int customerId, bool includeLeague = false, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | customerId | The customer for which membership should be retrieved. | 
| bool | includeLeague | Indicates if league information should be included. Either true or false to exclude for performance purposes. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeagueMembership[]>> | A DataResponse<TData> containing an array of LeagueMembership objects. | 
Remarks
If the value passed for customerId is different from the authenticated member, the following restrictions apply:
- Caller cannot be on requested customer's block list or an empty list will result;
- Requested customer cannot have their online activity preference set to hidden or an empty list will result;
- Only leagues for which the requested customer is an admin and the league roster is not private are returned.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeaguePointsSystemsAsync(int, int?, CancellationToken)
Get information about the points systems available to a league.
Declaration
Task<DataResponse<LeaguePointsSystems>> GetLeaguePointsSystemsAsync(int leagueId, int? seasonId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | leagueId | The unique identifier for the league. | 
| int? | seasonId | If included and the season is using custom points then the custom points option is included in the returned list. Otherwise the custom points option is not returned. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeaguePointsSystems>> | A DataResponse<TData> containing the league point system information in a LeaguePointsSystems object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeagueSeasonSessionsAsync(int, int, bool, CancellationToken)
Retrieves league's season's sessions
Declaration
Task<DataResponse<LeagueSeasonSessions>> GetLeagueSeasonSessionsAsync(int leagueId, int seasonId, bool resultsOnly = false, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | leagueId | League Id to return sessions for. | 
| int | seasonId | Season Id to return sessions for. | 
| bool | resultsOnly | If true include only sessions which results are available. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeagueSeasonSessions>> | A DataResponse<TData> containing an array of LeagueSeasonSessions objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLeagueSeasonsAsync(int, bool, CancellationToken)
Retrieves league's seasons
Declaration
Task<DataResponse<LeagueSeasons>> GetLeagueSeasonsAsync(int leagueId, bool includeRetired = false, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | leagueId | League Id to return seasons for. | 
| bool | includeRetired | If true include seasons which are no longer active. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeagueSeasons>> | A DataResponse<TData> containing an array of LeagueSeasons objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLicenseLookupsAsync(CancellationToken)
Information about license levels available in the iRacing system.
Declaration
Task<DataResponse<LicenseLookup[]>> GetLicenseLookupsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LicenseLookup[]>> | A DataResponse<TData> containing an array of LicenseLookup objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetLookupsAsync(CancellationToken)
Information about reference data defined by the system.
Declaration
Task<DataResponse<LookupGroup[]>> GetLookupsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LookupGroup[]>> | A DataResponse<TData> containing an array of LookupGroup objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberChartData(int?, int, MemberChartType, CancellationToken)
Declaration
[Obsolete("Use \"GetMemberChartDataAsync\" instead.")]
Task<DataResponse<MemberChart>> GetMemberChartData(int? customerId, int categoryId, MemberChartType chartType, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | |
| int | categoryId | |
| MemberChartType | chartType | |
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberChart>> | 
GetMemberChartDataAsync(int?, int, MemberChartType, CancellationToken)
Obtains the source data to generate charts about a customer's account.
Declaration
Task<DataResponse<MemberChart>> GetMemberChartDataAsync(int? customerId, int categoryId, MemberChartType chartType, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| int | categoryId | The category the chart data should be for. 1 - Oval; 2 - Road; 3 - Dirt oval; 4 - Dirt road | 
| MemberChartType | chartType | Data to return in the chart. 1 - iRating; 2 - TT Rating; 3 - License/SR | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberChart>> | A DataResponse<TData> containing the MemberChart information. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberDivisionAsync(int, EventType, CancellationToken)
Retrieve information about the authenticated member's division.
Declaration
Task<DataResponse<MemberDivision>> GetMemberDivisionAsync(int seasonId, EventType eventType, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| EventType | eventType | |
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberDivision>> | A MemberDivision object containing the result. | 
Remarks
Divisions are 0-based: 0 is Division 1, 10 is Rookie. See GetDivisionsAsync(CancellationToken) for more information.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberParticipationCreditsAsync(CancellationToken)
Retrieves the current member's participation credit status.
Declaration
Task<DataResponse<ParticipationCredits[]>> GetMemberParticipationCreditsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<ParticipationCredits[]>> | A DataResponse<TData> containing an array of ParticipationCredits objects. | 
Remarks
Always returns information for the currently authenticated member.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberProfileAsync(int?, CancellationToken)
Retrieve the MemberProfile representing details about a driver.
Declaration
Task<DataResponse<MemberProfile>> GetMemberProfileAsync(int? customerId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberProfile>> | A DataResponse<TData> containing the statistics in a MemberInfo object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberRecapAsync(int?, int?, int?, CancellationToken)
Retrieve a summary of the given period for the given driver or currently authenticated member.
Declaration
Task<DataResponse<MemberRecap>> GetMemberRecapAsync(int? customerId = null, int? seasonYear = null, int? seasonQuarter = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | Optional, if supplied returns statistics for this iRacing Customer Id. Defaults to the currently authenticated user's Customer Id. | 
| int? | seasonYear | Optional, if supplied limits times to the given year. Defaults to the current calendar year. | 
| int? | seasonQuarter | Optional, if supplied limits times to a given quarter. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberRecap>> | A DataResponse<TData> containing a MemberRecap object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberRecentRacesAsync(int?, CancellationToken)
Retrieve the recent race participation for the currently authenticated member.
Declaration
Task<DataResponse<MemberRecentRaces>> GetMemberRecentRacesAsync(int? customerId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberRecentRaces>> | A DataResponse<TData> containing the member's recent races in a MemberRecentRaces object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberSummaryAsync(int?, CancellationToken)
Retrieve overall summary figures for the customerId given or the current authenticated user.
Declaration
Task<DataResponse<MemberSummary>> GetMemberSummaryAsync(int? customerId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | customerId | iRacing Customer Id for the member to return statistics for, or null for the currently authenticated user. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberSummary>> | A DataResponse<TData> containing the member's recent races in a MemberRecentRaces object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMemberYearlyStatisticsAsync(CancellationToken)
Retrieve the statistics for the currently authenticated member, grouped by year.
Declaration
Task<DataResponse<MemberYearlyStatistics>> GetMemberYearlyStatisticsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberYearlyStatistics>> | A DataResponse<TData> containing the member's statistics in a MemberYearlyStatistics object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetMyInfoAsync(CancellationToken)
Retrieve the MemberInfo for the currently authenticated user.
Declaration
Task<DataResponse<MemberInfo>> GetMyInfoAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<MemberInfo>> | A DataResponse<TData> containing the statistics in a MemberInfo object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetPastSeasonsForSeriesAsync(int, CancellationToken)
Get all seasons for a series.
Declaration
Task<DataResponse<PastSeriesDetail>> GetPastSeasonsForSeriesAsync(int seriesId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seriesId | The series identifier to return seasons for. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<PastSeriesDetail>> | A DataResponse<TData> containing an array of Country objects. | 
Remarks
Filter list by official:true for seasons with standings.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetRaceGuideAsync(DateTimeOffset?, bool?, CancellationToken)
Find sessions that begin or end after the given time.
Declaration
Task<DataResponse<RaceGuideResults>> GetRaceGuideAsync(DateTimeOffset? from = null, bool? includeEndAfterFrom = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| DateTimeOffset? | from | Optional instant to search from. Must be a time in the future. Defaults to the current instant. | 
| bool? | includeEndAfterFrom | If true include sessions which begin before the  | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<RaceGuideResults>> | A DataResponse<TData> containing the search's results as a RaceGuideResults object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonDriverStandingsAsync(int, int, int?, int?, CancellationToken)
Retrieve the driver standings for a season.
Declaration
Task<DataResponse<(SeasonDriverStandingsHeader Header, SeasonDriverStanding[] Standings)>> GetSeasonDriverStandingsAsync(int seasonId, int carClassId, int? raceWeekIndex = null, int? division = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| int? | division | Division to search. Note that divisions are zero-based. See GetDivisionsAsync(CancellationToken). Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonDriverStandingsHeader Header, SeasonDriverStanding[] Standings)>> | A header with overall series information and an array of standings. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonQualifyResultsAsync(int, int, int?, int?, CancellationToken)
Retrieve the qualifying results for a season.
Declaration
Task<DataResponse<(SeasonQualifyResultsHeader Header, SeasonQualifyResult[] Results)>> GetSeasonQualifyResultsAsync(int seasonId, int carClassId, int? raceWeekIndex = null, int? division = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| int? | division | Division to search. Note that divisions are zero-based. See GetDivisionsAsync(CancellationToken). Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonQualifyResultsHeader Header, SeasonQualifyResult[] Results)>> | A header with overall series information and an array of qualifying results. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonResultsAsync(int, EventType, int, CancellationToken)
Retrieve information about the races run during a week in the season.
Declaration
Task<DataResponse<SeasonResults>> GetSeasonResultsAsync(int seasonId, EventType eventType, int raceWeekNumber, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| EventType | eventType | The type of events to return. | 
| int | raceWeekNumber | Week number within the given season, starting with 0 for the first week. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SeasonResults>> | A DataResponse<TData> containing the races in a SeasonResults object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonStandingsAsync(int, int, int?, int?, CancellationToken)
Retrieves league's season's standings
Declaration
Task<DataResponse<SeasonStandings>> GetSeasonStandingsAsync(int leagueId, int seasonId, int? carClassId = null, int? carId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | leagueId | League Id to return sessions for. | 
| int | seasonId | Season Id to return sessions for. | 
| int? | carClassId | If true include only sessions which results are available. | 
| int? | carId | A token to allow the operation to be cancelled. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SeasonStandings>> | A DataResponse<TData> containing SeasonStandings. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonSuperSessionStandingsAsync(int, int, int?, int?, CancellationToken)
Retrieve the Super Session standings for a given season.
Declaration
Task<DataResponse<(SeasonSuperSessionResultsHeader Header, SeasonSuperSessionResultItem[] Results)>> GetSeasonSuperSessionStandingsAsync(int seasonId, int carClassId, int? division = null, int? raceWeekIndex = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | division | Division to search. Note that divisions are zero-based. See GetDivisionsAsync(CancellationToken). Defaults to "all" if null. | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonSuperSessionResultsHeader Header, SeasonSuperSessionResultItem[] Results)>> | A DataResponse<TData> containing the season's super session results as a SeasonSuperSessionResultsHeader object. | 
GetSeasonTeamStandingsAsync(int, int, int?, CancellationToken)
Retrieve the team standings for a season.
Declaration
Task<DataResponse<(SeasonTeamStandingsHeader Header, SeasonTeamStanding[] Standings)>> GetSeasonTeamStandingsAsync(int seasonId, int carClassId, int? raceWeekIndex = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonTeamStandingsHeader Header, SeasonTeamStanding[] Standings)>> | A header with overall series information and an array of team standings. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonTimeTrialResultsAsync(int, int, int?, int?, CancellationToken)
Retrieve the time trial results for a season.
Declaration
Task<DataResponse<(SeasonTimeTrialResultsHeader Header, SeasonTimeTrialResult[] Results)>> GetSeasonTimeTrialResultsAsync(int seasonId, int carClassId, int? raceWeekIndex = null, int? division = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| int? | division | Division to search. Note that divisions are zero-based. See GetDivisionsAsync(CancellationToken). Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonTimeTrialResultsHeader Header, SeasonTimeTrialResult[] Results)>> | A header with overall series information and an array of time trial results. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonTimeTrialStandingsAsync(int, int, int?, int?, CancellationToken)
Retrieve the time trial standings for a season.
Declaration
Task<DataResponse<(SeasonTimeTrialStandingsHeader Header, SeasonTimeTrialStanding[] Standings)>> GetSeasonTimeTrialStandingsAsync(int seasonId, int carClassId, int? raceWeekIndex = null, int? division = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonId | Unique identifier for the racing season. | 
| int | carClassId | Car class identifier. See GetCarClassesAsync(CancellationToken). | 
| int? | raceWeekIndex | Week within the given season, starting with 0 for the first week. Defaults to "all" if null. | 
| int? | division | Division to search. Note that divisions are zero-based. See GetDivisionsAsync(CancellationToken). Defaults to "all" if null. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SeasonTimeTrialStandingsHeader Header, SeasonTimeTrialStanding[] Standings)>> | A header with overall series information and an array of time trial standings. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeasonsAsync(bool, CancellationToken)
Retrieve information about the season and series.
Declaration
Task<DataResponse<SeasonSeries[]>> GetSeasonsAsync(bool includeSeries, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| bool | includeSeries | Indicate if the series details should be included. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SeasonSeries[]>> | A DataResponse<TData> containing the season and optionally series detail in a SeasonSeries array. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeriesAssetsAsync(CancellationToken)
Retrieve a the current season's series assets.
Declaration
Task<DataResponse<IReadOnlyDictionary<string, SeriesAsset>>> GetSeriesAssetsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<IReadOnlyDictionary<string, SeriesAsset>>> | A DataResponse<TData> containing a dictionary with the series identifier as the key and the assets details in a SeriesAsset item. | 
Remarks
All image paths are relative to https://images-static.iracing.com.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSeriesAsync(CancellationToken)
Retrieve a list of the current season's series.
Declaration
Task<DataResponse<SeriesDetail[]>> GetSeriesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SeriesDetail[]>> | A DataResponse<TData> containing the series detail in a SeriesDetail array. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetServiceStatusAsync(CancellationToken)
Retrieve the current iRacing Service Status information.
Declaration
Task<StatusResult> GetServiceStatusAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<StatusResult> | The current status of the various services that make up iRacing. | 
Exceptions
| Type | Condition | 
|---|---|
| iRacingDataClientException | If there's a problem processing the result. | 
GetSingleDriverSubsessionLapsAsync(int, int, int, CancellationToken)
Get the lap details for a particular driver in the given single-driver subsession.
Declaration
Task<DataResponse<(SubsessionLapsHeader Header, SubsessionLap[] Laps)>> GetSingleDriverSubsessionLapsAsync(int subSessionId, int simSessionNumber, int customerId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | subSessionId | The identifier of the subsession for which results should be returned. | 
| int | simSessionNumber | The number of the session where  | 
| int | customerId | A customer identifier value for the driver in the race to return laps for. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SubsessionLapsHeader Header, SubsessionLap[] Laps)>> | A DataResponse<TData> containing the result details in a SubSessionResult object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSpectatorSubsessionDetailsAsync(EventType[]?, int[]?, CancellationToken)
Retrieves the current subsession identifiers available to spectate.
Declaration
Task<DataResponse<SpectatorDetails>> GetSpectatorSubsessionDetailsAsync(EventType[]? eventTypes = null, int[]? seasonIds = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| EventType[] | eventTypes | Optional, if supplied limits the types of event subsessions to include. Defaults to all. | 
| int[] | seasonIds | Optional, if supplied limits the seasons to include. Defaults to all. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SpectatorDetails>> | A DataResponse<TData> containing a MemberRecap object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSpectatorSubsessionIdentifiersAsync(EventType[]?, CancellationToken)
Retrieves the current subsession identifiers available to spectate.
Declaration
Task<DataResponse<SpectatorSubsessionIds>> GetSpectatorSubsessionIdentifiersAsync(EventType[]? eventTypes = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| EventType[] | eventTypes | Optional, if supplied limits the types of event subsessions to include. Defaults to all. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SpectatorSubsessionIds>> | A DataResponse<TData> containing a MemberRecap object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetStatisticsSeriesAsync(CancellationToken)
Retrieve a list of series.
Declaration
Task<DataResponse<StatisticsSeries[]>> GetStatisticsSeriesAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<StatisticsSeries[]>> | A DataResponse<TData> containing the series in a StatisticsSeries array. | 
Remarks
To get series and seasons for which standings should be available, filter the list where Official is true.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSubSessionLapChartAsync(int, int, CancellationToken)
Get the results of a subsession, if the authenticated user is authorized to view them.
Declaration
Task<DataResponse<(SubsessionLapsHeader Header, SubsessionChartLap[] Laps)>> GetSubSessionLapChartAsync(int subSessionId, int simSessionNumber, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | subSessionId | The identifier of the subsession for which results should be returned. | 
| int | simSessionNumber | The number of the session where  | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SubsessionLapsHeader Header, SubsessionChartLap[] Laps)>> | A DataResponse<TData> containing the result details in a SubSessionResult object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSubSessionResultAsync(int, bool, CancellationToken)
Get the results of a subsession, if the authenticated user is authorized to view them.
Declaration
Task<DataResponse<SubSessionResult>> GetSubSessionResultAsync(int subSessionId, bool includeLicenses, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | subSessionId | The identifier of the subsession for which results should be returned. | 
| bool | includeLicenses | Indicates if license information should be included. Either true or false to exclude for performance purposes. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<SubSessionResult>> | A DataResponse<TData> containing the result details in a SubSessionResult object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetSubsessionEventLogAsync(int, int, CancellationToken)
Retrieve a list of session events.
Declaration
Task<DataResponse<(SubsessionEventLogHeader Header, SubsessionEventLogItem[] LogItems)>> GetSubsessionEventLogAsync(int subSessionId, int simSessionNumber, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | subSessionId | The identifier of the subsession for which results should be returned. | 
| int | simSessionNumber | The number of the session where  | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SubsessionEventLogHeader Header, SubsessionEventLogItem[] LogItems)>> | A DataResponse<TData> containing the subsession's event log header details in a SubsessionEventLogHeader and SubsessionEventLogItem array. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetTeamAsync(int, CancellationToken)
Information about an iRacing Team.
Declaration
Task<DataResponse<TeamInfo>> GetTeamAsync(int teamId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | teamId | Unique identifier for the team. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<TeamInfo>> | A DataResponse<TData> containing the team details in a TeamInfo object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetTeamSubsessionLapsAsync(int, int, int, CancellationToken)
Get the lap details for a team in the given team subsession.
Declaration
Task<DataResponse<(SubsessionLapsHeader Header, SubsessionLap[] Laps)>> GetTeamSubsessionLapsAsync(int subSessionId, int simSessionNumber, int teamId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | subSessionId | The identifier of the subsession for which results should be returned. | 
| int | simSessionNumber | The number of the session where  | 
| int | teamId | The unique team identifier value for the team from the race to return laps for. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(SubsessionLapsHeader Header, SubsessionLap[] Laps)>> | A DataResponse<TData> containing overall session details in a SubsessionLapsHeader object along with an array of SubsessionLap. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetTimeAttackMemberSeasonResultsAsync(int, CancellationToken)
Retrieves the current member's Time Attack results for the given season.
Declaration
Task<DataResponse<TimeAttackMemberSeasonResult[]>> GetTimeAttackMemberSeasonResultsAsync(int competitionSeasonId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | competitionSeasonId | The Time Attack season identifier to return results for. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<TimeAttackMemberSeasonResult[]>> | A DataResponse<TData> containing an array of TimeAttackMemberSeasonResult objects. | 
Remarks
Always returns information for the currently authenticated member.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetTimeAttackSeasonsAsync(CancellationToken)
Get a list of Time Attack series.
Declaration
Task<TimeAttackSeason[]> GetTimeAttackSeasonsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<TimeAttackSeason[]> | An array of TimeAttackSeason objects. | 
Exceptions
| Type | Condition | 
|---|---|
| iRacingDataClientException | If there's a problem processing the result. | 
GetTrackAssetScreenshotUris(Track, TrackAssets)
Build a collection of URIs which resolve to screenshots of the track.
Declaration
IEnumerable<Uri> GetTrackAssetScreenshotUris(Track track, TrackAssets trackAssets)Parameters
| Type | Name | Description | 
|---|---|---|
| Track | track | The track detail for the circuit you want screenshots for. | 
| TrackAssets | trackAssets | The related track assets detail for the same circuit as  | 
Returns
| Type | Description | 
|---|---|
| IEnumerable<Uri> | A collection of Uri objects containing links that will resolve to images of the track or an empty collection. | 
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Either  | 
| ArgumentException | One of these issues will cause this exception: | 
GetTrackAssetScreenshotUrisAsync(int, CancellationToken)
Build a collection of URIs which resolve to screenshots of the track.
Declaration
Task<IEnumerable<Uri>> GetTrackAssetScreenshotUrisAsync(int trackId, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | trackId | The unique identifier of the track for which the screenshot links should be generated. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<Uri>> | A Task that resolves to a collection of Uri objects containing links to images of the track or an empty collection. | 
Exceptions
| Type | Condition | 
|---|---|
| ArgumentOutOfRangeException | The  | 
GetTrackAssetsAsync(CancellationToken)
Retrieve information about the track assets.
Declaration
Task<DataResponse<IReadOnlyDictionary<string, TrackAssets>>> GetTrackAssetsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<IReadOnlyDictionary<string, TrackAssets>>> | A DataResponse<TData> containing the season and optionally series detail in a Track array. | 
Remarks
Image paths are relative to https://images-static.iracing.com/.
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetTracksAsync(CancellationToken)
Retrieve information about the tracks.
Declaration
Task<DataResponse<Track[]>> GetTracksAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<Track[]>> | A DataResponse<TData> containing the season and optionally series detail in a Track array. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
GetWeatherForecastFromUrlAsync(string, CancellationToken)
Retrieves the weather forecast for the given track and session time.
Declaration
Task<IEnumerable<WeatherForecast>> GetWeatherForecastFromUrlAsync(string url, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| string | url | Url received from the WeatherUrl property of the season's Schedule. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<WeatherForecast>> | A collection of WeatherForecast objects detailing the forecasted weather. | 
GetWeatherForecastFromUrlAsync(Uri, CancellationToken)
Retrieves the weather forecast for the given track and session time.
Declaration
Task<IEnumerable<WeatherForecast>> GetWeatherForecastFromUrlAsync(Uri url, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| Uri | url | Url received from the WeatherUrl property of the season's Schedule. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<IEnumerable<WeatherForecast>> | A collection of WeatherForecast objects detailing the forecasted weather. | 
GetWorldRecordsAsync(int, int, int?, int?, CancellationToken)
World record times for a car at a particular track. Optionally by year and season.
Declaration
Task<DataResponse<(WorldRecordsHeader Header, WorldRecordEntry[] Entries)>> GetWorldRecordsAsync(int carId, int trackId, int? seasonYear = null, int? seasonQuarter = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | carId | Unique identifier for the car. | 
| int | trackId | Unique identifier for the track. | 
| int? | seasonYear | Optional, if supplied limits times to the given year. | 
| int? | seasonQuarter | Optional, if supplied limits times to a given quarter. Must be used with  | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(WorldRecordsHeader Header, WorldRecordEntry[] Entries)>> | A header with overall information and an array of world record results. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
ListHostedSessionsAsync(CancellationToken)
Sessions that can be joined as a driver. Without spectator and non-league pending sessions for the user.
Declaration
Task<DataResponse<HostedSessionsResult>> ListHostedSessionsAsync(CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<HostedSessionsResult>> | A DataResponse<TData> containing an array of EventType objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
ListHostedSessionsCombinedAsync(int?, CancellationToken)
Sessions that can be joined as a driver or spectator, and also includes non-league pending sessions for the user.
Declaration
Task<DataResponse<CombinedSessionsResult>> ListHostedSessionsCombinedAsync(int? packageId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int? | packageId | If set, return only sessions using this car or track package id. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<CombinedSessionsResult>> | A DataResponse<TData> containing an array of EventType objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
ListSeasonsAsync(int, int, CancellationToken)
Get a list of the Seasons run during the given year and quarter numbers.
Declaration
Task<DataResponse<ListOfSeasons>> ListSeasonsAsync(int seasonYear, int seasonQuarter, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| int | seasonYear | The year to list seasons for. | 
| int | seasonQuarter | The quarter to list seasons for. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<ListOfSeasons>> | A DataResponse<TData> containing the search's results as a ListOfSeasons object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
SearchDriversAsync(string, int?, CancellationToken)
Search for one or more drivers.
Declaration
Task<DataResponse<DriverSearchResult[]>> SearchDriversAsync(string searchTerm, int? leagueId = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| string | searchTerm | A customer id or partial name to search on. | 
| int? | leagueId | Narrow the search to the roster of the given league. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<DriverSearchResult[]>> | A DataResponse<TData> containing an array of DriverSearchResult objects. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
SearchHostedResultsAsync(HostedSearchParameters, CancellationToken)
Search for hosted and league sessions over a maximum period of 90 days.
Declaration
Task<DataResponse<(HostedResultsHeader Header, HostedResultItem[] Items)>> SearchHostedResultsAsync(HostedSearchParameters searchParameters, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| HostedSearchParameters | searchParameters | Parameters object containing the values to use in the search. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(HostedResultsHeader Header, HostedResultItem[] Items)>> | A DataResponse<TData> containing the search's header details in a HostedResultsHeader and HostedResultItem array for the results. | 
Remarks
For scraping results the most effective approach is to keep track of the maximum EndTime found during a search then make the subsequent call using that date/time as the FinishRangeBegin and skip any subsessions that are duplicated. Results are ordered by subsessionid which is a proxy for start time.
Valid searches must be structured as follows:
- requires one of: StartRangeBegin, FinishRangeBegin
- requires one of: ParticipantCustomerId, TeamId, HostCustomerId, SessionName
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
SearchLeagueDirectoryAsync(SearchLeagueDirectoryParameters, CancellationToken)
Searches the league directory based on the given parameters.
Declaration
Task<DataResponse<LeagueDirectoryResultPage>> SearchLeagueDirectoryAsync(SearchLeagueDirectoryParameters searchParameters, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| SearchLeagueDirectoryParameters | searchParameters | Parameters object containing the values to use in the search. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<LeagueDirectoryResultPage>> | A DataResponse<TData> containing the search's results as a LeagueDirectoryResultPage object. | 
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
SearchOfficialResultsAsync(OfficialSearchParameters, CancellationToken)
Search for official sessions over a maximum period of 90 days.
Declaration
Task<DataResponse<(OfficialSearchResultHeader Header, OfficialSearchResultItem[] Items)>> SearchOfficialResultsAsync(OfficialSearchParameters searchParameters, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| OfficialSearchParameters | searchParameters | Parameters object containing the values to use in the search. | 
| CancellationToken | cancellationToken | A token to allow the operation to be cancelled. | 
Returns
| Type | Description | 
|---|---|
| Task<DataResponse<(OfficialSearchResultHeader Header, OfficialSearchResultItem[] Items)>> | A DataResponse<TData> containing the search's header details in a OfficialSearchResultHeader and OfficialSearchResultItem array for the results. | 
Remarks
For scraping results the most effective approach is to keep track of the maximum EndTime found during a search then make the subsequent call using that date/time as the FinishRangeBegin and skip any subsessions that are duplicated. Results are ordered by subsessionid which is a proxy for start time.
Valid searches require at least one of:
Exceptions
| Type | Condition | 
|---|---|
| InvalidOperationException | If the client is not currently authenticated. | 
| iRacingDataClientException | If there's a problem processing the result. | 
| iRacingUnauthorizedResponseException | If the iRacing API returns a  | 
UseUsernameAndPassword(string, string)
Supply the username and password if they weren't supplied through the iRacingDataClientOptions object.
Declaration
[Obsolete("Configure via the \"AddIRacingDataApi\" extension method on the IServiceCollection which allows you to configure the \"iRacingDataClientOptions\".")]
void UseUsernameAndPassword(string username, string password)Parameters
| Type | Name | Description | 
|---|---|---|
| string | username | iRacing user name to use for authentication. | 
| string | password | Password associated with the iRacing user name used to authenticate. | 
Exceptions
| Type | Condition | 
|---|---|
| iRacingClientOptionsValueMissingException | Either  | 
UseUsernameAndPassword(string, string, bool)
Supply the username and password if they weren't supplied through the iRacingDataClientOptions object.
Declaration
[Obsolete("Configure via the \"AddIRacingDataApi\" extension method on the IServiceCollection which allows you to configure the \"iRacingDataClientOptions\".")]
void UseUsernameAndPassword(string username, string password, bool passwordIsEncoded)Parameters
| Type | Name | Description | 
|---|---|---|
| string | username | iRacing user name to use for authentication. | 
| string | password | Password associated with the iRacing user name used to authenticate. | 
| bool | passwordIsEncoded | If true indicates the  | 
Exceptions
| Type | Condition | 
|---|---|
| iRacingClientOptionsValueMissingException | Either  |