Loading...

Distance

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

Request

GET https://api.getAddress.io/distance/{postcode_from}/{postcode_to}?api-key={api-key}  
GET https://api.getAddress.io/distance/{latitude}/{longitude}/to/{latitude}/{longitude}?api-key={api-key}  
Examples

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
}

The distance between geographical points.

Request

GET https://api.getAddress.io/distance/50.065551/-5.714262/to/58.63568878173828/-3.061519145965576?api-key={api-key}  

Response

{
    "metres": 968978.0931119365
}
Top