How to analyze the team’s form based on statistical parameters?

What statistical indicators to consider when analyzing a team’s form

Team form is not just a series of wins or losses, but a combination of quantitative indicators that describe the quality of play over the last matches. When working with data through API, it is important to separate the result (score on the scoreboard) from the content of the game. For example, a team could win 3 matches in a row, but in terms of shots, possession, and duels, they could be inferior to their opponent in each of them. In such a case, the stability of form is questionable, which is critical for betting, sports analytics, and model building.

The basic group of metrics includes effectiveness (points, goals scored and conceded, goal difference), attacking indicators (total shots, shots on target, «big chances,» touches in the penalty area, passes in the final third), as well as defensive actions (conceded shots, interceptions, clearances, goalkeeper saves). In the extended version, ball possession, pass quality (accurate passes, long passes, crosses), aerial and ground duels, number of fouls and cards are added. All these parameters are available in the estadísticasDelPartido match response field: groups Resumen del partido, Disparos, Ataque, Passes, Duels, Defending, Goalkeeping contain a detailed breakdown for each match.

To correctly assess form through the API, it is usually necessary to analyze the last 5-10 official matches of the team, considering home and away games separately and the level of the tournament. For each match, average indicators are calculated using match statistics: average number of shots per game, average conceded xG (if a proprietary xG model is used), share of accurate passes, possession, number of duels and tackles. Based on such aggregated values, metrics such as «attack in current form,» «defense in current form,» «game intensity,» and «discipline» are formed, which can then be used in forecasting algorithms and when comparing with bookmaker odds.

// Пример извлечения ключевых статистик из ответа матча
const allPeriod = match.matchStatistics.find(s => s.period === 'ALL');
const overviewGroup = allPeriod.groups.find(g => g.groupName === 'Match overview');
const shotsGroup = allPeriod.groups.find(g => g.groupName === 'Shots');
const possession = overviewGroup.statisticsItems
  .find(i => i.key === 'ballPossession').homeValue; // владение, %
const totalShots = shotsGroup.statisticsItems
  .find(i => i.key === 'totalShotsOnGoal').homeValue; // все удары
const shotsOnTarget = shotsGroup.statisticsItems
  .find(i => i.key === 'shotsOnGoal').homeValue; // удары в створ

Where to find match statistics: overview of popular sports event APIs

For systematic analysis of a team’s form, manually collecting statistics from different sources is inefficient. It is more reliable to use specialized sports event APIs that provide structured data in a unified format for football, basketball, hockey, tennis, table tennis, esports, and other sports. Most solutions on the market fall into three categories: APIs only with scores and schedules, APIs with advanced match statistics, and APIs that combine sports data and bookmaker odds. The latter option is especially convenient for betting products and models that compare the actual strength of a team with market expectations.

La plataforma por el API de eventos deportivos api-sport.ru relates to comprehensive solutions. In one request to the endpoint /v2/{sportSlug}/partidos you can get not only the score and match status, but also a detailed block estadísticasDelPartido with ball possession, shots, passes, duels, as well as a field oddsBase with bookmaker odds on the main markets (1X2, totals, handicaps, etc.). This allows for comprehensive analytics: from game quality to market probability assessment. The data is standardized by sports, which simplifies the development of multi-sport applications and analytical dashboards.

Access to the API is done via HTTPS with authorization through an API key, which the user receives in tu cuenta personal en api-sport.ru. After obtaining the key, it is enough to send a request with the header Autorización to the desired sport. For example, to get a list of football matches on a specific date, the following is used GET https://api.api-sport.ru/v2/football/matches?date=2025-09-03. The response will contain an array partidos with fields for teams, tournaments, scores, odds, and statistics — a complete database for automatic form analysis.

// Пример запроса списка матчей через fetch
const API_KEY = 'ВАШ_API_КЛЮЧ';
fetch('https://api.api-sport.ru/v2/football/matches?date=2025-09-03', {
  headers: {
    Authorization: API_KEY
  }
})
  .then(res => res.json())
  .then(data => {
    console.log('Всего матчей:', data.totalMatches);
    console.log('Первый матч:', data.matches[0]);
  });

How to obtain team form data through API: step-by-step instructions

Analyzing the team form through the API can be conveniently structured as a sequential process. Step 1 — determine the sport type and obtain the corresponding sportSlug. To do this, a request is made to the endpoint /v2/deporte, which returns a list of sports and their identifiers. For example, for football, it is used fútbol, for hockey — hockey sobre hielo, for basketball — baloncesto. This parameter is then substituted into the request paths for matches, teams, tournaments, and players.

Step 2 — gather a pool of matches for the team of interest over the required period. Use the endpoint /v2/{sportSlug}/partidos with the filter equipo_id y estado completado, and if necessary add temporada_id or filter by tournaments torneo_id. This way you will get only completed official matches suitable for assessing form. Next, the final score (fields puntajeLocal, puntajeVisitante), statistics (estadísticasDelPartido) and coefficients (oddsBase). Based on this array, aggregated indicators are calculated: average goals per game, shots, possession, share of won duels, conversion of shots to goals, etc.

Step 3 — automate the calculation of form indicators in your service. The application can update data on the latest matches every few minutes (or in the future in WebSocket mode, which is planned to be launched in the api-sport.ru ecosystem) and recalculate moving averages for key metrics. For betting, it is additionally useful to compare actual results and statistics with closing odds from oddsBaseIf a team consistently exceeds market expectations, it is a signal for increased attention. As a result, you form your own «form index» of the team, which can be used in forecasting models, recommendation systems, and user dashboards.

// Шаг 2–3: получаем последние 5 матчей команды и считаем простые метрики
const API_KEY = 'ВАШ_API_КЛЮЧ';
const TEAM_ID = 195801; // пример ID команды
async function getTeamForm() {
  const url = `https://api.api-sport.ru/v2/football/matches?team_id=${TEAM_ID}&status=finished`;
  const res = await fetch(url, { headers: { Authorization: API_KEY } });
  const data = await res.json();
  const lastMatches = data.matches
    .sort((a, b) => a.startTimestamp - b.startTimestamp)
    .slice(-5); // последние 5 игр
  let goalsFor = 0;
  let goalsAgainst = 0;
  lastMatches.forEach(m => {
    const isHome = m.homeTeam.id === TEAM_ID;
    const scored = isHome ? m.homeScore.current : m.awayScore.current;
    const conceded = isHome ? m.awayScore.current : m.homeScore.current;
    goalsFor += scored;
    goalsAgainst += conceded;
  });
  console.log('Средние голы за игру:', goalsFor / lastMatches.length);
  console.log('Средние пропущенные голы:', goalsAgainst / lastMatches.length);
}
getTeamForm();

Analyzing team form by xG, shots, and ball possession based on statistics API

Advanced form analysis goes beyond the score and the number of wins/losses. Key metrics play a crucial role: shots, shots on target, ball possession, creating dangerous moments. The xG (expected goals) metric is often used as an external or proprietary calculated indicator of the quality of created and conceded chances. xG itself is not a standard response field in the API, but it can be calculated based on the details of shots and moments or loaded from a proprietary model synchronized with matches from the API. Meanwhile, such aggregated indicators as totalDisparosALaPortería, disparosALaPortería, granOportunidadCreada and possession ballPossession, are already available in estadísticasDelPartido and are great for assessing the «under-the-hood» strength of the team.

The practical approach to form analysis based on these parameters looks like this: for each match of the team, a period is selected. ALL в estadísticasDelPartido, then from groups Resumen del partido и Disparos the necessary indicators are extracted by keys. For example, ball possession ballPossession, total number of shots totalDisparosALaPortería, shots on target disparosALaPortería, big chances granOportunidadCreada. Next, for a series of 5–10 recent games, average values for each indicator are calculated and compared with similar metrics of opponents and league averages. If a team consistently takes more shots and creates more chances than it concedes, even with neutral results, this indicates good hidden form and potential «upside» in upcoming matches.

To integrate your own xG model, it is enough to store the match and team identifiers obtained from /v2/{sportSlug}/partidos, and link them to your xG calculations for each match. In the analytical interface, this allows you to display: goals scored/conceded, expected goals (xG), shots, and possession, forming a more complete picture. Based on such data, you can build graphs like «xG for the last 5 matches,» «xG difference,» «xG to actual goals ratio,» which is critical for advanced betting and models that account for regression to the mean.

// Извлечение владения и ударов из matchStatistics для анализа
function extractTeamStats(match, teamSide = 'home') {
  const allPeriod = match.matchStatistics.find(s => s.period === 'ALL');
  if (!allPeriod) return null;
  const overview = allPeriod.groups.find(g => g.groupName === 'Match overview');
  const shots = allPeriod.groups.find(g => g.groupName === 'Shots');
  const sideKey = teamSide === 'home' ? 'homeValue' : 'awayValue';
  const possession = overview.statisticsItems
    .find(i => i.key === 'ballPossession')[sideKey];
  const totalShots = shots.statisticsItems
    .find(i => i.key === 'totalShotsOnGoal')[sideKey];
  const shotsOnTarget = shots.statisticsItems
    .find(i => i.key === 'shotsOnGoal')[sideKey];
  return { possession, totalShots, shotsOnTarget };
}

How to evaluate a series of matches and the dynamics of team indicators using API data

A team’s form is always a story over time, so it is important to analyze not a single match, but a series of games and the dynamics of key metrics. Using the endpoint /v2/{sportSlug}/partidos you can get a chronological list of the team’s matches for the season or selected period, sorted by the field startTimestamp and then build time series on the metrics of interest: goals per game, shots, possession, number of dangerous moments, duels, goalkeeper saves, etc. On these series, moving averages are calculated (for example, for the last 5 matches) and trends are monitored: whether attacking activity is increasing, whether defense is not deteriorating, how discipline regarding fouls and cards is changing.

Additionally, it makes sense to separately consider home and away matches, as well as take into account the level of the tournament or playoff stage, filtering matches through the parameters torneo_id, temporada_id и category_ids. Combining match statistics with coefficients from oddsBase allows assessing not only the actual but also the «market» form: how the opening and closing coefficients for the team change, how often it outperforms bookmakers’ expectations. This approach is especially useful for betting services and forecasting models integrated with the api-sport.ru platform, where sports and betting data are available in a single API.

In dynamic mode (especially with the emergence of WebSocket data streams and AI tools in the api-sport.ru ecosystem), analytical dashboards can update graphs in real time, taking into account live events and changes in coefficients. This opens up opportunities for complex scenarios: alerts for a sharp decline in game quality during a match, automatic reassessment of the «form index» after each round, segmentation by individual lines (for example, defense or attack) and comparison of current form with the team’s historical highs. Based on such metrics, it is possible not only to assess the current strength of the team but also to find moments for early market entry before changes are fully reflected in the bookmakers’ lines.

// Построение временного ряда голов за матч для команды
function buildGoalsTimeSeries(matches, teamId) {
  const sorted = matches.sort((a, b) => a.startTimestamp - b.startTimestamp);
  return sorted.map(m => {
    const isHome = m.homeTeam.id === teamId;
    const scored = isHome ? m.homeScore.current : m.awayScore.current;
    const conceded = isHome ? m.awayScore.current : m.homeScore.current;
    return {
      matchId: m.id,
      date: m.dateEvent,
      scored,
      conceded
    };
  });
}

Typical mistakes when analyzing team form by statistical parameters and how to avoid them

Even with a quality API providing team form statistics, many analysts make the same mistakes. The first is using too small a sample: assessing form based on 1-2 matches almost always leads to overestimating random spikes or failures. The second is ignoring the context of opponents and tournaments: a series of victories over outsiders in a low division and a series of close matches against top clubs differ greatly in informativeness, although both formally appear as «good form.» The third common mistake is mixing official and friendly matches, as well as matches from different seasons without considering changes in squad, coach, and tactics.

At the API level, this manifests in incorrect filters: the absence of the parameter status=finished, skipping temporada_id, using too broad a period, not separating cup matches from league matches by torneo_id. Sometimes developers also misinterpret percentages and shares from estadísticasDelPartido (for example, comparing absolute possession values without considering the opponents’ style) or analyze only scored/conceded goals, ignoring shots and chances. Another mistake is completely ignoring bookmaker odds: if you don’t look at the dynamics oddsBase, it’s hard to understand whether the team has really become stronger or just played against weak opponents.

To avoid these problems, it’s important to develop a clear protocol for sampling and data processing in advance: a fixed analysis horizon (for example, the last 8-10 official matches within one season), filtering by status and tournament, separate accounting for home/away, checking the adequacy of statistics (outliers, unfilled fields). When implementing integration, ensure that your requests to /v2/{sportSlug}/partidos and other endpoints correctly use filters and that the aggregation logic is transparent and reusable. Regularly comparing your internal assessments of form with actual results and bookmaker lines allows you to calibrate the model and timely notice systematic errors in interpreting statistics.

// Пример безопасного запроса только официальных завершенных матчей сезона
const API_KEY = 'ВАШ_API_КЛЮЧ';
const SEASON_ID = 72514; // пример ID сезона
const url = 'https://api.api-sport.ru/v2/football/matches'
  + `?team_id=${TEAM_ID}`
  + `&season_id=${SEASON_ID}`
  + '&status=finished';
fetch(url, { headers: { Authorization: API_KEY } })
  .then(res => res.json())
  .then(data => {
    // Далее анализируем форму только по релевантным матчам
    console.log('Матчей в выборке:', data.totalMatches);
  });