The blockchain itself doesn't have that information, so you would need something like an Oracle. A chainlink smart contract is in the works, so we should have something like that in the near future. Still, keep in mind you have to trust a third party, so the results might either be approximate or wrong altogether.