-
Notifications
You must be signed in to change notification settings - Fork 20
Custom API Configurations
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
- Set
league_id
toXXX
to indicate you are setting up a Custom API Configuration. - Set the
sport_path
to the desired value. - 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:
- 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:
- Visit the ESPN API Explorer page.
- Click on the Score and Schedules API section to expand it.
- Select the desired
sportName
from the first drop down. Use this value in all lower case as yoursport_path
. - Select the desired
leagueName
from the second drop down. Use this value in all lower case as yourleague_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.
- This API will return JSON containing the URLs for all of the sports for which ESPN has APIs.
- 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
andleague_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:
- Visit the ESPN page that shows the scores for the sport and league that you are interested in.
- Examine the URL for that page and you can sometimes determine the
sport_path
andleague_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