Middle-earth API

Plan a route

GET/routes

Plans a route between two places. Mordor is not a valid destination for walking.

Request

Query parameters

  • from string Required

    Starting place, such as Hobbiton.

  • to string Required

    Destination, such as Rivendell.

  • avoid array of strings

    Hazards to avoid.

  • pace string

    Travelling pace.

    Allowed valuesleisurelybriskforced_march

    Default"brisk"

Example request

cURL
curl -X GET 'https://api.middle-earth.example/v3/routes?from=<from>&to=<to>'

Response

The planned route.

Body

  • waypoints array of objects <Waypoint> Required

  • total_days integer Required

    Estimated days of travel.

  • warning string

    A warning about the route, if there is one.

Example response

application/json

Json
{
  "waypoints": [
    {
      "place": "Hobbiton",
      "day": 0
    },
    {
      "place": "Bree",
      "day": 4,
      "hazards": [
        "black riders"
      ]
    },
    {
      "place": "Weathertop",
      "day": 9,
      "hazards": [
        "nazgul"
      ]
    },
    {
      "place": "Rivendell",
      "day": 17
    }
  ],
  "total_days": 17,
  "warning": "Avoid the main road after dark."
}