Random Number API

How to use the random number api

let res = await axios.get("https://sanitybot.xyz/api/randomnumber");

  let data = res.data.number;
 console.log(data);
}

//Or using a function

async function makeGetRequest() {

  let res = await axios.get("https://sanitybot.xyz/api/randomnumber");

  let data = res.data.number;
 console.log(data);
}

makeGetRequest();

Last updated