How to get team season statistics
O endpoint /teams/statistics retorna um resumo completo da temporada de um time: resultados, gols, formacao, sequencias e mais.
The /teams/statistics endpoint returns a complete season summary for a team: results, goals, formation, streaks and more.
Sao necessarios tres parametros: team (ID do time), league (ID da liga) e season (ano).
const API_KEY = 'YOUR_API_KEY';
const BASE = 'https://football.api.insyde.one';
async function getTeamStats(team, league, season) {
const url = `${BASE}/teams/statistics?team=${team}&league=${league}&season=${season}&key=${API_KEY}`;
const res = await fetch(url);
const data = await res.json();
return data.response;
}
const stats = await getTeamStats(127, 71, 2025);
Resposta da API (resumida) / API response (summarized):
{
"team": { "id": 127, "name": "Flamengo" },
"league": { "id": 71, "name": "Serie A" },
"form": "WWDWW",
"fixtures": {
"played": { "home": 19, "away": 19, "total": 38 },
"wins": { "home": 14, "away": 8, "total": 22 },
"draws": { "home": 3, "away": 5, "total": 8 },
"loses": { "home": 2, "away": 6, "total": 8 }
},
"goals": {
"for": { "total": { "home": 38, "away": 27, "total": 65 }, "average": { "total": "1.71" } },
"against": { "total": { "home": 15, "away": 25, "total": 40 }, "average": { "total": "1.05" } }
},
"clean_sheet": { "home": 10, "away": 4, "total": 14 },
"penalty": { "scored": { "total": 8 }, "missed": { "total": 2 } },
"lineups": [ { "formation": "4-3-3", "played": 30 }, { "formation": "4-4-2", "played": 8 } ],
"biggest": { "wins": { "home": "5-0", "away": "0-3" } }
}
form — Ultimos 5 resultados (W/D/L) / Last 5 resultsfixtures — Jogos, vitorias, empates, derrotas (casa/fora/total) / Matches, wins, draws, lossesgoals.for/against — Gols marcados e sofridos com medias / Goals for/against with averagesclean_sheet — Jogos sem sofrer gol / Matches without concedingpenalty — Penaltis convertidos e perdidos / Penalties scored and missedlineups — Formacoes usadas e quantas vezes / Formations used and frequencybiggest — Maior vitoria e derrota / Biggest win and lossconst s = stats;
console.log(`${s.team.name} — ${s.league.name}`);
console.log(`Form: ${s.form}`);
console.log(`W${s.fixtures.wins.total} D${s.fixtures.draws.total} L${s.fixtures.loses.total}`);
console.log(`Goals: ${s.goals.for.total.total} scored, ${s.goals.against.total.total} conceded`);
console.log(`Clean sheets: ${s.clean_sheet.total}`);
console.log(`Main formation: ${s.lineups[0].formation}`);
goals.for.minute), util para analises avancadas.
goals.for.minute), useful for advanced analysis.