Hi i've met a problem with getting data from pancakeswap. Are there any endpoinds or subgraph apis or smthing else to get price data from PancakeSwap
I've tried to find endpoints or using weird subgraps but nothing works
I'd like to get price data of every token in pancake
You can use Moralis API to do that, they offer
getTokenPriceAPI that indexes multiple DEXs on multiple chain, one of it is of course Pancakeswap.You can try it out right here as long as you have the address of the token https://docs.moralis.io/web3-data-api/evm/reference/get-token-price?address=0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56&chain=bsc&include=percent_change&exchange=pancakeswapv2.
Hope this helps!
Cheers~
You can follow this tutorial to implement the API to get token price either in Python or JS/TS https://docs.moralis.io/web3-data-api/evm/how-to-get-the-price-of-an-erc20-token
P.S. I work at Moralis