fantrax.com APIfantrax.com ↗
Access Fantrax public league listings, standings, draft results, and league settings across MLB, NFL, NBA, and NHL via a structured REST API.
curl -X GET 'https://api.parse.bot/scraper/ec650451-bfbe-461c-8acc-5af57ea14ad0/get_published_leagues?sport=NFL' \ -H 'X-API-Key: $PARSE_API_KEY'
Get list of published/public leagues for a given sport. Returns league listings with metadata including displayed text, colour legend, and all available public leagues for the selected sport.
| Param | Type | Description |
|---|---|---|
| sport | string | Sport code. Accepted values: MLB, NFL, NBA, NHL. |
{
"type": "object",
"fields": {
"data": "object containing session metadata (uu, sDate, adrt)",
"roles": "array of role codes",
"responses": "array containing league data with displayedText, colourLegend, allLeagues, and selectedSport"
},
"sample": {
"data": {
"data": {
"uu": 1,
"adrt": 35,
"sDate": 1777781018135
},
"roles": [
"03"
],
"responses": [
{
"data": {
"allLeagues": [],
"colourLegend": {
"options": [
{
"id": "AAFFAA",
"label": "Playoff Leagues"
},
{
"id": "CCE6FF",
"label": "Fantrax 2-Week Leagues"
}
],
"alwaysShowOpener": false
},
"displayedText": {
"heading": "MLB Baseball - Listed Commissioner Leagues",
"message": "..."
},
"selectedSport": "MLB"
}
}
]
},
"status": "success"
}
}About the fantrax.com API
This API exposes 4 endpoints covering Fantrax fantasy sports data across MLB, NFL, NBA, and NHL. Use get_published_leagues to browse public league listings with metadata, get_league_info to retrieve roster constraints and draft settings for a specific league, get_standings for ranked team records, and get_draft_results for complete pick-by-pick draft history including round, pick number, team, and player IDs.
League Discovery and Details
The get_published_leagues endpoint accepts an optional sport parameter (MLB, NFL, NBA, or NHL) and returns a structured response containing displayedText, colourLegend, allLeagues, and selectedSport fields, plus session metadata (uu, sDate, adrt). This gives you a full directory of publicly listed leagues on Fantrax without needing to know league IDs in advance.
Once you have a league_id, get_league_info returns detailed configuration for that league: leagueName, endDate, playerInfo (a map of player IDs to eligiblePos and status), rosterInfo (including positionConstraints, maxTotalPlayers, maxTotalActivePlayers), and draftSettings containing draftType. This is the endpoint to use when you need to understand how a league is structured before analyzing its data.
Standings and Draft Results
The get_standings endpoint returns an array sorted by rank, with each entry including teamId, teamName, points, winPercentage, and gamesBack. Note that points may appear as a numeric string or a W-L-T formatted string depending on the league scoring format, so parse accordingly.
get_draft_results returns a full record of a completed (or in-progress) draft. The response includes draftDate, startDate, endDate, draftType (e.g. snake), an ordered draftOrder array of team IDs, and a draftPicks array where each object contains round, pick, pickInRound, teamId, playerId, and time. The draftState field indicates whether the draft is completed or still active.
- Build a draft board replay tool using
draftPicksround and pick-number fields to reconstruct pick order. - Track standings changes over time by polling
get_standingsand storingrank,winPercentage, andgamesBackfor each team. - Filter public MLB leagues by sport code using
get_published_leaguesto populate a league discovery interface. - Analyze roster construction rules by comparing
positionConstraintsandmaxTotalPlayersvalues across multiple leagues. - Identify which players are eligible at multiple positions by inspecting the
eligiblePosfield inplayerInfofromget_league_info. - Compare draft strategies across leagues by aggregating
draftTypeanddraftOrderdata fromget_draft_results. - Monitor player availability status by checking the
statusfield on each player ID returned inplayerInfo.
| 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 | 250 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 and how is the `points` field formatted?+
rank, teamId, teamName, gamesBack, winPercentage, and points. The points field is a string and its format depends on the league's scoring system — it can be a numeric total-points value or a W-L-T record string. You should check the format before arithmetic operations.Does the API cover waiver wire activity, trade history, or weekly matchup results?+
Are private or password-protected Fantrax leagues accessible through this API?+
get_published_leagues returns public leagues, and get_league_info, get_standings, and get_draft_results work with the league IDs found there. Private leagues not surfaced in public listings are not covered. You can fork the API on Parse if you need to extend it for other access patterns.How do I find a valid `league_id` to use with the detail endpoints?+
get_published_leagues with a sport parameter (MLB, NFL, NBA, or NHL). The allLeagues array in the response contains league entries that include alphanumeric league IDs — for example, a string like zxdiqa7umlzjgwpo. Pass that value as league_id to get_league_info, get_standings, or get_draft_results.