Skip to content

Custom API Configurations

David edited this page Jun 12, 2024 · 12 revisions

Custom API Configurations allow you to set up APIs for teams that play in leagues that are not natively supported by the Team Tracker integration. This is particularly useful for soccer, where ESPN has APIs that support over 100 international leagues.

To set up a Custom API configuration, you must

  1. Set league_idto XXX to indicate you are setting up a Custom API Configuration.
  2. Set the sport_path to the desired value.
  3. Set the league_path to the desired value.

You can set up a Custom API Configuration with the GUI or YAML.

The instructions below give more information on how to determine the values to use for sport_path and league_path.

1. Use the list of known ESPN APIs

The simplest way to determine valid values for sport_path and league_path to is to visit this site maintained by others who use them:

  1. Visit the ESPN API Page.

2. Using the ESPN API Explorer to determine the correct values for sport_path and league_path when setting up custom API configurations: NOTE: As of February 2023, ESPN appears to have taken down the ESPN API DevCenter and the corresponding API Explorer page. You must use an alternate method.

The simplest way to determine valid values for sport_path and league_path to is to:

  1. Visit the ESPN API Explorer page.
  2. Click on the Score and Schedules API section to expand it.
  3. Select the desired sportName from the first drop down. Use this value in all lower case as your sport_path.
  4. Select the desired leagueName from the second drop down. Use this value in all lower case as your league_path.

3. Using ESPN APIs to determine the correct values for sport_path and league_path when setting up custom API configurations:

Using this method appears to pull in newly supported sports and leagues beyond those listed at the site above.

  1. This API will return JSON containing the URLs for all of the sports for which ESPN has APIs.
  2. Use the URL for your desired sport to return JSON containing a separate URL for for each supported league in that sport. You can use this URL to determine the sport_path and league_path. You can also use this URL to continue to get more URLs that provide more info about the league, including the names of the teams in the leagues.

4. Using an ESPN web page to determine the correct values for sport_path and league_path when setting up custom API configurations:

  1. Visit the ESPN page that shows the scores for the sport and league that you are interested in.
  2. Examine the URL for that page and you can sometimes determine the sport_path and league_path from the URL.

The following custom API configurations are confirmed to have worked:

Fifa Friendlies

# Custom Integration - 
  - platform: teamtracker
    league_id: XXX
    team_id: USA
    sport_path: soccer
    league_path:  fifa.friendly
    name: tt_fifa

Australian Rules Football

# Custom Integration - 
  - platform: teamtracker
    league_id: XXX
    team_id: SYD
    sport_path: australian-football
    league_path:  afl
    name: tt_afl