Documentation
Examples
Examples
Examples of some integrations with the WatchFooty API
Sports
This is useful for listing the sports available to watch.
interface Sport {
name: string;
displayName: string;
}
const Sports = await fetch("https://watchfooty.live/api/v1/sports");
const SportsData = await Sports.json() as Sport[];
if (SportsData.length > 0) {
for (const Sport of SportsData) {
console.log(Sport.name); // american-football
console.log(Sport.displayName); // American Football
}
}
Matches
This is useful for listing the matches available to watch.
interface Match {
matchId: string;
title: string;
poster: string;
teams: {
home: {
name: string;
logoUrl: string;
logoId: string;
};
away: {
name: string;
logoUrl: string;
logoId: string;
};
};
isEvent: boolean;
date: string;
timestamp: number;
league: string;
leagueLogo: string;
leagueLogoId: string;
sport: string;
streams: {
id: string;
url: string;
quality: string;
language: string;
isRedirect: boolean;
nsfw: boolean;
ads: boolean;
}[];
}
const Matches = await fetch("https://watchfooty.live/api/v1/matches/football");
const MatchesData = await Matches.json() as Match[];
if (MatchesData.length > 0) {
const Match = MatchesData[0];
const Streams = Match.streams;
if (Streams.length > 0) {
const Stream = Streams[0];
console.log(Stream);
}
console.log(Match);
}
Match Details
You can use this to get the details for a match.
const MatchDetailsResponse = await fetch("https://watchfooty.live/api/v1/match/123");
const MatchDetailsData = await MatchDetailsResponse.json();
if (MatchDetailsData) {
console.log(MatchDetailsData);
}
Posters
You can use this to get the poster for a match. It includes the images for the home and away teams or the event logo if the match is an event.
const PosterResponse = await fetch("https://watchfooty.live/api/v1/poster/123");
const PosterData = await PosterResponse.arrayBuffer(); // Uint8Array
Team Logos
You can use this to get the logo for a team.
const TeamLogoResponse = await fetch("https://watchfooty.live/api/v1/team-logo/123");
const TeamLogoData = await TeamLogoResponse.arrayBuffer(); // Uint8Array
League Logos
You can use this to get the logo for a league.
const LeagueLogoResponse = await fetch("https://watchfooty.live/api/v1/league-logo/123");
const LeagueLogoData = await LeagueLogoResponse.arrayBuffer(); // Uint8Array