Skip to main content
GET
/
games
/
results
Completed Games
curl --request GET \
  --url https://v1.basketball.sportsapipro.com/games/results \
  --header 'x-api-key: <api-key>'

Team Results

Retrieve past match results for a specific team or competitor.
Important: Current Season OnlyThis endpoint returns results for the current season only by default. Pagination will stop at the beginning of the current season - you cannot paginate into previous seasons using aftergame and direction.For multi-season historical data (e.g., 5 seasons for prediction modeling), see Historical Season Data.

Endpoint

GET /games/results

Description

Returns a list of completed games (results) for a specific competitor (team). This endpoint focuses on finished matches, providing final scores, statistics, and optional betting odds outcomes.

Parameters

ParameterTypeRequiredDescription
competitorsnumberNo*The competitor (team) ID to get results for
competitionsnumberNo*Competition ID to filter by (e.g., 7 for Premier League)
aftergamenumberNoGame ID cursor for pagination (from paging.previousPage or paging.nextPage)
directionnumberNoPagination direction: -1 for older games, 1 for newer games
showOddsbooleanNoInclude betting odds in response (default: true)
includeTopBettingOpportunitynumberNoInclude top betting opportunities (1 = yes)
topBookmakernumberNoFilter odds by specific bookmaker ID
*At least one of competitors or competitions should be provided to filter results.

Auto-Resolved Parameters

These parameters are automatically determined by the API based on the user’s context:
ParameterDescription
appTypeIdClient application type identifier
langIdLanguage identifier for localized content
timezoneNameUser’s timezone for time formatting (can be overridden with IANA timezone, e.g., America/New_York)
userCountryIdUser’s country for regional content
All startTime fields use ISO 8601 format with a dynamic timezone offset based on the resolved or specified timezone.

Request Example

curl -X GET "https://v1.football.sportsapipro.com/games/results?competitors=110&showOdds=true" \
  -H "x-api-key: YOUR_API_KEY"

Response Structure

{
  "lastUpdateId": 5495176319,
  "requestedUpdateId": -1,
  "ttl": 300,
  "paging": {
    "previousPage": "/web/games/?competitors=110&direction=-1...",
    "nextPage": "/web/games/?competitors=110&direction=1..."
  },
  "summary": {},
  "competitionFilters": [...],
  "sports": [...],
  "countries": [...],
  "competitions": [...],
  "competitors": [...],
  "games": [...],
  "bookmakers": [...]
}

Response Fields

Root Object

FieldTypeDescription
lastUpdateIdnumberInternal versioning ID for caching and incremental updates
requestedUpdateIdnumberThe update ID requested by client (-1 = latest)
ttlnumberTime To Live in seconds (cache duration: 300s)
pagingobjectPagination links for previous/next pages
summaryobjectSummary statistics (may be empty)
competitionFiltersarrayCompetitions the team has played in
sportsarraySport definitions
countriesarrayCountry data for competitions
competitionsarrayFull competition details
competitorsarrayTeam/competitor details
gamesarrayList of completed match results
bookmakersarrayBookmaker information for odds

Competition Filter Object

{
  "id": 7,
  "countryId": 1,
  "sportId": 1,
  "name": "Premier League",
  "shortName": "EPL",
  "hasBrackets": false,
  "nameForURL": "premier-league",
  "popularityRank": 92856977,
  "imageVersion": 12,
  "currentStageType": 1,
  "color": "#075C9C",
  "competitorsType": 0,
  "currentPhaseNum": -1,
  "currentSeasonNum": 131,
  "currentStageNum": 1,
  "hideOnCatalog": false,
  "hideOnSearch": false,
  "isInternational": false
}
FieldTypeDescription
idnumberCompetition unique identifier
countryIdnumberCountry the competition belongs to
sportIdnumberSport type identifier
namestringFull competition name
shortNamestringAbbreviated competition name
longNamestringExtended competition name (optional)
hasBracketsbooleanWhether competition has bracket/knockout stages
nameForURLstringURL-safe competition name
popularityRanknumberPopularity score for sorting
imageVersionnumberVersion number for competition logo
currentStageTypenumberCurrent stage type (1=league, 3=knockout)
colorstringBrand color for the competition (hex)
competitorsTypenumberType of competitors (0=clubs, 1=national teams)
currentPhaseNumnumberCurrent phase number (-1 if not applicable)
currentSeasonNumnumberCurrent season number
currentStageNumnumberCurrent stage number
hideOnCatalogbooleanWhether to hide in catalog views
hideOnSearchbooleanWhether to hide in search results
isInternationalbooleanWhether it’s an international competition

Paging Object

FieldTypeDescription
previousPagestringURL path to previous page of results
nextPagestringURL path to next page of results

Use Cases

Get Team’s Recent Results

Retrieve the latest match results for a specific team:
const teamId = 110; // Manchester City
const results = await sportsApi.get('/games/results', {
  competitors: teamId,
  showOdds: true
});

// All games returned are completed matches
results.games.forEach(game => {
  const homeScore = game.homeCompetitor.score;
  const awayScore = game.awayCompetitor.score;
  console.log(`${game.homeCompetitor.name} ${homeScore} - ${awayScore} ${game.awayCompetitor.name}`);
});

Calculate Form (Last 5 Games)

const results = await sportsApi.get('/games/results', {
  competitors: 110
});

const teamId = 110;
const lastFive = results.games.slice(0, 5);

const form = lastFive.map(game => {
  const isHome = game.homeCompetitor.id === teamId;
  const teamScore = isHome ? game.homeCompetitor.score : game.awayCompetitor.score;
  const opponentScore = isHome ? game.awayCompetitor.score : game.homeCompetitor.score;
  
  if (teamScore > opponentScore) return 'W';
  if (teamScore < opponentScore) return 'L';
  return 'D';
});

console.log(`Form: ${form.join('')}`); // e.g., "WWDLW"

Filter Results by Competition

const results = await sportsApi.get('/games/results', {
  competitors: 110
});

// Get only Premier League results
const premierLeagueId = 7;
const leagueResults = results.games.filter(
  game => game.competitionId === premierLeagueId
);

console.log(`Premier League games: ${leagueResults.length}`);

Comparison: Results vs Fixtures

EndpointPurposeGames Returned
/games/resultsPast matchesOnly completed games
/games/fixturesAll matchesBoth upcoming and completed
Use /games/results when you specifically need historical match data without upcoming fixtures.

Image URLs

https://v1.football.sportsapipro.com/images/competitions/{id}?imageVersion={imageVersion}

Pagination

This endpoint uses cursor-based pagination via the aftergame and direction parameters.

How It Works

  1. Make your initial request without pagination parameters
  2. The response includes a paging object with previousPage and nextPage URLs
  3. Extract the aftergame value from these URLs for subsequent requests
  4. Use direction=-1 for older games, direction=1 for newer games

Pagination Example

async function fetchAllTeamResults(teamId) {
  const allGames = [];
  let aftergame = null;
  
  while (true) {
    const params = new URLSearchParams({ competitors: teamId });
    if (aftergame) {
      params.set('aftergame', aftergame);
      params.set('direction', '-1'); // Get older games
    }
    
    const response = await fetch(
      `https://v1.football.sportsapipro.com/games/results?${params}`,
      { headers: { 'x-api-key': 'YOUR_API_KEY' } }
    );
    
    const data = await response.json();
    allGames.push(...data.games);
    
    // Check if there are more older games
    if (!data.paging?.previousPage) break;
    
    // Extract cursor for next page
    const match = data.paging.previousPage.match(/aftergame=(\d+)/);
    if (!match) break;
    aftergame = match[1];
    
    // Respect rate limits
    await new Promise(r => setTimeout(r, 100));
  }
  
  return allGames;
}

Notes

  • The ttl value (300 seconds / 5 minutes) indicates how long the response can be cached
  • Use paging.previousPage to navigate to older games, paging.nextPage for newer games
  • Results are returned in reverse chronological order (most recent first)
  • The competitionFilters array shows all competitions the team has played in
  • Games include final scores, winner information, and optional betting outcome data
  • When fetching historical data, use the cursor from paging.previousPage with direction=-1

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

competitions
integer

Filter by competition ID

Example:

132

date
string<date>

Filter by date (YYYY-MM-DD)

Response

200

Results retrieved successfully