- What statistical indicators to use to assess a player’s contribution to a match
- How to calculate a player’s efficiency index using advanced statistics
- How to obtain detailed player statistics for a match using the API
- Examples of metrics for evaluating the contributions of football and basketball players through the API
- How to automate the analysis of player contributions using a sports API
- What sports statistics APIs are available in Russia for assessing player performance
What statistical indicators to use to assess a player’s contribution to a match
Evaluating a player’s contribution to a match starts with selecting the right metrics. Basic indicators are familiar to everyone: goals, assists, shots on target, rebounds, interceptions, turnovers, fouls. However, for a balanced analysis, it is important to consider them in the context of the athlete’s role, the pace of the game, and the opponent. For example, a forward in football is logically assessed by shots, xG, touches in the penalty area, and involvement in goal-scoring moments, while a defensive midfielder is assessed by tackles, interceptions, duels, and progressive passes. In basketball, for a point guard, assists and turnovers are critical, while for a center, rebounds, blocks, and finishing efficiency from the paint are key.
The modern approach to analytics relies on advanced statistics, which allow separating the contribution of a specific athlete from the team result. These include percentages of won duels, accurate passes in the final third, shots from dangerous areas, the share of effective attacks involving the player, and on/off statistics (how the team’s efficiency changes when the player is on the court or on the bench). In the sports events API, this data is presented as structured fields: team match statistics (for example, in the object estadísticasDelPartido) and individual metrics in the lineup (array lineup.players with the object statistics for each athlete). Based on these numbers, it is easy to build your own evaluation models, not limited to simple goals and assists.
Using a sports API, such as the platform por el API de eventos deportivos api-sport.ru, you can obtain equally detailed statistics for different sports and tournaments. This allows for a universal approach: first, key metrics are selected for the position (offensive, defensive, gameplay), then they are normalized by minutes or possessions, after which they are combined into an integral index. Below is a simplified example of a request to the API that returns detailed match statistics, which are then used to select the necessary indicators:
fetch('https://api.api-sport.ru/v2/football/matches/14570728', {
headers: {
'Authorization': 'ВАШ_API_КЛЮЧ'
}
})
.then(r => r.json())
.then(data => {
const stats = data.matchStatistics; // командные метрики
const homeLineup = data.homeTeam.lineup.players;
const awayLineup = data.awayTeam.lineup.players;
console.log('Пример командных показателей:', stats[0].groups[0].statisticsItems);
console.log('Пример индивидуальной статистики игрока:', homeLineup[0].statistics);
});
How to calculate a player’s efficiency index using advanced statistics
The player efficiency index is an aggregated metric that transforms a set of disparate statistical indicators into a single number. Such an index is convenient for comparing athletes with each other, tracking progress, and building rankings. The logic is simple: groups of metrics are highlighted (scoring, creating chances, defensive work, discipline), weights are assigned for each depending on the position, after which the indicators are normalized (for example, «per 90 minutes» in football or «per 36 minutes» in basketball) and summed. It is important to consider negative actions: turnovers, fouls, missed possessions, penalty minutes — they reduce the final score and balance the player’s contribution.
In practice, the algorithm may look like this: you receive through the API the statistics object of a specific player in a match, from which you take key fields (goals, assists, shots on target, successful tackles, interceptions, turnovers, yellow and red cards). Then each value is multiplied by an importance coefficient, summed, and divided by the number of minutes played. If necessary, advanced metrics are added (for example, the share of won duels or participation in goal-scoring attacks), as well as adjustments for the strength of the opponent. Such an index is easy to adapt for any sports if comparable indicators are available in the statistics.
Below is an example of a simple function in Python that calculates a conditional efficiency index for a football player based on data obtained from the API. In a real project, you can expand the formula, add weight coefficients by positions, and use statistics from several matches or seasons at once:
def calc_player_index(stats: dict, minutes_played: int) -> float:
"""Пример упрощённого индекса эффективности футболиста."""
if minutes_played == 0:
return 0.0
score = 0
score += 5 * stats.get('goals', 0)
score += 3 * stats.get('assists', 0)
score += 1 * stats.get('shotsOnGoal', 0)
score += 0.5 * stats.get('keyPasses', 0)
score += 0.7 * stats.get('tacklesWon', 0)
score += 0.7 * stats.get('interceptions', 0)
# Штрафуем за потери и фолы
score -= 1.0 * stats.get('turnovers', 0)
score -= 0.5 * stats.get('fouls', 0)
score -= 3.0 * stats.get('yellowCards', 0)
score -= 7.0 * stats.get('redCards', 0)
# Нормируем на 90 минут игры
return round(score * 90 / minutes_played, 2)
How to obtain detailed player statistics for a match using the API
To build player contribution metrics, you first need to obtain their detailed statistics for a specific match. In the sports events API, this is done in two steps. First, you request match data by its identifier: the endpoint /v2/{sportSlug}/matches/{matchId} will return the team lineups (the object lineup) and key fields for each athlete, including position, number, «captain» flag, and the object statistics with individual indicators. Next, you find the desired player by his идентификатор within the array homeTeam.lineup.players or awayTeam.lineup.players and extract all related data.
The second step is to supplement the player’s profile with general information if necessary: country, dominant foot, market value, date of birth. This is done using the endpoint /v2/{sportSlug}/jugadores, which allows you to get a list of players by their identifiers or by team. By combining match data and profile data, you can, for example, compare the expected and actual contributions of expensive players, create scouting reports, or highlight promising athletes in youth leagues. Access to this data is provided via an API key, which can be obtained in the personal account of the service get the API key in the personal account.
Below is an example in JavaScript: by the ID of the football match, we get the entire event structure and find the statistics of a specific player. Similarly, you can work with basketball, hockey, esports, and other sports by simply changing sportSlug:
const SPORT = 'football';
const MATCH_ID = 14570728;
const PLAYER_ID = 123456; // ID интересующего игрока
fetch(`https://api.api-sport.ru/v2/${SPORT}/matches/${MATCH_ID}`, {
headers: {
'Authorization': 'ВАШ_API_КЛЮЧ'
}
})
.then(r => r.json())
.then(match => {
const home = match.homeTeam.lineup.players;
const away = match.awayTeam.lineup.players;
const allPlayers = home.concat(away);
const player = allPlayers.find(p => p.id === PLAYER_ID);
if (!player) {
console.log('Игрок не найден в заявке на матч');
return;
}
console.log('Имя:', player.name);
console.log('Позиция:', player.position);
console.log('Статистика за матч:', player.statistics);
});
Examples of metrics for evaluating the contributions of football and basketball players through the API
Football and basketball provide a rich set of statistics for assessing a player’s contribution, and the sports API allows for standardizing its retrieval. In football, in addition to goals and assists, analysts find shots on target, total shots, touches in the penalty area, accurate passes, passes into the final third, won duels, tackles, interceptions, and ball recoveries particularly useful. At the match level, this data is often aggregated in the structure estadísticasDelPartido (for example, totalDisparosALaPortería, accuratePasses, duelWonPercent, ballRecovery), and at the player level — in the object statistics in the team composition. For forwards, the balance of xG metrics, shots, and touches in the penalty area is important; for defenders — the percentage of duels won, clearances, and interceptions; for goalkeepers — saves and saved penalties.
In basketball, the basis for evaluating contributions is built on points, rebounds (offensive and defensive), assists, steals, blocks, turnovers, and fouls. Based on this data, derived metrics are calculated: shooting efficiency (eFG%), player efficiency rating (analogous to PER at the game level), usage rate (the share of possessions completed by the player), plus-minus. With the presence of a statistical structure in the API (points, rebounds, assists, etc.), you can easily compile your metrics for any position — from a sniper to a «big» center. It is important to normalize metrics per minute and consider the pace of the game, especially if you are comparing players from different leagues or playing styles.
Below is an example of Python code showing how to calculate a simple attacking metric and defensive metric for a player based on data from a single football match obtained from the API. Such functions can be run in batches across all matches of the tournament, forming comprehensive ratings that are then visualized in your application’s interface or on the analyst’s dashboard:
def attacking_score(s: dict) -> float:
return (
0.6 * s.get('goals', 0) +
0.4 * s.get('assists', 0) +
0.2 * s.get('shotsOnGoal', 0) +
0.1 * s.get('touchesInOppBox', 0)
)
def defensive_score(s: dict) -> float:
return (
0.4 * s.get('tacklesWon', 0) +
0.3 * s.get('interceptions', 0) +
0.2 * s.get('ballRecovery', 0) -
0.3 * s.get('fouls', 0)
)
# Пример использования: stats — объект statistics игрока из API
player_attack = attacking_score(stats)
player_defense = defensive_score(stats)
How to automate the analysis of player contributions using a sports API
Automating player contribution analysis allows for a shift from one-time reports to continuous monitoring of form and effectiveness of the squad. A typical pipeline looks like this: on a schedule (for example, every hour), your service retrieves a list of completed and current matches via the API using the endpoint /v2/{sportSlug}/partidos, filtering for the necessary tournaments and dates. Then, for each event, you request match details (/v2/{sportSlug}/matches/{matchId}), extract lineups and individual statistics, calculate efficiency indices, save results to the database, and display them in the admin panel, reports for coaches, or in the user interface. For betting, you can additionally use a block oddsBase with bookmaker odds to link player contributions with line movements.
Service api-sport.ru allows building such pipelines not only for football and basketball but also for tennis, hockey, table tennis, esports, and other sports. Upcoming updates will include support for WebSocket, which will enable receiving events and statistics updates in real-time without unnecessary requests, as well as AI tools for automatic player scoring and predicting their impact on the outcome. This is especially valuable for live analytics and dynamic changes in betting strategies. For script authorization, you use a single API key that can be generated and managed in the personal account la cuenta personal del desarrollador..
Below is a simple example in Python that demonstrates the idea of a background task: we retrieve all today’s football matches, then for each match, we calculate a conditional efficiency index for all players. In a real project, the code is supplemented with saving to the database, task queues, and visualizing results:
import requests
from datetime import date
API_KEY = 'ВАШ_API_КЛЮЧ'
BASE_URL = 'https://api.api-sport.ru/v2'
def get_matches():
resp = requests.get(
f"{BASE_URL}/football/matches",
params={'date': date.today().isoformat()},
headers={'Authorization': API_KEY},
timeout=10,
)
resp.raise_for_status()
return resp.json()['matches']
def process_match(match_id: int):
resp = requests.get(
f"{BASE_URL}/football/matches/{match_id}",
headers={'Authorization': API_KEY},
timeout=10,
)
resp.raise_for_status()
match = resp.json()
players = match['homeTeam']['lineup']['players'] + match['awayTeam']['lineup']['players']
for p in players:
idx = calc_player_index(p.get('statistics', {}), p.get('statistics', {}).get('minutes', 90))
print(p['name'], idx)
for m in get_matches():
process_match(m['id'])
What sports statistics APIs are available in Russia for assessing player performance
The Russian sports analytics market is actively developing, and developers, media, and betting companies have more and more options for obtaining data. Several types of solutions can be highlighted: closed feeds from leagues and federations that are available only to partners; global statistics providers with English-language interfaces and servers abroad; as well as specialized API services adapted for the Russian audience. For everyday development and building analytical products, the third option is the most convenient: it combines ready-made REST endpoints, Russian localization, support for popular sports, and documentation aimed at developers.
La plataforma api-sport.ru — API for sports statistics in Russia belongs to exactly such a category of services. It provides a unified interface for football, hockey, basketball, tennis, table tennis, esports, and other disciplines, combining data on matches, lineups, players, tournaments, and betting odds. Through a single API, you can receive live events, extended match statistics (object estadísticasDelPartido), individual player metrics, as well as a block oddsBase with lines and odds dynamics. This makes the service a convenient foundation for both sports media and applications with player rankings, as well as for analysts building betting models and systems for evaluating athletes’ contributions.
A separate advantage of such an API is the constant development of functionality. In api-sport.ru new sports, bookmaker markets, and types of statistics are regularly added, and in upcoming releases, WebSocket connections for data streaming and AI modules for intelligent analysis will appear. Thanks to this, you can plan long-term projects without fearing that the infrastructure will become outdated. It is enough to obtain an API key in your personal account, connect it to your backend or frontend, and build your own system for evaluating player contributions based on a reliable and scalable source of sports information.




