Sanity Docs
Search
K
Comment on page

How To Use

The Utilis API is a very simple thing to use. Let us show you how to use it
get
https
://dashboard.utilis.tk/api/randomnumber
This is the url you will use to get the API and the data behind it. This specific API generates a random number.

Code

Random Color
This will return a hex code.
let res = await axios.get("https://sanitybot.xyz/api/randomcolor");
let data = res.data.color;
console.log(data);
}
//Or using a function
async function makeGetRequest() {
let res = await axios.get("https://sanitybot.xyz/api/randomcolor");
let data = res.data.color;
console.log(data);
}
makeGetRequest();