Player statistics

GET https://baseball.highlightly.net/players/{id}/statistics MLB & NCAA API
GET https://sports.highlightly.net/baseball/players/{id}/statistics All Sports API

Retrieve detailed statistics for one player.

Refresh interval
Once a day
Aggregation
Per season

The player id comes from players.

Per season

Statistics are aggregated in the perSeason list. Each entry names its league and season, the teams the player played for, and a seasonBreakdown giving the coverage of its stats.

Season breakdown Includes
Entire Regular season and post season combined. Pre season is not included.
Season Regular season only.

Pick the one that matches the question. A season including post season games wants Entire, while a regular season only view wants Season. Both are per season, so a career figure means combining seasons yourself.

Statistic categories

Category Covers
Batting

Offensive performance at the plate, including hitting ability, power and on base success. Hits, batting average, home runs and RBIs.

Pitching

Performance in preventing runs and controlling opposing hitters. Innings pitched, strikeouts, walks and earned runs.

The statistics recorded depend on the player's position, so the results vary from player to player.

Player statistics rendered in a client application

Parameters

Parameter Type Description
idrequired numberpath Requested player id.

Request

curl --request GET \
  --url 'https://baseball.highlightly.net/players/{id}/statistics' \
  --header 'x-rapidapi-key: YOUR_API_KEY'
const response = await fetch('https://baseball.highlightly.net/players/{id}/statistics', {
  headers: {
    'x-rapidapi-key': process.env.HIGHLIGHTLY_API_KEY
  }
})

if (!response.ok) {
  throw new Error(`Highlightly responded ${response.status}`)
}

const data = await response.json()
import os
import requests

response = requests.get(
    'https://baseball.highlightly.net/players/{id}/statistics',
    headers={
        'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
    },
    timeout=10,
)

response.raise_for_status()
data = response.json()

Response

idnumberrequired
fullNamestring
logostring
perSeasonBaseballDetailedPlayerStatisticsPerSeason[]required14 fields
statsBaseballStatEntry[]requiredRelevant stats for player position.3 fields
namestringrequired
valuenumberrequired
categorystringrequiredPitchingBatting
teamsBaseballDetailedPlayerSummaryTeam[]requiredTeams for which the player played in a given season.6 fields
idnumberrequired
logostring
namestringrequired
leaguestringrequired
displayNamestringrequired
abbreviationstringrequired
leaguestringrequired
seasonnumberrequired
seasonBreakdownstringrequiredRepresents the coverage for the stored statistics. Pre-season is never included.EntireSeason

Example response

200 application/json
[
  {
    "id": 342182,
    "fullName": "Reese Albert",
    "logo": "",
    "perSeason": [
      {
        "stats": [
          {
            "name": "Player Hit By Pitch",
            "value": 7,
            "category": "Batting"
          }
        ],
        "teams": [
          {
            "id": 10291561,
            "logo": "https://highlightly.net/baseball/images/teams/10291561.png",
            "name": "Seminoles",
            "league": "MLB",
            "displayName": "Florida State",
            "abbreviation": "FSU"
          }
        ],
        "league": "MLB",
        "season": 2022,
        "seasonBreakdown": "Entire"
      }
    ]
  }
]

Values are the examples declared in the OpenAPI spec, not a captured live response.

Errors

Status Description
400 Bad request descriptive error.
500 Internal server error.