Could it be possible that the docs are inaccurate, as uniswap-v2 is now deprecated and the email I received today stated that you could access “all” decentralized exchanges and the claim that if the data is on chain they can access it.
Introducing the Moralis Price API 🥳
The Moralis Price API lets you get the price of any asset, on any chain, on any decentralized exchange.
You just input what token, what network and what exchange - and you'll get both the USD price and native price of that token. Instantly, and with only a single line of code.
The endpoint can be found in the Deep Index API.
/ERC20/{address}/price
It supports all tokens on Ethereum, BSC and Polygon.
You can also see this API in action in one of our YouTube videos: Get The Price of Any Asset 📺
Give it a try on your project today!
If you have any questions or need help, just reply back and we'll be here for you :)
The Moralis Team