Skip to main content
GET
/
competitors
/
recentForm
Team Recent Form
curl --request GET \
  --url https://v1.basketball.sportsapipro.com/competitors/recentForm \
  --header 'x-api-key: <api-key>'

Overview

The Recent Form endpoint returns a teamโ€™s most recent completed matches, showing wins, draws, and losses. This data is essential for form analysis, betting insights, and understanding a teamโ€™s current momentum.

Query Parameters

competitor
integer
required
The competitor/team ID to retrieve recent form for
numOfGames
integer
default:"5"
Number of recent games to return (typically 5-10)
appTypeId
integer
Application type identifier (auto-resolved)
langId
integer
Language identifier (auto-resolved)
timezoneName
string
Timezone for date/time values (auto-resolved, or specify e.g., America/New_York). All startTime fields use ISO 8601 format with a dynamic timezone offset.
userCountryId
integer
Userโ€™s country for localization (auto-resolved)

Response Structure

sports
array
Array of sport definitions
countries
array
Array of country definitions for teams in the results
competitions
array
Array of competitions the team played in
competitors
array
Array of all teams involved in the matches
games
array
Array of recent match results

Outcome Values

ValueDescription
1Win
2Draw
3Loss

Winner Values

ValueDescription
0Draw
1Home team won
2Away team won

Example Request

curl -X GET "https://v1.football.sportsapipro.com/competitors/recentForm?competitor=110&numOfGames=5" \
  -H "x-api-key: YOUR_API_KEY"

Example Response

{
  "sports": [
    {
      "id": 1,
      "name": "Football",
      "nameForURL": "football",
      "drawSupport": true,
      "imageVersion": 1
    }
  ],
  "countries": [
    {
      "id": 1,
      "name": "England",
      "nameForURL": "england",
      "imageVersion": 1
    }
  ],
  "competitions": [
    {
      "id": 7,
      "countryId": 1,
      "sportId": 1,
      "name": "Premier League",
      "shortName": "EPL",
      "hasStandings": true,
      "nameForURL": "premier-league",
      "color": "#075C9C"
    },
    {
      "id": 572,
      "countryId": 19,
      "sportId": 1,
      "name": "UEFA Champions League",
      "shortName": "UCL",
      "nameForURL": "uefa-champions-league",
      "color": "#09123E"
    }
  ],
  "competitors": [
    {
      "id": 110,
      "name": "Manchester City",
      "shortName": "Man City",
      "symbolicName": "MCI",
      "imageVersion": 1,
      "color": "#ABD1F5"
    }
  ],
  "games": [
    {
      "id": 4609055,
      "sportId": 1,
      "competitionId": 9,
      "competitionDisplayName": "EFL Cup - Quarter Finals",
      "startTime": "2025-12-17T19:30:00+00:00",
      "statusGroup": 4,
      "statusText": "Ended",
      "homeCompetitor": {
        "id": 110,
        "name": "Manchester City",
        "shortName": "Man City",
        "score": 2.0,
        "isWinner": true,
        "outcome": 1
      },
      "awayCompetitor": {
        "id": 63,
        "name": "Brentford",
        "score": 0.0,
        "isWinner": false,
        "outcome": 1
      },
      "outcome": 1,
      "winner": 1,
      "scores": [2.0, 0.0]
    },
    {
      "id": 4452723,
      "competitionDisplayName": "Premier League",
      "startTime": "2025-12-14T14:00:00+00:00",
      "statusText": "Ended",
      "homeCompetitor": {
        "id": 10,
        "name": "Crystal Palace",
        "score": 0.0,
        "isWinner": false,
        "outcome": 1
      },
      "awayCompetitor": {
        "id": 110,
        "name": "Manchester City",
        "score": 3.0,
        "isWinner": true,
        "outcome": 1
      },
      "outcome": 1,
      "winner": 2,
      "scores": [0.0, 3.0]
    }
  ]
}

Use Cases

  1. Form Analysis: Display W-D-L streak (e.g., โ€œWWWWWโ€ for 5 consecutive wins)
  2. Betting Insights: Analyze recent performance before placing bets
  3. Match Previews: Show both teamsโ€™ recent form before a match
  4. Team Profiles: Display current momentum and recent results
  5. Head-to-Head Context: Combine with H2H data for comprehensive analysis

Calculating Form String

const getFormString = (games, competitorId) => {
  return games.map(game => {
    const isHome = game.homeCompetitor.id === competitorId;
    const teamScore = isHome ? game.scores[0] : game.scores[1];
    const oppScore = isHome ? game.scores[1] : game.scores[0];
    
    if (teamScore > oppScore) return 'W';
    if (teamScore < oppScore) return 'L';
    return 'D';
  }).join('');
};

// Example: "WWWWW" for Manchester City's last 5 games

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

competitor
integer
required

Team/Competitor ID

Example:

2827

numOfGames
integer
default:5

Number of recent games to return

Response

200

Recent form retrieved successfully