First Cycling API

An unofficial Python API wrapper for https://firstcycling.com/.

Races

Access race details, including results, statistics, startlists, and more.

Examples

>>> RaceEdition(race_id=9, year=2019).results().results_table.iloc[0]
Pos                                01
Rider            van der Poel Mathieu
Team                Corendon - Circus
Time                          6:28:18
UCI                             500.0
Rider_ID                        16672
Rider_Country                     NED
Team_ID                         13279
Name: 0, dtype: object

Rankings

Access race details, including statistics and results.

Examples

>>> Ranking(h=1, rank=1, y=2020, page=2).table.iloc[0]
Pos                          101
Rider                Egan Bernal
Nation                  Colombia
Team            INEOS Grenadiers
Points                       425
Rider_ID                   58275
Team_ID                    17536
Team_Country                 GBR
Name: 0, dtype: object

Riders

Access rider details, including results and statistics.

Examples

>>> Rider(18655).year_results(2020).results_df.iloc[0]
Date                       8.11
Pos                           1
GC                          NaN
Race_Country                ESP
Race            Vuelta a España
CAT                       2.UWT
UCI                       850.0
Unnamed: 8            Show more
Race_ID                      23
Name: 0, dtype: object

Constants

Provides useful constants and Enums.

class first_cycling_api.constants.Classification(value)

Enum mapping classification names to numbers.

Examples

>>> Classification.gc.value
1
>>> Classification(1).name
'gc'
class first_cycling_api.constants.Profile(value)

Enum mapping profile icon file names to profile types.

Examples

>>> Profile['Flatt.png'].value
'Flat'
>>> Profile('Flat').name
'Flatt.png'
class first_cycling_api.constants.Country(value)

Enum mapping three-letter country flag codes to country names.

Examples

>>> Country.SLO.value
'Slovenia'
>>> Country('Slovenia').name
'SLO'

Indices and tables