How to pull world skills ranking from the RobotEvents API

There doesn’t appear to be any easy way of getting the worlds skills standings without pulling every skills match and sorting them by score. Has anyone done this? Or is there a way I haven’t seen yet? Help would by much appreciated.

1 Like

Yeah, I get each event for the season, filter out those I don’t want (events in the future, scrimmages, etc.), and then request skills for each event.

2 Likes

I’ve noticed that Pigpins runs from this season and others teams data aren’t in the API for skills. https://www.robotevents.com/api/v2/teams/41794/skills

That request shows that there are 8 pages of data and contains just the first “page”.

Here’s a Python snippet of how I get Data from Robot Events:

def _get_robotevents_data(the_url):
    df_retval = None
    response = requests.get(the_url,headers=ROBOTEVENTS_HEADER)
    json_results = json.loads(response.content.decode('utf-8'))
    df_retval = pd.read_json(json.dumps(json_results['data']))

    while json_results['meta']['next_page_url'] is not None:
        response = requests.get(json_results['meta']['next_page_url'],headers=ROBOTEVENTS_HEADER)
        json_results = json.loads(response.content.decode('utf-8'))
        df_thispage = pd.read_json(json.dumps(json_results['data']))
        df_retval = df_retval.append(df_thispage)

    return df_retval
2 Likes

Are you using pandas to read json? Nevermind pd defiantly stands for pandas.

You can use RobotEvents API v1 (the older version) to get the skills leaderboard.

The API to request should look something like this:

https://www.robotevents.com/api/seasons/139/skills?post_season=1&grade_level=Middle%20School&region=South%20Carolina

Keep in mind that the 139 represents the season ID, which you can get from v2. The URL parameters should be fairly self-explanatory.

2 Likes