Before a ball is even kicked, there's a lot of data that shapes how a match might unfold — who's starting, who's missing through injury or suspension, and how the two teams have historically matched up. This guide shows you how to fetch all of this pre-match context using Live Football API.
Why Pre-Match Data Matters
Pre-match data is especially valuable for:
- Fantasy football apps — confirming starting lineups before locking in a fantasy team
- Betting and prediction platforms — factoring in missing key players and historical trends
- News and content sites — auto-generating match preview articles
- Fan apps — showing supporters exactly who's playing before kickoff
Getting a Match ID
As with other match-specific endpoints, you first need a match ID from /matches:
import requests
response = requests.get(
'https://live-football-api.com/api/v1/matches',
params={'api_key': 'YOUR_KEY', 'date': '2026-08-23', 'lang': 'en'}
).json()
match_id = response['data']['matches'][0]['id']
Fetching Starting Lineups
The /lineups endpoint returns the starting XI, substitutes, formation, and coach for both teams. It's typically available starting around one hour before kickoff.
import requests
response = requests.get(
'https://live-football-api.com/api/v1/lineups',
params={'api_key': 'YOUR_KEY', 'match_id': match_id, 'lang': 'en'}
).json()
data = response['data']
print(f"Home formation: {data['home']['formation']} (Coach: {data['home']['coach']})")
for player in data['home']['starting_xi']:
print(f"#{player['number']} {player['name']} ({player['position']})")
The same call in JavaScript:
const res = await fetch(
'https://live-football-api.com/api/v1/lineups' +
`?api_key=YOUR_KEY&match_id=${match_id}&lang=en`
);
const result = await res.json();
const data = result.data;
console.log(`Home formation: ${data.home.formation} (Coach: ${data.home.coach})`);
data.home.starting_xi.forEach(player => {
console.log(`#${player.number} ${player.name} (${player.position})`);
});
Fetching Injuries and Suspensions
The /injuries endpoint returns confirmed injuries and suspensions for both squads ahead of a match, including the player's status (e.g. "Doubtful" or "Out").
import requests
response = requests.get(
'https://live-football-api.com/api/v1/injuries',
params={'api_key': 'YOUR_KEY', 'match_id': match_id, 'lang': 'en'}
).json()
data = response['data']
for player in data['home']:
print(f"{player['player']} — {player['reason']} ({player['status']})")
Fetching Head-to-Head History
The /h2h endpoint returns a summary of past results between the two teams, plus a list of individual historical matches.
import requests
response = requests.get(
'https://live-football-api.com/api/v1/h2h',
params={'api_key': 'YOUR_KEY', 'match_id': match_id, 'lang': 'en'}
).json()
data = response['data']
summary = data['summary']
print(f"{data['home_team']} wins: {summary['home_wins']}, "
f"Draws: {summary['draws']}, {data['away_team']} wins: {summary['away_wins']}")
Fetching Match Officials
The /officials endpoint returns the referee, assistant referees, and VAR official assigned to a match — useful context for betting and analysis platforms that track officiating patterns.
import requests
response = requests.get(
'https://live-football-api.com/api/v1/officials',
params={'api_key': 'YOUR_KEY', 'match_id': match_id}
).json()
for official in response['data']['officials']:
print(f"{official['role']}: {official['name']}")
Putting It Together: A Match Preview Card
Combining lineups, injuries, h2h, and officials into a single call sequence lets you build a complete pre-match preview card — formation, key absences, historical form, and officiating — all from four lightweight API calls, each costing just 1 credit.
Frequently Asked Questions
How early before kickoff are lineups available?
Lineups are typically available starting around one hour before kickoff, once teams have officially confirmed their starting XI.
Does the injuries endpoint update in real time?
It reflects the latest confirmed status ahead of the match, covering both long-term injuries and last-minute fitness doubts as they're confirmed.
How many historical matches does the h2h endpoint return?
The endpoint returns a summary (wins/draws/losses) along with a list of individual past meetings between the two teams.
Do these endpoints cost more credits than live match data?
No, lineups, injuries, h2h, and officials all cost the same 1 credit per call as other standard endpoints.