v1 (deprecated)

Learn more about the request parameter

Get distance

GET https://distanceto.p.mashape.com/get

Get distance, duration and travel information about the route along the requested waypoints

Query Parameters

Name
Type
Description

route

string

Stringified array of waypoints

car

boolean

car route distance and duration

foot

boolean

foot route distance and duration

Headers

Name
Type
Description

X-RapidAPI-Key

string

Your RapidAPI apiKey

{
  "points": [
    {
      "type": "Feature",
      "properties": {
        "type": "name",
        "geocode": {
          "id": 7,
          "typ": "",
          "name": "Berlin",
          "lat": 52.523403,
          "lng": 13.4114,
          "visit": 10958617,
          "lang": "de",
          "formatted_address": "Berlin, Deutschland",
          "country": "DE",
          "moved": 1,
          "checked": "de ",
          "clean": 1,
          "tz": "Europe/Berlin",
          "regions": [
            {
              "id": 51477,
              "name": "Deutschland",
              "int": "Germany",
              "name_en": "Germany",
              "level": 2
            },
            {
              "id": 62422,
              "name": "Berlin",
              "int": "Berlin",
              "name_en": "Berlin",
              "level": 4
            },
            {
              "id": 16347,
              "name": "Mitte",
              "int": "Mitte",
              "name_en": null,
              "level": 9
            },
            {
              "id": 16566,
              "name": "Mitte",
              "int": "Mitte",
              "name_en": null,
              "level": 10
            }
          ]
        },
        "airports": [
          {
            "name": "Berlin-Tegel International Airport",
            "icao": "EDDT",
            "iata": "TXL",
            "lat": 52.5597,
            "lng": 13.2877,
            "city": "Berlin",
            "country": "Germany",
            "distance": 9.291129591215062
          },
          {
            "name": "Berlin-Tegel International Airport",
            "icao": "EDDT",
            "iata": "TXL",
            "lat": 52.5597,
            "lng": 13.2877,
            "city": "Berlin",
            "country": "Germany",
            "distance": 9.291129591215062
          },
          {
            "name": "Berlin-Schönefeld International Airport",
            "icao": "EDDB",
            "iata": "SXF",
            "lat": 52.38,
            "lng": 13.5225,
            "city": "Berlin",
            "country": "Germany",
            "distance": 17.63921879423453
          }
        ],
        "stats": {
          "antipodia": [
            -166.58859999999999,
            -52.523403
          ],
          "equator": {
            "distance": 5842.169356341,
            "bearing": "S"
          },
          "northpole": 4168.515634322877,
          "southpole": 15853.93626081537
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          13.4114,
          52.523403
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "type": "name",
        "geocode": {
          "id": 6,
          "typ": "",
          "name": "Hamburg",
          "lat": 53.553406,
          "lng": 9.992196,
          "visit": 8759091,
          "lang": "de",
          "formatted_address": "Hamburg, Hamburg, Deutschland",
          "country": "DE",
          "moved": 1,
          "checked": "de ",
          "clean": 1,
          "tz": "Europe/Berlin",
          "regions": [
            {
              "id": 51477,
              "name": "Deutschland",
              "int": "Germany",
              "name_en": "Germany",
              "level": 2
            },
            {
              "id": 62782,
              "name": "Hamburg",
              "int": "Hamburg",
              "name_en": "Hamburg",
              "level": 4
            },
            {
              "id": 28971,
              "name": "Hamburg-Mitte",
              "int": "Hamburg-Mitte",
              "name_en": null,
              "level": 9
            },
            {
              "id": 296011,
              "name": "Neustadt",
              "int": "Neustadt",
              "name_en": null,
              "level": 10
            }
          ]
        },
        "airports": [
          {
            "name": "Hamburg Airport",
            "icao": "EDDH",
            "iata": "HAM",
            "lat": 53.6304,
            "lng": 9.98823,
            "city": "Hamburg",
            "country": "Germany",
            "distance": 8.56803131953995
          },
          {
            "name": "Hamburg Airport",
            "icao": "EDDH",
            "iata": "HAM",
            "lat": 53.6304,
            "lng": 9.98823,
            "city": "Hamburg",
            "country": "Germany",
            "distance": 8.56803131953995
          },
          {
            "name": "Hamburg-Finkenwerder Airport",
            "icao": "EDHI",
            "iata": "XFW",
            "lat": 53.5353,
            "lng": 9.83556,
            "city": "Hamburg",
            "country": "Germany",
            "distance": 10.546580968714048
          }
        ],
        "stats": {
          "antipodia": [
            -170.007804,
            -53.553406
          ],
          "equator": {
            "distance": 5956.736418256986,
            "bearing": "S"
          },
          "northpole": 4053.948572406891,
          "southpole": 15968.516797572453
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          9.992196,
          53.553406
        ]
      }
    }
  ],
  "steps": [
    {
      "start": [
        13.4114,
        52.523403
      ],
      "end": [
        9.992196,
        53.553406
      ],
      "distance": {
        "haversine": 255.73436986056421,
        "greatCircle": 255.65447544186136,
        "vincenty": 256.364192,
        "radians": 0.0401277843810708,
        "dagrees": 2.2991526862463414,
        "flight": [
          {
            "start": "TXL",
            "dest": "HAM",
            "distance": 250.4652476791421,
            "time": "0h 47min"
          },
          {
            "start": "TXL",
            "dest": "HAM",
            "distance": 250.4652476791421,
            "time": "0h 47min"
          },
          {
            "start": "TXL",
            "dest": "XFW",
            "distance": 255.0300373121645,
            "time": "0h 48min"
          },
          {
            "start": "TXL",
            "dest": "HAM",
            "distance": 250.4652476791421,
            "time": "0h 47min"
          },
          {
            "start": "TXL",
            "dest": "HAM",
            "distance": 250.4652476791421,
            "time": "0h 47min"
          },
          {
            "start": "TXL",
            "dest": "XFW",
            "distance": 255.0300373121645,
            "time": "0h 48min"
          },
          {
            "start": "SXF",
            "dest": "HAM",
            "distance": 274.365865778507,
            "time": "0h 49min"
          },
          {
            "start": "SXF",
            "dest": "HAM",
            "distance": 274.365865778507,
            "time": "0h 49min"
          },
          {
            "start": "SXF",
            "dest": "XFW",
            "distance": 278.42069351973436,
            "time": "0h 49min"
          }
        ],
        "foot": {
          "distance": 285000,
          "duration": 205770.2
        },
        "car": {
          "distance": 288048,
          "duration": 10873
        }
      },
      "midpoint": {
        "type": "Feature",
        "properties": {
          "type": "latlng",
          "geocode": {},
          "tz": "Europe/Berlin",
          "regions": [
            {
              "id": 51477,
              "name": "Deutschland",
              "int": "Germany",
              "name_en": "Germany",
              "level": 2
            },
            {
              "id": 62504,
              "name": "Brandenburg",
              "int": "Brandenburg",
              "name_en": null,
              "level": 4
            },
            {
              "id": 62738,
              "name": "Landkreis Prignitz",
              "int": "Landkreis Prignitz",
              "name_en": null,
              "level": 6
            },
            {
              "id": 1289786,
              "name": "Wittenberge",
              "int": "Wittenberge",
              "name_en": null,
              "level": 8
            },
            {
              "id": 6910223,
              "name": "Bentwisch",
              "int": "Bentwisch",
              "name_en": null,
              "level": 9
            }
          ],
          "airports": [
            {
              "name": "Schwerin Parchim Airport",
              "icao": "EDOP",
              "iata": "SZW",
              "lat": 53.427,
              "lng": 11.7834,
              "city": "Parchim",
              "country": "Germany",
              "distance": 42.05808061000665
            },
            {
              "name": "Schwerin Parchim Airport",
              "icao": "EDOP",
              "iata": "SZW",
              "lat": 53.427,
              "lng": 11.7834,
              "city": "Parchim",
              "country": "Germany",
              "distance": 42.05808061000665
            },
            {
              "name": "Stendal-Borstel Airport",
              "icao": "EDOV",
              "iata": "ZSN",
              "lat": 52.6289,
              "lng": 11.8186,
              "city": "Stendal",
              "country": "Germany",
              "distance": 47.356824697446264
            }
          ],
          "stats": {
            "antipodia": [
              -168.27777461177786,
              -53.05065792096614
            ],
            "equator": {
              "distance": 5900.8158332695475,
              "bearing": "S"
            },
            "northpole": 4109.869157394328,
            "southpole": 15912.589879459474
          }
        },
        "geometry": {
          "type": "Point",
          "coordinates": [
            11.722225388222146,
            53.05065792096614
          ]
        }
      },
      "bearing": {
        "exact": "WNW",
        "rough": "W",
        "bearing": 297.9699530000709
      },
      "time": 0
    }
  ]
}

Headers

X-RapidAPI-Key

Authentication is made via the X-RapidAPI-Key. You can find more information about api keys and authentication in the RapidAPI docs.

Query parameter

route

The route array contains multiple objects of waypoints

[    
  {
    "t": "Berlin"
  },
  {
    "t": "Hamburg"
  }
];

You should JSON.stringify the waypoints array before adding as query params.

Waypoint

{
  "t": "Berlin",     // required
  "c": "DEU"         // optional
}

t: Input data

The waypoints consists of a required "t" property which can include the following information to describe a waypoint:

  • Country, city or region

  • Postal address

  • Postal code (don't forget to set the correct country)

  • Airport code (iata)

  • Coordinate (latitude,longitude)

c: country

You can specify the country with the optional "c" property. Countries are defined with its ISO 3166-1 alpha-2 or alpha-3 codes (DE or DEU for germany).

If "c" is not set the first found result will be used. To use postal codes it is highly recommended to use "c".

car

If you need distances and durations of car routes between the waypoints

If you need distances and durations of foot route between the waypoints

Last updated