Skip to content

MLB v3 Stats API

by sportsdata.io

API keyHTTPSEntertainment
Open documentation ↗

Overview

MLB scores, stats, and news API.

MLB v3 Stats is an entertainment API from sportsdata.io. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 34 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Base URL
http://azure-api.sportsdata.io/v3/mlb/stats
Version
1.0
Endpoints
34
Spec updated
2023-03-05

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "http://azure-api.sportsdata.io/v3/mlb/stats/FORMAT/AllTeams" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("http://azure-api.sportsdata.io/v3/mlb/stats/FORMAT/AllTeams", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "http://azure-api.sportsdata.io/v3/mlb/stats/FORMAT/AllTeams",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/{format}/AllTeamsTeams (All)
GET/{format}/AreAnyGamesInProgressAre Games In Progress
GET/{format}/BoxScore/{gameid}Box Score
GET/{format}/BoxScores/{date}Box Scores by Date
GET/{format}/BoxScoresDelta/{date}/{minutes}Box Scores by Date Delta
GET/{format}/CurrentSeasonCurrent Season
GET/{format}/DfsSlatesByDate/{date}DFS Slates by Date
GET/{format}/FreeAgentsPlayer Details by Free Agents
GET/{format}/Games/{season}Schedules
GET/{format}/GamesByDate/{date}Games by Date
GET/{format}/HitterVsPitcher/{hitterid}/{pitcherid}Batter vs. Pitcher Stats
GET/{format}/NewsNews
GET/{format}/NewsByDate/{date}News by Date
GET/{format}/NewsByPlayerID/{playerid}News by Player
GET/{format}/Player/{playerid}Player Details by Player
GET/{format}/PlayerGameStatsByDate/{date}Player Game Stats by Date
GET/{format}/PlayerGameStatsByPlayer/{date}/{playerid}Player Game Stats by Player
GET/{format}/PlayerGameStatsBySeason/{season}/{playerid}/{numberofgames}Player Game Logs By Season
GET/{format}/PlayerSeasonAwayStats/{season}Player Season Away Stats
GET/{format}/PlayerSeasonHomeStats/{season}Player Season Home Stats
GET/{format}/PlayerSeasonSplitStats/{season}/{split}Player Season Split Stats
GET/{format}/PlayerSeasonStats/{season}Player Season Stats
GET/{format}/PlayerSeasonStatsByPlayer/{season}/{playerid}Player Season Stats By Player
GET/{format}/PlayerSeasonStatsByTeam/{season}/{team}Player Season Stats by Team
GET/{format}/PlayerSeasonStatsSplitByTeam/{season}Player Season Stats Split By Team
GET/{format}/PlayersPlayer Details by Active
GET/{format}/Players/{team}Players by Team
GET/{format}/StadiumsStadiums
GET/{format}/Standings/{season}Standings
GET/{format}/TeamGameStatsByDate/{date}Team Game Stats by Date
GET/{format}/TeamGameStatsBySeason/{season}/{teamid}/{numberofgames}Team Game Logs By Season
GET/{format}/TeamHittersVsPitcher/{gameid}/{team}Team Hitting vs. Starting Pitcher
GET/{format}/TeamSeasonStats/{season}Team Season Stats
GET/{format}/teamsTeams (Active)

Questions

Does the MLB v3 Stats API need an API key?

Yes. The MLB v3 Stats API uses API key authentication; the documentation explains how to get credentials.

Does the MLB v3 Stats API support HTTPS?

Yes, the MLB v3 Stats API is served over HTTPS.

How many endpoints does the MLB v3 Stats API have?

Its OpenAPI description lists 34 endpoints in version 1.0. All of them are shown on this page.

What are alternatives to the MLB v3 Stats API?

Other Entertainment APIs include Techy, Imgflip, Official Joke, Betfair: Exchange Streaming API, Listen API: Podcast Search, Directory, and Insights API.

Compare alternatives →

Listed from APIs.guru (CC0).