Skip to content

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

So the code I’m trying to send is ( “buyPrice”:11.0 ). on the site ( As you can see, the value inside the 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 valued is a string of the same website (“warning”: “This endpoint is deprecated and will soon be disabled.”). It worked flawlessly, so I’m thinking.


but I don’t know where I am going to 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.