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
class first_cycling_api.ranking.ranking.Ranking(**kwargs)

Object to retrieve rankings pages.

Examples

>>> Ranking(h=1, rank=1, y=2020, page=2)
<first_cycling_api.ranking.endpoints.RankingEndpoint at 0x295caddccd0>
static __new__(cls, **kwargs)

Obtain a ranking endpoint.

Parameters:
  • rank (int or str) – For UCI Ranking, {1: ‘World’, 2: ‘One-day race’, 3: ‘Stage race’, 4: ‘Africa Tour’, 5: ‘America Tour’, 6: ‘Europe Tour’, 7: ‘Asia Tour’, 8: ‘Oceania Tour’, 99: ‘Women’}. For FirstCycling Ranking, {‘el’: Men Elite, ‘jr’: Men Junior, ‘wel’: Women Elite, ‘wjr’: Women Junior}.

  • h (int) – For UCI Ranking, {1: ‘Riders’, 2: ‘Teams’, 3: ‘Nations’}.

  • y (int or str) – If int, returns ranking for that particular year, e.g. 2021. For UCI Ranking, if str, format as ‘yyyy-w’ with year and week, e.g. ‘2021-7’ returns the rankings in week 7 of 2021. For FirstCycling Ranking, ‘all’ returns podium finishers per year.

  • cnat (str) – For UCI Ranking and FirstCycling Amateur, the three-letter code for the country to filter riders to, e.g. ‘BEL’.

  • u23 (int) – For UCI Ranking, if 1 include results for under-23 riders only.

  • page_num (int) – The desired page number of the ranking.

  • k (str) – For National Ranking, ‘nat’. For FirstCycling Ranking, ‘fc’. For FirstCycling Amateur, ‘ama’.

  • nation (str) – For National Ranking, the three-letter code for the country, one of {‘bel’, ‘den’, ‘fra’, ‘ita’, ‘ned’, ‘nor’}.

  • race (int) – For National Ranking, if 1, load races considered in ranking.

  • U23 (int) – For FirstCycling Ranking and FirstCycling Amateur, if 1 include results for under-23 riders only.

  • nat (str) – For FirstCycling Amateur, three-letter code for country, one of {‘aus’, bel’, ‘den’, ‘fra’, ‘ita’, ‘jpn’, ‘nor’, ‘esp’, ‘gbr’, ‘usa’}. If women’s amateur ranking is desired, add a ‘w’ to the country code, yielding one of {‘denw’, ‘norw’}.

Return type:

RankingEndpoint

__weakref__

list of weak references to the object (if defined)

class first_cycling_api.ranking.endpoints.RankingEndpoint(response)

Rakings page response.

table

Rankings table.

Type:

pd.DataFrame

get_json()

Get JSON representation of endpoint response.

response

Raw response from firstcycling.com.