Loading...

Distance

The Haversine formula is used to calculate the distance, in metres, between two postcodes.

GET https://api.getAddress.io/distance/{postcode_from}/{postcode_to}?api-key={api-key}  
Example

The distance between Lands End and John O' Groats'.

Request

GET https://api.getAddress.io/distance/TR19 7AA/KW1 4YT?api-key={api-key}  

Response

{
    "from": {
         "latitude": 50.065551,
         "longitude": -5.714262,
         "postcode": "TR19 7AA"
    },
    "to": {
         "latitude": 58.63568878173828,
         "longitude": -3.061519145965576,
         "postcode": "KW1 4YT"
    },
    "metres": 968978.0931119365
}
Top