OpenRouteService · Schema

OpenRouteService Directions Request

Request body schema for the OpenRouteService Directions API endpoint

RoutingGeospatialDirectionsIsochronesMatrixGeocodingElevationOptimizationOpenStreetMapNavigationLogisticsHumanitarian

Properties

Name Type Description
coordinates array Waypoints as [longitude, latitude] pairs. Minimum 2, maximum 50.
preference string Routing preference
units string Distance units for the response
language string Language for turn-by-turn instructions (IETF BCP 47)
geometry boolean Include route geometry in the response
geometry_simplify boolean Simplify geometry for reduced response size
instructions boolean Include turn-by-turn instructions
instructions_format string Format for turn-by-turn instructions
roundabout_exits boolean Include roundabout exit instructions
attributes array Additional route-level attributes to include
extra_info array Segment-level extra information to include
elevation boolean Include elevation values for route coordinates
continue_straight boolean Force straight routes at waypoints (not available for driving profiles)
avoid_features array Road features to avoid
avoid_borders string Border crossing restrictions
avoid_countries array ISO 3166-1 alpha-3 country codes to avoid
avoid_polygons object GeoJSON Polygon or MultiPolygon defining areas to avoid
maximum_speed number Maximum speed in km/h (HGV profiles only)
bearings array Bearing constraints for waypoint snapping as [bearing, deviation] pairs
radiuses array Search radii in meters for snapping waypoints to the road network
alternative_routes object Configuration for computing alternative routes
options object Profile-specific routing options
id string Arbitrary identifier echoed back in the response
View JSON Schema on GitHub

JSON Schema

openrouteservice-directions-request.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/openrouteservice/main/json-schema/openrouteservice-directions-request.json",
  "title": "OpenRouteService Directions Request",
  "description": "Request body schema for the OpenRouteService Directions API endpoint",
  "type": "object",
  "required": ["coordinates"],
  "properties": {
    "coordinates": {
      "type": "array",
      "description": "Waypoints as [longitude, latitude] pairs. Minimum 2, maximum 50.",
      "minItems": 2,
      "maxItems": 50,
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        },
        "minItems": 2,
        "maxItems": 2
      },
      "examples": [
        [[8.681495, 49.41461], [8.687872, 49.420318]]
      ]
    },
    "preference": {
      "type": "string",
      "description": "Routing preference",
      "enum": ["fastest", "shortest", "recommended"],
      "default": "recommended"
    },
    "units": {
      "type": "string",
      "description": "Distance units for the response",
      "enum": ["m", "km", "mi"],
      "default": "m"
    },
    "language": {
      "type": "string",
      "description": "Language for turn-by-turn instructions (IETF BCP 47)",
      "default": "en",
      "examples": ["en", "de", "fr", "es"]
    },
    "geometry": {
      "type": "boolean",
      "description": "Include route geometry in the response",
      "default": true
    },
    "geometry_simplify": {
      "type": "boolean",
      "description": "Simplify geometry for reduced response size",
      "default": false
    },
    "instructions": {
      "type": "boolean",
      "description": "Include turn-by-turn instructions",
      "default": true
    },
    "instructions_format": {
      "type": "string",
      "description": "Format for turn-by-turn instructions",
      "enum": ["html", "text"],
      "default": "text"
    },
    "roundabout_exits": {
      "type": "boolean",
      "description": "Include roundabout exit instructions",
      "default": false
    },
    "attributes": {
      "type": "array",
      "description": "Additional route-level attributes to include",
      "items": {
        "type": "string",
        "enum": ["avgspeed", "detourfactor", "percentage"]
      }
    },
    "extra_info": {
      "type": "array",
      "description": "Segment-level extra information to include",
      "items": {
        "type": "string",
        "enum": [
          "steepness",
          "suitability",
          "surface",
          "waycategory",
          "waytype",
          "tollways",
          "traildifficulty",
          "osmid",
          "roadaccessrestrictions",
          "countryinfo",
          "green",
          "noise"
        ]
      }
    },
    "elevation": {
      "type": "boolean",
      "description": "Include elevation values for route coordinates",
      "default": false
    },
    "continue_straight": {
      "type": "boolean",
      "description": "Force straight routes at waypoints (not available for driving profiles)"
    },
    "avoid_features": {
      "type": "array",
      "description": "Road features to avoid",
      "items": {
        "type": "string",
        "enum": ["highways", "tollways", "ferries", "fords", "steps"]
      }
    },
    "avoid_borders": {
      "type": "string",
      "description": "Border crossing restrictions",
      "enum": ["all", "controlled", "none"]
    },
    "avoid_countries": {
      "type": "array",
      "description": "ISO 3166-1 alpha-3 country codes to avoid",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 3
      }
    },
    "avoid_polygons": {
      "type": "object",
      "description": "GeoJSON Polygon or MultiPolygon defining areas to avoid"
    },
    "maximum_speed": {
      "type": "number",
      "description": "Maximum speed in km/h (HGV profiles only)"
    },
    "bearings": {
      "type": "array",
      "description": "Bearing constraints for waypoint snapping as [bearing, deviation] pairs",
      "items": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "radiuses": {
      "type": "array",
      "description": "Search radii in meters for snapping waypoints to the road network",
      "items": {
        "type": "number"
      }
    },
    "alternative_routes": {
      "type": "object",
      "description": "Configuration for computing alternative routes",
      "properties": {
        "target_count": {
          "type": "integer",
          "description": "Number of alternative routes to compute",
          "minimum": 1,
          "maximum": 3
        },
        "weight_factor": {
          "type": "number",
          "description": "Factor by which alternatives can exceed the optimal route length",
          "minimum": 1
        },
        "share_factor": {
          "type": "number",
          "description": "Minimum fraction of unique segments for alternatives",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "options": {
      "type": "object",
      "description": "Profile-specific routing options",
      "properties": {
        "avoid_borders": {
          "type": "string",
          "enum": ["all", "controlled", "none"]
        },
        "avoid_countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "avoid_features": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "profile_params": {
          "type": "object",
          "properties": {
            "weightings": {
              "type": "object",
              "properties": {
                "green": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "quiet": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "steepness_difficulty": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3
                }
              }
            },
            "restrictions": {
              "type": "object",
              "properties": {
                "length": {"type": "number"},
                "width": {"type": "number"},
                "height": {"type": "number"},
                "axleload": {"type": "number"},
                "weight": {"type": "number"},
                "hazmat": {"type": "boolean"},
                "maximum_incline": {"type": "integer"},
                "maximum_slope": {"type": "integer"}
              }
            }
          }
        },
        "avoid_polygons": {
          "type": "object"
        },
        "round_trip": {
          "type": "object",
          "description": "Configuration for round trip routing",
          "properties": {
            "length": {
              "type": "number",
              "description": "Target length of the round trip in meters"
            },
            "points": {
              "type": "integer",
              "description": "Number of points to generate for the round trip"
            },
            "seed": {
              "type": "integer",
              "description": "Random seed for round trip generation"
            }
          }
        }
      }
    },
    "id": {
      "type": "string",
      "description": "Arbitrary identifier echoed back in the response"
    }
  }
}