Fantrax APIfantrax.com ↗
Access Fantrax fantasy sports data via API. Browse public leagues, fetch standings, retrieve draft picks, and get full league configs across MLB, NFL, NBA, and NHL.
What is the Fantrax API?
The Fantrax API exposes 4 endpoints covering public commissioner leagues, detailed league configuration, current standings, and completed draft results across MLB, NFL, NBA, and NHL. The get_published_leagues endpoint returns every publicly listed league for a given sport with draft dates, scoring types, and team counts. The get_draft_results endpoint returns every individual pick with round number, pick position, team ID, and player ID.
curl -X GET 'https://api.parse.bot/scraper/ec650451-bfbe-461c-8acc-5af57ea14ad0/get_published_leagues?sport=MLB' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace fantrax-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.fantrax_api import Fantrax, Sport, LeagueListing, League, Standing, DraftResult
fantrax = Fantrax()
# List public MLB leagues
listing = fantrax.leaguelistings.list(sport=Sport.MLB)
print(listing.selected_sport, listing.displayed_text.heading)
for league in listing.all_leagues:
print(league.name, league.id, league.num_teams, league.max_teams, league.full)
# Construct a league by ID and get its detailed info
league = fantrax.league(id=listing.all_leagues[0].id)
info = league.info()
print(info.league_name, info.season_year, info.draft_type)
print(info.roster_info.max_total_players, info.roster_info.max_total_active_players)
# Get standings for the league
for standing in league.standings():
print(standing.rank, standing.team_name, standing.points, standing.games_back)
# Get draft results
draft = league.draft_results()
print(draft.draft_state, draft.draft_type, draft.draft_date)
for pick in draft.draft_picks:
print(pick.round, pick.pick, pick.team_id, pick.player_id)
Retrieve publicly listed commissioner leagues for a given sport. Returns league metadata including heading text, colour legend, and all available public leagues with their draft dates, scoring types, team counts, and commissioner names. Each league entry includes an id usable with other endpoints.
| Param | Type | Description |
|---|---|---|
| sport | string | Sport code. Accepted values: MLB, NFL, NBA, NHL. |
{
"type": "object",
"fields": {
"allLeagues": "array of league objects each with id, name, draftDate, scoringTypeId, draftTypeCode, maxTeams, numTeams, numOwnedTeams, publishedLeagueCommissionerName, draftTypeName, lineupChangesDisplay, full",
"colourLegend": "object with alwaysShowOpener boolean and options array of colour labels",
"displayedText": "object with heading and message strings describing the league listing",
"selectedSport": "string, the sport code that was queried"
},
"sample": {
"data": {
"allLeagues": [
{
"id": "og4ngx2gmq6jgzc8",
"full": false,
"name": "H2H Dynasty 2026",
"maxTeams": 18,
"numTeams": 3,
"draftDate": 1781964000000,
"draftTypeCode": "LIVE_ONLINE",
"draftTypeName": "Live Online Standard",
"numOwnedTeams": 3,
"scoringTypeId": "3",
"lineupChangesDisplay": "Daily",
"publishedLeagueCommissionerName": "Clintongoeb"
}
],
"colourLegend": {
"options": [
{
"id": "AAFFAA",
"label": "Playoff Leagues"
},
{
"id": "CCE6FF",
"label": "Fantrax 2-Week Leagues"
}
],
"alwaysShowOpener": false
},
"displayedText": {
"heading": "MLB Baseball - Listed Commissioner Leagues",
"message": "<span>Attention!!</span> These leagues were created..."
},
"selectedSport": "MLB"
},
"status": "success"
}
}About the Fantrax API
League Discovery and Configuration
The get_published_leagues endpoint accepts an optional sport parameter (MLB, NFL, NBA, or NHL) and returns an array of league objects under allLeagues. Each entry includes a unique id, name, draftDate, scoringTypeId, draftTypeCode, maxTeams, numTeams, and numOwnedTeams. The response also includes a colourLegend object with labelled options and a displayedText object with a heading and message string that mirrors what the Fantrax league listing page shows.
For deeper detail on any single league, get_league_info takes a league_id and returns the full configuration: leagueName, seasonYear, startDate, endDate, draftType, draftSettings, and a rosterInfo object that includes positionConstraints, maxTotalPlayers, and maxTotalActivePlayers. A teamInfo map keys team IDs to objects with name, division, and id. A playerInfo map keys player IDs to objects containing eligiblePos and status.
Standings and Draft Results
The get_standings endpoint returns an items array sorted by rank. Each entry carries teamName, teamId, points, gamesBack, and winPercentage. The points field format varies by league type: rotisserie leagues return numeric totals while head-to-head leagues return a W-L-T string.
get_draft_results returns a draftPicks array where each object includes round, pick, pickInRound, teamId, playerId, and time. The draftOrder array provides the full team sequence, and draftState confirms whether the draft is completed. This endpoint only returns data for leagues whose draft has already finished.
The Fantrax API is a managed, monitored endpoint for fantrax.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when fantrax.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official fantrax.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Identify publicly available leagues to join by filtering
get_published_leaguesresults byscoringTypeIdordraftTypeCode - Build a draft analysis tool using the
draftPicksarray with round, pick, andplayerIdfields fromget_draft_results - Display live standings tables with rank, win percentage, and games back pulled from
get_standings - Map roster depth and positional eligibility using the
playerInfoobject returned byget_league_info - Compare draft snake order across leagues by inspecting the
draftOrderarray alongside individual pick timestamps - Track season timelines by combining
startDate,endDate, andseasonYearfromget_league_info - Audit commissioner league settings such as
maxTotalPlayersandpositionConstraintsto compare league structures
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Fantrax have an official public developer API?+
What does `get_standings` return for different league formats?+
items array for all league types. The points field differs by format: rotisserie leagues populate it with a numeric score while head-to-head leagues return a W-L-T string. The rank, teamName, teamId, gamesBack, and winPercentage fields are present in both cases.Does `get_draft_results` work for leagues whose draft is still in progress?+
draftState equals completed. For in-progress or scheduled drafts the response will not include draftPicks. The draftState field in the response tells you whether results are available.Does the API cover private leagues or only public commissioner leagues?+
Is per-player stat data or scoring breakdowns available?+
playerInfo map in get_league_info, and pick-level player IDs in get_draft_results, but does not expose per-player season stats, weekly scoring totals, or projection data. You can fork this API on Parse and revise it to add an endpoint targeting Fantrax player stat pages.