TBA elected to use more rational division codes which, unfortunately, has the adverse effect of breaking things that use the API with FIRST’S official codes.
Keep in mind you can also get the FIRST Event Code from TBA by querying the TBA event and looking for the first_event_code key.
As for FIRST’s stuff, event list for the season, then filter by Tournament Type being ChampionshipDivision / ChampionshipSubdivision I suspect is the easiest programmatic way.
If Statbotics is using the TBA API and their event codes, you’ll need to use those in your application. If you want to call data directly from the FIRST API, you can use FIRST’s codes.
TBA has quite a few libraries available to get data from it, but it’s a third party site that rehosts FIRST data and provides insights / analysis / aggregation past what FIRST formally endorses / permits / supports. You can also just use normal HTTP requests with no extraneous libraries.
expand for example
import requests
baseURL = 'http://www.thebluealliance.com/api/v3/'
header = {'X-TBA-Auth-Key':'(insert auth key here)'}
def getTBA(url):
return requests.get(baseURL + url, headers=header).json()
def getAllTeams(urlarg):
teams = []
currentPage = 0
currentTeams = getTBA("teams/" + str(currentPage) + str(urlarg))
for team in currentTeams:
teams.append(team)
while currentTeams != []:
currentPage+=1
currentTeams = getTBA("teams/" + str(currentPage) + str(urlarg))
for team in currentTeams:
teams.append(team)
return teams
Jared provided context for comparison, and I wanted to make sure that the mention of TBA wasn’t super confusing.
To do it with FIRST’s official tooling, you’d want to use this API call most likely, and pay attention to the attribute of tournamentType.