> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sportsapipro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recent Form

> Retrieve a team's recent match results to analyze current form and performance trends

## 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

<ParamField query="competitor" type="integer" required>
  The competitor/team ID to retrieve recent form for
</ParamField>

<ParamField query="numOfGames" type="integer" default="5">
  Number of recent games to return (typically 5-10)
</ParamField>

<ParamField query="appTypeId" type="integer">
  Application type identifier (auto-resolved)
</ParamField>

<ParamField query="langId" type="integer">
  Language identifier (auto-resolved)
</ParamField>

<ParamField query="timezoneName" type="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.
</ParamField>

<ParamField query="userCountryId" type="integer">
  User's country for localization (auto-resolved)
</ParamField>

## Response Structure

<ResponseField name="sports" type="array">
  Array of sport definitions

  <Expandable title="Sport Object">
    <ResponseField name="id" type="integer">Sport ID</ResponseField>
    <ResponseField name="name" type="string">Sport name</ResponseField>
    <ResponseField name="nameForURL" type="string">URL-friendly name</ResponseField>
    <ResponseField name="drawSupport" type="boolean">Whether draws are possible</ResponseField>
    <ResponseField name="imageVersion" type="integer">Image version for caching</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="countries" type="array">
  Array of country definitions for teams in the results

  <Expandable title="Country Object">
    <ResponseField name="id" type="integer">Country ID</ResponseField>
    <ResponseField name="name" type="string">Country name</ResponseField>
    <ResponseField name="nameForURL" type="string">URL-friendly name</ResponseField>
    <ResponseField name="sportTypes" type="array">Sport type IDs available</ResponseField>
    <ResponseField name="imageVersion" type="integer">Image version</ResponseField>
    <ResponseField name="isInternational" type="boolean">International region flag</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="competitions" type="array">
  Array of competitions the team played in

  <Expandable title="Competition Object">
    <ResponseField name="id" type="integer">Competition ID</ResponseField>
    <ResponseField name="countryId" type="integer">Country ID</ResponseField>
    <ResponseField name="sportId" type="integer">Sport ID</ResponseField>
    <ResponseField name="name" type="string">Competition name</ResponseField>
    <ResponseField name="longName" type="string">Full competition name</ResponseField>
    <ResponseField name="shortName" type="string">Abbreviated name</ResponseField>
    <ResponseField name="hasStandings" type="boolean">Has league standings</ResponseField>
    <ResponseField name="hasBrackets" type="boolean">Has tournament brackets</ResponseField>
    <ResponseField name="hasStats" type="boolean">Has statistics</ResponseField>
    <ResponseField name="nameForURL" type="string">URL-friendly name</ResponseField>
    <ResponseField name="popularityRank" type="integer">Popularity ranking</ResponseField>
    <ResponseField name="imageVersion" type="integer">Image version</ResponseField>
    <ResponseField name="color" type="string">Brand color (hex)</ResponseField>
    <ResponseField name="currentSeasonNum" type="integer">Current season number</ResponseField>
    <ResponseField name="isInternational" type="boolean">International competition</ResponseField>
    <ResponseField name="hasHistory" type="boolean">Has historical data</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="competitors" type="array">
  Array of all teams involved in the matches

  <Expandable title="Competitor Object">
    <ResponseField name="id" type="integer">Competitor ID</ResponseField>
    <ResponseField name="countryId" type="integer">Country ID</ResponseField>
    <ResponseField name="sportId" type="integer">Sport ID</ResponseField>
    <ResponseField name="name" type="string">Team name</ResponseField>
    <ResponseField name="shortName" type="string">Abbreviated name</ResponseField>
    <ResponseField name="longName" type="string">Full official name</ResponseField>
    <ResponseField name="symbolicName" type="string">3-letter code</ResponseField>
    <ResponseField name="score" type="number">Score in last match</ResponseField>
    <ResponseField name="isWinner" type="boolean">Won last match</ResponseField>
    <ResponseField name="nameForURL" type="string">URL-friendly name</ResponseField>
    <ResponseField name="imageVersion" type="integer">Image version</ResponseField>
    <ResponseField name="color" type="string">Primary color (hex)</ResponseField>
    <ResponseField name="awayColor" type="string">Away kit color (hex)</ResponseField>
    <ResponseField name="mainCompetitionId" type="integer">Primary league ID</ResponseField>
    <ResponseField name="hasSquad" type="boolean">Has squad data</ResponseField>
    <ResponseField name="redCards" type="integer">Red cards (if any)</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="games" type="array">
  Array of recent match results

  <Expandable title="Game Object">
    <ResponseField name="id" type="integer">Game ID</ResponseField>
    <ResponseField name="sportId" type="integer">Sport ID</ResponseField>
    <ResponseField name="competitionId" type="integer">Competition ID</ResponseField>
    <ResponseField name="seasonNum" type="integer">Season number</ResponseField>
    <ResponseField name="stageNum" type="integer">Stage number</ResponseField>
    <ResponseField name="roundNum" type="integer">Round number</ResponseField>
    <ResponseField name="roundName" type="string">Round name</ResponseField>
    <ResponseField name="competitionDisplayName" type="string">Full display name</ResponseField>
    <ResponseField name="startTime" type="string">ISO 8601 start time</ResponseField>
    <ResponseField name="statusGroup" type="integer">Status group (4=Ended)</ResponseField>
    <ResponseField name="statusText" type="string">Human-readable status</ResponseField>
    <ResponseField name="shortStatusText" type="string">Abbreviated status</ResponseField>
    <ResponseField name="homeCompetitor" type="object">Home team with score and outcome</ResponseField>
    <ResponseField name="awayCompetitor" type="object">Away team with score and outcome</ResponseField>
    <ResponseField name="outcome" type="integer">Match outcome for requested team</ResponseField>
    <ResponseField name="winner" type="integer">Winner indicator (1=home, 2=away, 0=draw)</ResponseField>
    <ResponseField name="scores" type="array">Array of \[homeScore, awayScore]</ResponseField>
    <ResponseField name="hasVideo" type="boolean">Video highlights available</ResponseField>
  </Expandable>
</ResponseField>

## Outcome Values

| Value | Description |
| ----- | ----------- |
| 1     | Win         |
| 2     | Draw        |
| 3     | Loss        |

## Winner Values

| Value | Description   |
| ----- | ------------- |
| 0     | Draw          |
| 1     | Home team won |
| 2     | Away team won |

## Example Request

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

## Example Response

```json theme={null}
{
  "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

```javascript theme={null}
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
```


## OpenAPI

````yaml GET /competitors/recentForm
openapi: 3.1.0
info:
  title: SportsAPI Pro - Basketball API
  description: >-
    Professional basketball data API providing live scores, standings, player
    statistics, betting odds, and more for NBA, EuroLeague, and 50+ leagues
    worldwide.
  version: 1.0.0
  contact:
    name: SportsAPI Pro Support
    email: support@sportsapipro.com
servers:
  - url: https://v1.basketball.sportsapipro.com
    description: Production API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Games
    description: Live scores, fixtures, and game data
  - name: Competitions
    description: Leagues and tournaments
  - name: Standings
    description: League standings and rankings
  - name: Athletes
    description: Player statistics and data
  - name: Betting
    description: Betting lines, props, and predictions
  - name: Search
    description: Search entities
  - name: Account
    description: Account status and usage
paths:
  /competitors/recentForm:
    get:
      tags:
        - Competitions
      summary: Team Recent Form
      description: Get recent game results and form for a basketball team
      operationId: getRecentForm
      parameters:
        - name: competitor
          in: query
          required: true
          description: Team/Competitor ID
          schema:
            type: integer
            example: 2827
        - name: numOfGames
          in: query
          description: Number of recent games to return
          schema:
            type: integer
            default: 5
      responses:
        '200':
          description: Recent form retrieved successfully
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your SportsAPI Pro API key

````