Last five games

GET https://nba.highlightly.net/last-five-games NBA & NCAAB API
GET https://sports.highlightly.net/nba/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. 3

Request

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

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

Response

idnumberrequired
leaguestringrequiredNBANCAA
seasonnumberrequired
stateNbaMatchStateResponserequired6 fields
clocknumberrequiredTime left for a game to finish.
scoreNbaMatchScoreResponserequired2 fields
awayTeamnumber[]requiredCurrent away team result for each inning.
homeTeamnumber[]requiredCurrent home team result for each inning.
periodnumberrequiredCurrent period
descriptionstringrequiredCurrent game state descriptionSuspendedPostponedCancelledAbandonedFinishedScheduledIn progressEnd periodHalf timeUnknown
homeTeamNbaTeamInfoResponserequired5 fields
idnumberrequired
displayNamestringrequired
namestringrequired
logostring
abbreviationstringrequired
awayTeamNbaTeamInfoResponserequired5 fields
idnumberrequired
displayNamestringrequired
namestringrequired
logostring
abbreviationstringrequired
datestringrequired

Example response

200 application/json
[
  {
    "id": 5294,
    "league": "NBA",
    "season": 2024,
    "state": {
      "clock": 0,
      "score": {
        "awayTeam": [
          0
        ],
        "homeTeam": [
          0
        ]
      },
      "period": 4,
      "description": "Finished"
    },
    "homeTeam": {
      "id": 3,
      "displayName": "Denver Nuggets",
      "name": "Nuggets",
      "logo": "https://highlightly.net/nba/images/teams/3.png",
      "abbreviation": "DEN"
    },
    "awayTeam": {
      "id": 3,
      "displayName": "Denver Nuggets",
      "name": "Nuggets",
      "logo": "https://highlightly.net/nba/images/teams/3.png",
      "abbreviation": "DEN"
    },
    "date": "2024-04-07T01:00:00.000Z"
  }
]

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.