this function returns API response, I would like to get a specific field value, let's say "price" from this response, how do I do that?
export const getprice = async () => {
return await axios.get(
"https://api.pancakeswap.info/api/v2/tokens/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"
);
};
function returns this:
{"updated_at":1620658369033,"data":{"name":"PancakeSwap Token","symbol":"Cake","price":"40.19439880437819571616287343907344","price_BNB":"0.05840738921546340105964944169352627"}
By the way, the API token is public.