Distance approximation between two pincodes

I am developing a React application which is essentially a Truck Rental system. I have a set of pair of two pincodes with me: one is the source and other of destination. I want to calculate the distance between these two pincodes (approximate) and compare them with all possible combinations. How do I calculate this approximate distance between two pincodes in a React application?

I could not find any free API supporting the same requirement. I looked at a couple of API’s like Google Maps API( Distance Matrix one is paid), OpenStreetMap, etc.
Any help would be greatly appreciated.