Parchment Docs

Trip Planning

Directions and trip planning

Plan a multimodal trip

Generate multiple trip options using different transportation modes and combinations

POST
/directions

Request Body

application/jsonRequired
waypointsRequiredarray<object>
selectedModestring
routingPreferencesobject
availableVehiclesarray<object>
knownAccessPointsarray<object>
preferredDepartureTimestring
preferredArrivalTimestring
requestIdstring
timestampstring

Response Body

curl -X POST "https://example.com/directions/" \
  -H "Content-Type: application/json" \
  -d '{
    "waypoints": [
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      },
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      }
    ],
    "selectedMode": "multi",
    "routingPreferences": {
      "avoidHighways": true,
      "avoidTolls": true,
      "preferHOV": true,
      "avoidFerries": true,
      "preferLitPaths": true,
      "preferPavedPaths": true,
      "avoidHills": true,
      "safetyVsEfficiency": 1,
      "maxWalkingDistance": 0,
      "maxTransfers": 0,
      "wheelchairAccessible": true,
      "useKnownVehicleLocations": true,
      "useKnownParkingLocations": true,
      "routingEngine": "string"
    },
    "availableVehicles": [
      {
        "id": "string",
        "type": "car",
        "energyType": "electric",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "knownAccessPoints": [
      {
        "osmId": "string",
        "code": "string",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "preferredDepartureTime": "string",
    "preferredArrivalTime": "string",
    "requestId": "string",
    "timestamp": "string"
  }'
const body = JSON.stringify({
  "waypoints": [
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    },
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    }
  ],
  "selectedMode": "multi",
  "routingPreferences": {
    "avoidHighways": true,
    "avoidTolls": true,
    "preferHOV": true,
    "avoidFerries": true,
    "preferLitPaths": true,
    "preferPavedPaths": true,
    "avoidHills": true,
    "safetyVsEfficiency": 1,
    "maxWalkingDistance": 0,
    "maxTransfers": 0,
    "wheelchairAccessible": true,
    "useKnownVehicleLocations": true,
    "useKnownParkingLocations": true,
    "routingEngine": "string"
  },
  "availableVehicles": [
    {
      "id": "string",
      "type": "car",
      "energyType": "electric",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "knownAccessPoints": [
    {
      "osmId": "string",
      "code": "string",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "preferredDepartureTime": "string",
  "preferredArrivalTime": "string",
  "requestId": "string",
  "timestamp": "string"
})

fetch("https://example.com/directions/", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/directions/"
  body := strings.NewReader(`{
    "waypoints": [
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      },
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      }
    ],
    "selectedMode": "multi",
    "routingPreferences": {
      "avoidHighways": true,
      "avoidTolls": true,
      "preferHOV": true,
      "avoidFerries": true,
      "preferLitPaths": true,
      "preferPavedPaths": true,
      "avoidHills": true,
      "safetyVsEfficiency": 1,
      "maxWalkingDistance": 0,
      "maxTransfers": 0,
      "wheelchairAccessible": true,
      "useKnownVehicleLocations": true,
      "useKnownParkingLocations": true,
      "routingEngine": "string"
    },
    "availableVehicles": [
      {
        "id": "string",
        "type": "car",
        "energyType": "electric",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "knownAccessPoints": [
      {
        "osmId": "string",
        "code": "string",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "preferredDepartureTime": "string",
    "preferredArrivalTime": "string",
    "requestId": "string",
    "timestamp": "string"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/directions/"
body = {
  "waypoints": [
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    },
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    }
  ],
  "selectedMode": "multi",
  "routingPreferences": {
    "avoidHighways": true,
    "avoidTolls": true,
    "preferHOV": true,
    "avoidFerries": true,
    "preferLitPaths": true,
    "preferPavedPaths": true,
    "avoidHills": true,
    "safetyVsEfficiency": 1,
    "maxWalkingDistance": 0,
    "maxTransfers": 0,
    "wheelchairAccessible": true,
    "useKnownVehicleLocations": true,
    "useKnownParkingLocations": true,
    "routingEngine": "string"
  },
  "availableVehicles": [
    {
      "id": "string",
      "type": "car",
      "energyType": "electric",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "knownAccessPoints": [
    {
      "osmId": "string",
      "code": "string",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "preferredDepartureTime": "string",
  "preferredArrivalTime": "string",
  "requestId": "string",
  "timestamp": "string"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Get available vehicle types

List all supported vehicle types and their characteristics

GET
/directions/vehicle-types

Response Body

curl -X GET "https://example.com/directions/vehicle-types"
fetch("https://example.com/directions/vehicle-types")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/directions/vehicle-types"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/directions/vehicle-types"

response = requests.request("GET", url)

print(response.text)
Empty

Validate trip request

Validate a trip request without actually planning the trip

POST
/directions/validate

Request Body

application/jsonRequired
waypointsRequiredarray<object>
selectedModestring
routingPreferencesobject
availableVehiclesarray<object>
knownAccessPointsarray<object>
preferredDepartureTimestring
preferredArrivalTimestring
requestIdstring
timestampstring

Response Body

curl -X POST "https://example.com/directions/validate" \
  -H "Content-Type: application/json" \
  -d '{
    "waypoints": [
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      },
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      }
    ],
    "selectedMode": "multi",
    "routingPreferences": {
      "avoidHighways": true,
      "avoidTolls": true,
      "preferHOV": true,
      "avoidFerries": true,
      "preferLitPaths": true,
      "preferPavedPaths": true,
      "avoidHills": true,
      "safetyVsEfficiency": 1,
      "maxWalkingDistance": 0,
      "maxTransfers": 0,
      "wheelchairAccessible": true,
      "useKnownVehicleLocations": true,
      "useKnownParkingLocations": true,
      "routingEngine": "string"
    },
    "availableVehicles": [
      {
        "id": "string",
        "type": "car",
        "energyType": "electric",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "knownAccessPoints": [
      {
        "osmId": "string",
        "code": "string",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "preferredDepartureTime": "string",
    "preferredArrivalTime": "string",
    "requestId": "string",
    "timestamp": "string"
  }'
const body = JSON.stringify({
  "waypoints": [
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    },
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    }
  ],
  "selectedMode": "multi",
  "routingPreferences": {
    "avoidHighways": true,
    "avoidTolls": true,
    "preferHOV": true,
    "avoidFerries": true,
    "preferLitPaths": true,
    "preferPavedPaths": true,
    "avoidHills": true,
    "safetyVsEfficiency": 1,
    "maxWalkingDistance": 0,
    "maxTransfers": 0,
    "wheelchairAccessible": true,
    "useKnownVehicleLocations": true,
    "useKnownParkingLocations": true,
    "routingEngine": "string"
  },
  "availableVehicles": [
    {
      "id": "string",
      "type": "car",
      "energyType": "electric",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "knownAccessPoints": [
    {
      "osmId": "string",
      "code": "string",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "preferredDepartureTime": "string",
  "preferredArrivalTime": "string",
  "requestId": "string",
  "timestamp": "string"
})

fetch("https://example.com/directions/validate", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/directions/validate"
  body := strings.NewReader(`{
    "waypoints": [
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      },
      {
        "location": {
          "lat": 0,
          "lng": 0
        },
        "address": "string",
        "label": "string",
        "type": "origin"
      }
    ],
    "selectedMode": "multi",
    "routingPreferences": {
      "avoidHighways": true,
      "avoidTolls": true,
      "preferHOV": true,
      "avoidFerries": true,
      "preferLitPaths": true,
      "preferPavedPaths": true,
      "avoidHills": true,
      "safetyVsEfficiency": 1,
      "maxWalkingDistance": 0,
      "maxTransfers": 0,
      "wheelchairAccessible": true,
      "useKnownVehicleLocations": true,
      "useKnownParkingLocations": true,
      "routingEngine": "string"
    },
    "availableVehicles": [
      {
        "id": "string",
        "type": "car",
        "energyType": "electric",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "knownAccessPoints": [
      {
        "osmId": "string",
        "code": "string",
        "name": "string",
        "location": {
          "lat": 0,
          "lng": 0
        }
      }
    ],
    "preferredDepartureTime": "string",
    "preferredArrivalTime": "string",
    "requestId": "string",
    "timestamp": "string"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/directions/validate"
body = {
  "waypoints": [
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    },
    {
      "location": {
        "lat": 0,
        "lng": 0
      },
      "address": "string",
      "label": "string",
      "type": "origin"
    }
  ],
  "selectedMode": "multi",
  "routingPreferences": {
    "avoidHighways": true,
    "avoidTolls": true,
    "preferHOV": true,
    "avoidFerries": true,
    "preferLitPaths": true,
    "preferPavedPaths": true,
    "avoidHills": true,
    "safetyVsEfficiency": 1,
    "maxWalkingDistance": 0,
    "maxTransfers": 0,
    "wheelchairAccessible": true,
    "useKnownVehicleLocations": true,
    "useKnownParkingLocations": true,
    "routingEngine": "string"
  },
  "availableVehicles": [
    {
      "id": "string",
      "type": "car",
      "energyType": "electric",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "knownAccessPoints": [
    {
      "osmId": "string",
      "code": "string",
      "name": "string",
      "location": {
        "lat": 0,
        "lng": 0
      }
    }
  ],
  "preferredDepartureTime": "string",
  "preferredArrivalTime": "string",
  "requestId": "string",
  "timestamp": "string"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
Empty

Get service status and capabilities

Get the current status and capabilities of the trip planning service

GET
/directions/status

Response Body

curl -X GET "https://example.com/directions/status"
fetch("https://example.com/directions/status")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/directions/status"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/directions/status"

response = requests.request("GET", url)

print(response.text)
Empty