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
class first_cycling_api.race.race.Race(ID)

Wrapper to access endpoints associated with races.

ID

The firstcycling.com ID for the race from the URL of the race page.

Type:

int

edition(year)

Get RaceEdition instance for edition of race.

Parameters:

year (int) – Year for edition of interest.

Return type:

RaceEdition

overview(classification_num=None)

Get race overview for given classifications.

Parameters:

classification_num (int) – Classification for which to collect information. See utilities.Classifications for possible inputs.

Return type:

RaceEndpoint

victory_table()

Get race all-time victory table.

Return type:

RaceVictoryTable

year_by_year(classification_num=None)

Get year-by-year race statistics for given classification.

Parameters:

classification_num (int) – Classification for which to collect information. See utilities.Classifications for possible inputs.

Return type:

RaceEndpoint

youngest_oldest_winners()

Get race all-time victory table.

Return type:

RaceYoungestOldestWinners

stage_victories()

Get race all-time stage victories.

Return type:

RaceStageVictories

class first_cycling_api.race.race.RaceEdition(race_id, year)

Wrapper to access endpoints associated with specific editions of races.

ID

The firstcycling.com ID for the race from the URL of the race page.

Type:

int

year

The year of the race edition.

Type:

int

results(classification_num=None, stage_num=None)

Get race edition results for given classification or stage.

Parameters:
  • classification_num (int) – Classification for which to collect information. See utilities.Classifications for possible inputs.

  • stage_num (int) – Stage number for which to collect results, if applicable. Input 0 for prologue.

Return type:

RaceEditionResults

stage_profiles()

Get race edition stage profiles.

Return type:

RaceEndpoint

startlist()

Get race edition startlist in normal mode.

Return type:

RaceEndpoint

startlist_extended()

Get race edition startlist in extended mode.

Return type:

RaceEndpoint

class first_cycling_api.race.endpoints.RaceEndpoint(response)

Race page response. Extends Endpoint.

header_details

Details from page header, including race name and external links.

Type:

dict

editions

A lsit of the years in which editions of the race took place.

Type:

list[int]

get_json()

Get JSON representation of endpoint response.

response

Raw response from firstcycling.com.

class first_cycling_api.race.endpoints.RaceVictoryTable(response)

Race victory table response. Extends RaceEndpoint.

table

Victory table for race.

Type:

pd.DataFrame

get_json()

Get JSON representation of endpoint response.

response

Raw response from firstcycling.com.

class first_cycling_api.race.endpoints.RaceStageVictories(response)

Race stage victory table response. Extends RaceEndpoint.

table

Stage victory table for race.

Type:

pd.DataFrame

get_json()

Get JSON representation of endpoint response.

response

Raw response from firstcycling.com.

class first_cycling_api.race.endpoints.RaceEditionResults(response)

Race edition results response. Extends RaceEndpoint.

results_table

Table containing the race results.

Type:

pd.DataFrame

standings

For stage races, maps classification names to a DataFrame with the appropriate standings after the stage.

Type:

dict {str : pd.DataFrame}

get_json()

Get JSON representation of endpoint response.

response

Raw response from firstcycling.com.