Skip to content

About

A .NET access library for querying the iRacing "Data" API.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Aydsko iRacing Data API Logo, which contains the characters "{", "0", "1", and "}" on a red & blue field with "Data API" written below.

Aydsko iRacing Data API

iRacing is the leading online racing simulation for PC. During events hosted via the iRacing service there is a large amount of data created related to race results and member participation in events.

This library allows access via .NET to the iRacing "Data API". These APIs allow a properly authenticated user a supported method of accessing data from the service.

Getting Started

Install the Package

Nuget

The library is distributed as the Aydsko.iRacingData NuGet package. Install using your package manager of choice.

To install using the dotnet command:

dotnet add package Aydsko.iRacingData

Register the Client

Register the iRacing Data API client classes with the service provider.

services.AddiRacingDataApi(options =>
{
    options.Username = "your-iracing-user@example.com";
    options.Password = "Your-iRacing-Password";
    options.UserAgentProductName = "MyApplicationName";
    options.UserAgentProductVersion = new Version(1, 0);
});

2022 Season 3 Change in Login

There is a change in the login algorithm due to be released with iRacing's 2022 Season 3 update. If this update has been released and authentication stops working enable the Use2022Season3Login flag on the options.

services.AddiRacingDataApi(options =>
{
    options.Use2022Season3Login = true; // Add this line

    options.Username = "your-iracing-user@example.com";
    options.Password = "Your-iRacing-Password";
    options.UserAgentProductName = "MyApplicationName";
    options.UserAgentProductVersion = new Version(1, 0);
});

Use the Client

Use the injected IDataClient to authenticate and request data.

public class ExampleService
{
    private readonly IDataClient dataClient;

    public ExampleService(IDataClient dataClient)
    {
        this.dataClient = dataClient;
    }

    public async Task<MemberInfo> GetMyInfoAsync(CancellationToken cancellationToken = default)
    {
        var infoResponse = await dataClient.GetMyInfoAsync(cancellationToken);
        return infoResponse.Data;
    }
}

Contributing

Before you begin a contribution, please read and ensure you are comfortable with this project's Code of Conduct.

Contributor Covenant

To build & develop on the codebase you'll need:

  • An active iRacing membership
  • .NET 6 (or later)

To get started open and build src\iRacing Data API.sln.

About

A .NET access library for querying the iRacing "Data" API.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages