Last five games

GET https://baseball.highlightly.net/last-five-games MLB & NCAA API
GET https://sports.highlightly.net/baseball/last-five-games All Sports API

Retrieve the last five finished games for a team.

Refresh interval
Immediately once a game is considered finished
Pagination
Not paginated

Specify teamId, which comes from teams.

This is the endpoint behind a form guide. Call it for both sides of an upcoming game and you have the recent form section commonly shown above a preview. For the record between those two specific teams, use head to head instead.

A form guide built from the last five finished games

Parameters

Parameter Type Description
teamIdrequired number No description in the spec.e.g. 10291525

Request

curl --request GET \
  --url 'https://baseball.highlightly.net/last-five-games?teamId=10291525' \
  --header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
  teamId: '10291525'
})
const response = await fetch(`https://baseball.highlightly.net/last-five-games?${params}`, {
  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/last-five-games',
    params={
        'teamId': '10291525',
    },
    headers={
        'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
    },
    timeout=10,
)

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

Response

idnumberrequired
roundstringrequired
datestringrequired
leaguestringrequired
seasonnumberrequired
awayTeamBaseballMatchTeamResponserequired5 fields
idnumberrequired
logostring
namestring
displayNamestringrequired
abbreviationstringrequired
homeTeamBaseballMatchTeamResponserequired5 fields
idnumberrequired
logostring
namestring
displayNamestringrequired
abbreviationstringrequired
stateBaseballMatchStateResponserequired12 fields
descriptionstringrequiredFinishedPostponedPeriod EndRain DelayScheduledHalf TimeIn ProgressCanceledUnknownSuspendedAbandoned
reportstringAdditional description of the match state.
scoreBaseballMatchScoreResponserequired9 fields
homeBaseballMatchScorerequired3 fields
hitsnumber
errorsnumber
inningsstring[]requiredScores for each played inning.
awayBaseballMatchScorerequired3 fields
hitsnumber
errorsnumber
inningsstring[]requiredScores for each played inning.
currentstring

Example response

200 application/json
[
  {
    "id": 394,
    "round": "regular-season",
    "date": "2024-03-06T00:30:00.000Z",
    "league": "NCAA",
    "season": 2024,
    "awayTeam": {
      "id": 219,
      "logo": "https://example.com/logos/team/219.png",
      "name": "Bears",
      "displayName": "Baylor",
      "abbreviation": "BAY"
    },
    "homeTeam": {
      "id": 219,
      "logo": "https://example.com/logos/team/219.png",
      "name": "Bears",
      "displayName": "Baylor",
      "abbreviation": "BAY"
    },
    "state": {
      "description": "Finished",
      "report": "Final",
      "score": {
        "home": {
          "hits": 4,
          "errors": 2,
          "innings": [
            0,
            0,
            1,
            1,
            0,
            0,
            1,
            1,
            1
          ]
        },
        "away": {
          "hits": 4,
          "errors": 2,
          "innings": [
            0,
            0,
            1,
            1,
            0,
            0,
            1,
            1,
            1
          ]
        },
        "current": "5 - 8"
      }
    }
  }
]

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.