If you work with IB API, you receive that information in the tickOptionComputation event (https://www.interactivebrokers.com/en/software/api/apiguide/java/tickoptioncomputation.htm), along many other useful things (eg.: undPrice, delta, vega, theta, gamma, impliedVol, etc.).
So if you are...