How can I input a number API as a string OR Where am I going to place toString()

Tags: , , ,

So the code im trying to send is ( “buyPrice”:11.0 ). in the site ( as you can see the value inside buyPrice is not a string but a number. and now when I send the command into discord it says “undefined”. but when I saw a code bellow that is value is a string of the same website (“warning”:”This endpoint is deprecated and will soon be disabled.”). it worked flawlessly so im thinking .


but i dont know where i am going put the code in

my code is:

} else if (command === "bazaar") {
    let getBazaar = async () => {
        let response = await axios.get(
        let bazaar =;
        return bazaar;
    let bazaarValue = await getBazaar();
    console.log(bazaarValue)`Buy Price: ${bazaarValue.buyPrice}`)


This doesn’t seem to be an error in your code. Just a legitimate warning from the API host stating that the url you are using ( will be disabled.

As you mentioned where you are trying to send (“buyPrice”: 11.0), do read the comment by ippi, you need to see the json that the API is returning and find the value properly.

As for the message send command, (`Buy Price: ${bazaarValue.buyPrice}`) will always be a string, no matter what type bazaarValue.buyPrice is.

Source: stackoverflow