Frenetik.iRacingApiWrapper
1.0.2
dotnet add package Frenetik.iRacingApiWrapper --version 1.0.2
NuGet\Install-Package Frenetik.iRacingApiWrapper -Version 1.0.2
<PackageReference Include="Frenetik.iRacingApiWrapper" Version="1.0.2" />
<PackageVersion Include="Frenetik.iRacingApiWrapper" Version="1.0.2" />
<PackageReference Include="Frenetik.iRacingApiWrapper" />
paket add Frenetik.iRacingApiWrapper --version 1.0.2
#r "nuget: Frenetik.iRacingApiWrapper, 1.0.2"
#:package Frenetik.iRacingApiWrapper@1.0.2
#addin nuget:?package=Frenetik.iRacingApiWrapper&version=1.0.2
#tool nuget:?package=Frenetik.iRacingApiWrapper&version=1.0.2
Frenetik.iRacingApiWrapper
Overview
This is a wrapper for the iRacing API service written in C#. It is still early in development. Use at your own risk and please report issues so they can be fixed. Thanks!
Submitting Issues
There are periodic updates to the iRacing API and I do not know how to track these updates. If you encounter any issues or have suggestions for improvements, please submit them via the GitHub issue tracker.
- Go to the Issues section of the repository.
- Click on the
New Issue
button. - Provide a clear and descriptive title for your issue.
- Fill out the issue template with as much detail as possible, including steps to reproduce the issue, expected behavior, and any relevant screenshots or logs.
- Submit the issue.
IRacingApiService
The IRacingApiService
is a service for interfacing with the iRacing API. It uses authentication and logging mechanisms to provide a reliable and secure way to interact with iRacing data.
Enabling API Usage
iRacing adopted 2FA in 2024 and requires you to now opt-in to legacy authentication.
- Goto https://oauth.iracing.com/accountmanagement/security/
- At the bottom of the options, enable Legacy Authentication
Usage
To use the IRacingApiService
, follow these steps:
Install necessary packages:
dotnet add package Microsoft.Extensions.Options dotnet add package Microsoft.Extensions.Logging
Configure settings:
Create a configuration section in your
appsettings.json
file:{ "IRacingDataSettings": { "BaseUrl": "https://members-ng.iracing.com/", "Username": "your_username", "Password": "your_password" } }
Register services:
In your
Startup.cs
orProgram.cs
file, register the necessary services:public void ConfigureServices(IServiceCollection services) { services.Configure<IRacingDataSettings>(Configuration.GetSection("IRacingDataSettings")); services.AddSingleton<IRacingApiService>(); services.AddLogging(); }
Use the service:
Inject and use the
IRacingApiService
in your application:public class RacingController : ControllerBase { private readonly IRacingApiService _racingApiService; public RacingController(IRacingApiService racingApiService) { _racingApiService = racingApiService; } // Your actions using IRacingApiService }
Test Project
There is a test project called TestWrapper that shows how to set this up in a console app.
Notes
- Ensure you have the correct iRacing API credentials.
- Handle exceptions and errors appropriately in your application.
- Any suggestions on improving this project or the readme? Submit an issue, thanks!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Polly (>= 8.5.2)
- RestSharp (>= 112.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.