---
title: "Get last five finished games for a specific team id"
method: GET
path: "/nba/last-five-games"
tags: ["NBA, NCAAB.Last Five Games"]
---

# Get last five finished games for a specific team id

`GET /nba/last-five-games`

## Request

- Base URL: `https://sports.highlightly.net`
- URL: `https://sports.highlightly.net/nba/last-five-games`
- Auth: none declared. Required headers: `x-rapidapi-host`, `x-rapidapi-key`
- TypeScript: <https://skmtc.dev/highlightly/apis/sports-api-highlightly/docs/nba/last-five-games/get.ts> (a function with typed inputs; its response is checked against the schema)

> Refresh interval: Immediately once a game is considered finished

Retrieve a list of the **last five finished** games for a specific team. If a game was not finished (e.g. was cancelled or postponed) it will *not* be returned.

Specify `teamId` query parameter to retrieve the data. Endpoint is used to create a form section between two teams that are playing a match. Below is an example of what can be achieved:

![Last five games example](https://highlightly.net/assets/img/documentation/l5g-nba.png)

## Query parameters

- `teamId` number, required

## Headers

- `x-rapidapi-host` string, required
- `x-rapidapi-key` string, required

## Response `200`

- NbaMatchResponseDto[]
  - `id` number, required
  - `league` 'NBA' | 'NCAA', required
  - `season` number, required
  - `state` NbaMatchStateResponseDto, required
    - `clock` number, required: Time left for a game to finish.
    - `score` NbaMatchScoreResponseDto, required
      - `awayTeam` number[], required: Current away team result for each inning.
      - `homeTeam` number[], required: Current home team result for each inning.
    - `period` number, required: Current period
    - `description` 'Suspended' | 'Postponed' | 'Cancelled' | 'Abandoned' | 'Finished' | 'Scheduled' | 'In progress' | 'End period' | 'Half time' | 'Unknown', required: Current game state description
  - `homeTeam` NbaTeamInfoResponseDto, required
    - `id` number, required
    - `displayName` string, required
    - `name` string, required
    - `logo` string
    - `abbreviation` string, required
  - `awayTeam` NbaTeamInfoResponseDto, required
    - `id` number, required
    - `displayName` string, required
    - `name` string, required
    - `logo` string
    - `abbreviation` string, required
  - `date` string, required

## Other responses

- `400`: Bad request descriptive error.
- `500`: Internal server error.

---

[API](https://skmtc.dev/highlightly/apis/sports-api-highlightly.md) - [All operations](https://skmtc.dev/highlightly/apis/sports-api-highlightly/llms.txt) - [OpenAPI document](https://skmtc.dev/highlightly/apis/sports-api-highlightly/revisions/c8a366d3091f?raw)
