Command Palette

Search for a command to run...

Documentation
Sports

Sports

Using the API to get the sports available to watch

/api/v1/sports
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

/api/v1/sports
[
  {
    "name": "football",
    "displayName": "Football"
  }
  {
    "name": "hockey",
    "displayName": "Hockey"
  }
  {
    "name": "baseball",
    "displayName": "Baseball"
  }
]