Documentation
Sports
Sports
Using the API to get 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) {
const Sport = SportsData[0];
console.log(Sport); // { name: "football", displayName: "Football" }
}
Response Format
[
{
"name": "football",
"displayName": "Football"
}
{
"name": "hockey",
"displayName": "Hockey"
}
{
"name": "baseball",
"displayName": "Baseball"
}
]