iracing-data-api is a simple Python wrapper around the General Data API released by iRacing in January 2022 and documented here.
The client allows easy access to some of the most useful endpoints of the data API.
Ensure that you have marked your account with iRacing for legacy authentication - accounts with 2FA will not work with the API. This is a limitation of iRacing, not this wrapper.
pip install iracingdataapi
from iracingdataapi.client import irDataClient
idc = irDataClient(username=[YOUR iRACING USERNAME], password=[YOUR iRACING PASSWORD])
# get the summary data of a member
idc.stats_member_summary(cust_id=20979)
# get latest results of a member
idc.stats_member_recent_races(cust_id=209179)
# get all laps for a specific driver in a race
idc.result_lap_data(subsession_id=43720351, cust_id=209179)
All available methods of irDataClient
are included in client.py
.
I welcome all pull requests for improvements or missing endpoints over time as they are added by iRacing.
1.2.2
driver_list
endpoint, thanks to @nylanderj for thatif [parameter]
would skip if the parameter was correctly set to 0, e.g. race_week_num
. Thanks to @abelsm2 for that1.2.0 Thanks to @ablesm2 for these changes.
time_attack_member_season_results()
stats_member_recap()
stats_member_division()
series_past_seasons()
league_roster()
stats_member_summary()
stats_member_yearly()
stats_member_recent_races()
1.1.6
1.1.5
_get_resource
1.1.4
result_search_series
to correctly include finish_range_begin
as an optionseason_spectator_subsessionids
to correctly return the IDs rather than the object1.1.3
season_spectator_subsessionids()
endpoint1.1.0
series()
to get_series()
for consistency. Breaking change: For that same consistency, series
has been reimplemented as a property which returns the series with their assets. To amend your implementation, either switch to get_series()
or remove any brackets in your call of series
.get_carclass()
to get_carclasses()
to be more consistent with other endpoints. NOTE: get_carclass()
will be removed in a future release.tracks
. If you prefer not to get those assets, use get_tracks()
.requests.Session
1.0.6
result_lap_data
method, which will now return an empty list for any cust_id
/subsession_id
combinations for which laps were not turned.1.0.5
1.0.4
1.0.3
1.0.2
irDataClient
object401 Unauthorized
response is received form iRacing1.0.1
result_search_series
to allow searches by date range without using season years and quarters.