Box scores

GET https://baseball.highlightly.net/box-scores/{id} MLB & NCAA API
GET https://sports.highlightly.net/baseball/box-scores/{id} All Sports API

Retrieve per player statistics for one game.

Refresh interval
Every minute
Level
Per player

The path parameter is the match id, which comes from matches.

This is the per player view of a single game, and at a one minute refresh it is fast enough to drive a live box score rather than only a post game one.

Shape of the response

The response is an array of exactly two elements, home team first, then away team.

Each element holds a team object with the team's id, name and logo, and beside it a boxScores list with one record per player. Each record holds a player object with the player's id and name, and a statistics list.

Batting

Statistic Measures
Total At-Bats Official at bats for the player.
Total Runs Scored Times the player scored a run.
Total Hits Hits recorded.
Total Runs Batted In Runs driven in by the player's offensive actions.
Total Home Runs Home runs hit.
Total Walks Bases on balls earned.
Total Strikeouts Times struck out while batting.
Total Pitches Thrown (Batting) Pitches seen while at bat.
Batting Average Hits divided by at bats.
On-Base Percentage How often the player reaches base safely.
Slugging Percentage Batting power, based on total bases per at bat.

Pitching

Statistic Measures
Innings Pitched Innings pitched.
Hits Allowed Hits allowed by the pitcher.
Runs Allowed Runs given up.
Total Earned Runs Runs that scored without defensive errors.
Total Walks Allowed Batters walked.
Total Strikeouts Batters struck out.
Home Runs Allowed Home runs conceded.
Earned Run Average Average earned runs allowed per nine innings.
Total Pitches Thrown (Pitching) Pitches thrown.

Per player and team totals

This endpoint breaks a game down to one record per player. For the same game aggregated to two team records, including fielding, use match statistics, which refreshes at the same rate.

Parameters

Parameter Type Description
idrequired numberpath Requested match id

Request

curl --request GET \
  --url 'https://baseball.highlightly.net/box-scores/{id}' \
  --header 'x-rapidapi-key: YOUR_API_KEY'
const response = await fetch('https://baseball.highlightly.net/box-scores/{id}', {
  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/box-scores/{id}',
    headers={
        'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
    },
    timeout=10,
)

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

Response

teamBaseballPlayerBoxScoreTeamResponserequired3 fields
idnumberrequired
namestringrequired
logostring
boxScoresBaseballBoxScoreItemResponse[]required7 fields
playerBaseballBoxScorePlayerResponserequired2 fields
idnumberrequired
namestringrequired
statisticsBaseballBoxScoreStatisticsItemResponse[]required3 fields
namestringrequired
groupstringrequired
valuenumberrequired

Example response

200 application/json
[
  {
    "team": {
      "id": 10291185,
      "name": "Toronto Blue Jays",
      "logo": "https://highlightly.net/baseball/images/teams/10291185.png "
    },
    "boxScores": [
      {
        "player": {
          "id": 482237,
          "name": "George Springer"
        },
        "statistics": [
          {
            "name": "Total At-Bats",
            "group": "Batting",
            "value": 6
          }
        ]
      }
    ]
  }
]

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.