How can I calculate the value of the greeks in real time using the option price?

I want to create an algo that gives me the value of greeks in real time. How can that be achieved?

Fetch option price using API and then compute using the below formulas