Skip to content

Livematches in play

Demo: Matchboard, opens in a new tab

Football · USA · 30 clubs

MLS API with both conferences and every season since 2008

An MLS API that puts the conference and overall tables, fixtures, live scores, line-ups and statistics behind league id 6540. The archive starts with 2008 and labels each season by the calendar year it is played in, and the JSON matches every other football league in the data.

  • 19 seasons since 2008
  • 30 clubs in two conferences
  • League id 6540
  • Conference tables in one call

MLS

GET /v2/leagues/6540

League id
6540
Category
USA
Tier
1
Archive
19 seasons since 2008
Teams
30 clubs in two conferences
Live channel
league:6540

In the data

The MLS in the API

What league id 6540 holds, and how its seasons are laid out.

One season per calendar year

MLS seasons start and finish in the same year, so the source labels each one with a single year: for the current season year is 2026, and startYear and endYear are equal. /v2/leagues/6540/seasons runs from 2026 back to 2008, and the league card dates the current season from 21 February to 18 December 2026. The same card names Inter Miami CF as titleHolder and LA Galaxy, champions six times, in mostTitlesTeams.

Two conferences and an overall table

This season's 30 clubs are split into two conferences, and the standings hold three tables: one per conference and an overall table of all thirty. A plain /standings call returns the overall table, the one flagged primary; group=all returns all three, each conference under its own name with overall set to false. Rows carry each club's form and zone, and type=home or type=away gives the table from home or away matches only.

Next Pro, preseason and All-Star apart

MLS Next Pro, MLS Preseason and the MLS All Star Game are filed as three further competitions, none of them under 6540, so preseason friendlies and the all-star match never count towards the league's tables or leaderboards. /v2/search?q=mls returns them next to the league itself. To follow one club through everything it plays, /v2/teams/{id}/leagues lists its competitions and /v2/teams/{id}/fixtures its matches, upcoming or recent.

First request

The MLS in three calls

Every call starts from the league id, 6540. The seasons list gives the season ids, newest first, and the season id is what the tables, rounds, leaderboards and statistics ask for.

The answers use the usual { data, meta } envelope and the same field names as every other football competition, so the code works unchanged for the next league you add.

# Every season, newest first, with its season id
curl "https://api.datasportsapi.com/v2/leagues/6540/seasons" \
  -H "Authorization: Bearer $DATASPORTSAPI_API_KEY"

# Both conference tables and the overall one
curl "https://api.datasportsapi.com/v2/leagues/6540/standings?season={seasonId}&group=all" \
  -H "Authorization: Bearer $DATASPORTSAPI_API_KEY"

# Every match day of the season, as UTC dates
curl "https://api.datasportsapi.com/v2/leagues/6540/calendar?season={seasonId}" \
  -H "Authorization: Bearer $DATASPORTSAPI_API_KEY"
GET /v2/leagues/6540 · trimmed
{ "data": {
    "id": 6540, "name": "MLS", "sport": "football",
    "category": "USA", "tier": 1,
    "titleHolder": { "name": "Inter Miami CF", … },
    "mostTitles": 6, "mostTitlesTeams": [ { "name": "LA Galaxy", … } ],
    "currentSeasonStart": "2026-02-21", "currentSeasonEnd": "2026-12-18",
    …
} }

History

How much of the MLS each plan reads

The archive goes back to 2008. Each plan reads back a set time from today; nothing live or upcoming is ever held back.

TopicHistoryWhat it covers of the MLS
FreeLast 7 daysLive and upcoming matches, the table and statistics of a season still being played, and finished matches from the last 7 days.
StarterLast 30 daysLive and upcoming matches, the table and statistics of a season still being played, and finished matches from the last 30 days.
ProLast 6 monthsLive and upcoming matches, the table and statistics of a season still being played, and finished matches from the last 6 months.
BusinessLast 12 monthsLive and upcoming matches, the table and statistics of a season still being played, and finished matches from the last 12 months.
EnterpriseFull historyThe whole archive: 19 seasons since 2008.

Questions

MLS API, answered

Anything else? The full FAQ covers quota, plans and the data in general.

How do I get both MLS conference tables?

Add group=all to /v2/leagues/6540/standings?season={seasonId}. The answer holds all of the season's tables, both conferences and the overall one, each with its name, its rows and the primary and overall flags. Without the parameter you get the overall table alone, and meta.groupCount says how many tables the season holds.

Why is an evening MLS match listed under the next day?

Because dates in the API are UTC days. An evening kick-off on the US west coast falls after midnight UTC: 7.30 pm in Los Angeles is 02:30 UTC the next day while summer time applies, so /v2/fixtures?date= lists the match under that later date. Its startTime is a UTC instant to convert to the viewer's time zone, and /v2/leagues/6540/calendar gives the season's match days as UTC dates, each with a count.

Are MLS Next Pro, the preseason and the All-Star Game included?

Yes, as three separate competitions, MLS Next Pro, MLS Preseason and the MLS All Star Game, each under its own id with its own seasons; /v2/search?q=mls returns all three. Because they sit apart, a preseason friendly never turns up in league 6540's table or season leaderboards.

How far back does MLS data go?

To 2008: the archive holds 19 seasons of the MLS. How far back a key can read is set by its plan, counted back from today: Free 7 days, Starter 30 days, Pro 6 months, Business 12 months, and Enterprise the whole archive. Live and upcoming matches, and the table and statistics of a season still being played, are open on every plan.

Can I follow MLS matches live on the free plan?

Yes. Live and upcoming matches are never held back by a plan, so a Free key follows every MLS match in play through /v2/livescores or /v2/fixtures/{id}, with score, status and clock current to the second, within the plan's request quota. On Business and Enterprise, the WebSocket channel league:6540 pushes every change instead.

Keep reading

Other competitions

Everything in the football data Sports statistics API Live scores API

Build on the MLS today.

1,000 free requests a day during the beta. No card, no sales call.