Routes

Introduction

Every route has a route ID in the form <departure>-<destination>-<unique id>. It is assigned by the autorouter when first generating the route and later referred to by the ID.

Generating a route involves sending a create route request with the desired route characteristics in a JSON structure. The request returns immediately with a route ID but at this point, no route has been generated yet. The routing runs in the background and the client has to poll the server with the route ID to receive updates. Those updates contain information about the current route progress, routing events and – once finished – a route status and (in case of success) a flight plan structure containing all route details such as waypoints.

Route request

Creating a new route requires an aircraft definition, referenced to by the aircraft ID for aircraft stored under the user’s account or an inline definition for transient aircraft, i.e. aircraft only valid for this routing session.

The request is

HTTP POST https://api.autorouter.aero/v1.0/router

with parameters encoded as JSON in the message body

{
   // ICAO ID of departure aerodrome, mandatory
   departure: "ICAO",
   // departure (off block) time in ISO-8601 format, default now + 1h
   // alternatively a Unix epoch timestamp in seconds can be supplied
   departuretime: "2014-04-21T08:05:31.770Z",
   // optional member as an alternative to "departuretime" to specify the
   // target on block time, either ISO-8601 or Unix epoch seconds
   // arrivaltime: "2018-05-30T18:00:00.123Z",
   // whether an enroute IFR segment has to be present, default true
   forceenrouteifr: true,
   // whether an IFR departure is preferred, default true
   depatureifr: true,
   // explicit waypoint/navaid name for SID or pickup (VFR departure)
   // when specified, onlysid/sidfilter are ignored, default null
   sid: null,
   // whether only SID departures are considered, default false
   sidonly: false,
   // list of SIDs that are considered, default (empty list) all available
   sidfilter: [ "FOO4B", "BAR3A" ],
   // limit for SID/IFR pickup points in NM around departure aerodrome, default null
   // which means to use builtin default (currently 40 NM) and custom rules for certain
   // airports.
   sidlimit: null,
   // ICAO ID of destination aerodrome, mandatory
   destination: "ICAO",
   // whether an IFR arrival is preferred, default true
   destinationifr: true,
   // explicit waypoint/navaid name for STAR or IFR cancel (VFR arrival), default null
   star: null,
   // whether only STAR arrivals are considered, default false
   staronly: false,
   // list of STARs that are considered, default (empty list) all available
   starfilter: [],
   // limit for STAR/cancel IFR points in NM around destination aerodrome, default null
   // which means to use builtin default (currently 40 NM) and custom rules for certain
   // airports.
   starlimit: null,
   // whether VFR departure/arrival solutions should be included
   // set to false if you only want IFR solutions (default true)
   vfr: true,
   // whether VFR solutions should be included in case "vfr" is false but
   // there is no pure IFR solution possible (e.g. airport is only VFR; default true)
   vfrdowngrade: true,
   // ID of the aircraft, 0 for the builtin standard aircraft (P28R)
   // or transient aircraft passed in field "aircraft", default 0
   aircraftid: 0,
   // transient aircraft definition as JSON object,
   // see section on Aircraft for format, default null
   aircraft: null,
   // ICAO ID of first alternate, default null
   alternate1: null,
   // ICAO ID of second alternate, default null
   alternate2: null,
   // limit of DCT legs in nautical miles, default 200
   dctlimit: 200,
   // hard minimum enroute flight level, default 30
   hardminlevel: 30,
   // desired minimum enroute flight level, default 10
   minlevel: 10,
   // penalty factor for each level below minlevel, default 1.5
   minlevelpenalty: 1.5,
   // maximum possible penalty factor for minlevel deviation, default 3
   minlevelmaxpenalty: 3,
   // maximum enroute flight level, default 150
   maxlevel: 150,
   // preferred enroute levels, default 100 (only considered when optimize is
   // set to "preferred")
   preferredminlevel: 100,
   preferredmaxlevel: 100,
   // penalty factor for each level away from preferred level, default 1.03
   preferredlevelpenalty: 1.03,
   // simulated extra track miles in NM per level change in climb, default 3
   preferredlevelclimb: 3,
   // simulated extra track miles in NM per level change in descent, default 0
   preferredleveldescent: 0,
   // optional parameter defaulting to false to return cached routes to have
   // results sooner. This needs special processing of solutions, see below
   // routecache: true
   // optional takeoff mass in aircraft mass units, default is MTOM
   "takeoffmass": 3000,
   // route optimization strategy, can be one of:
   // - "time" (default) optimize for shortest time
   // - "fuel" optimize for lowest required fuel
   // - "preferred" optimize for preferred flight level (requires "preferredlevel"
   //   to be specified)
   optimize: "time",
   // list of waypoints to cross in the order given with the criteria given,
   // default empty list
   crossing: [
      {
          // ICAO ID of the crossing point, optional when coordinates given
          ident: "LBU",
          // latitude in degrees, optional when ident is given
          coordlatdeg: 48.35546,
          // longitude in degrees, optional when ident is given
          coordlondeg: 10.34232,
          // radius in NM around the crossing point, default 0
          radius: 1.5,
          // minimum crossing level, default GND
          minlevel: 100,
          // maximum crossing level, default 600
          maxlevel: 120
      }
   ],
   // whether the GFS wind forecast should be used to optimize the route
   // default false
   usewind: false,
   // whether DCT legs are generally forbidden, default false
   nodct: false,
   // whether UK/Ireland standard routes should be employed, default true
   usesrd: true,
   // whether to penalize open water legs, default false
   avoidwater: false,
   // list of airspace IDs (name/type) to avoid, optional
   avoidairspaces: [
      "LKAA/fir"
   ],
   // maximum number of local route iterations before giving up, default 50
   "maxlocaliterations": 50,
   // maximum number of IFPS validation iterations before giving up, default 30
   "maxremoteiterations": 30,
   // maximum router runtime in seconds, cannot be higher than 1200, default 600
   "maxrouterruntime": 600
}

When the HTTP status of the request is 200, a route ID will be returned which has to be stored by the client and used as a reference for future enquiries. Routing will start after the call returns and is asynchronous. Regular polling is required by the client to retrieve messages.

Non ICAO airports

For routes from and/or to non ICAO airports, you have two choices. Most airfields are known to autorouter with an identifier consisting of the ICAO country code (e.g. “LS” for Switzerland) and a number. If you know this code, you can supply it as departure or destination aerodrome as well as first and second alternate.

Alternatively, you may specify departure, destination and alternate aerodromes using coordinates. In this case the structure looks as follows:

...
"departure":
{
   // the name that will appear as /DEP in the flight plan
   "name": "Middle of nowhere",
   // decimal coordinates of the airfield
   "arplatdeg": 47.341637,
   "arplondeg": 8.698351,
   // elevation in feet
   "elevation": 1500
}
...

Elevation should be realistic for best results but maybe estimated or set to 0 in case it is unknown.

Route request polling

Polling requires the route ID returned by the route request call. It will return a JSON structure with messages that the client is supposed to parse. The request is blocking until there are messages or a server defined timeout is reached.

HTTP PUT https://api.autorouter.aero/v1.0/router/<routeid>/longpoll

The returned JSON structure is generally an array containing zero or more commands. Each array element is a command and is identified by the “cmdname” member. The commands are ordered chronologically within the JSON structure. The call is guaranteed to return complete commands unless there is a transmission error. An example response can look as follows:

[
   {
      "cmdname":"autoroute",
      "status":"starting",
      "timestamp":"2014-04-21T08:39:06.499035Z"
   },
   {
      "cmdname": "log",
      "item": "fplvalidation",
      "text": "NO ERRORS"
   }
]

Clients should only handle commands they are interested in and understand. There can be additional commands (also some of which may not be documented here) and commands can have additional data fields not described here. Every command (even the ones you are not interested in and those that are not documented here) should be checked for the field “error”. If this field is present and set, the routing encountered an error and will be terminated. The error can be presented to the end user.

There is no limit on how often the client is supposed to poll but the server has a limited buffer size and expects clients to fetch messages every few seconds at least. It is usually a good idea to not directly call back into the polling URL after receiving a response to not overload the client and server system. A pause of 1-2 seconds after each request works well for browser environments.

The following commands are to be expected by clients:

Command: pollagain

To improve performance and responsiveness, this command is sent to the client as part of a message when there are additional messages available beyond what was sent to the client. The client should immediately call back into the server and retrieve the remaining messages. It is guaranteed that every poll request returns a complete JSON structure and complete messages so a client can first process the messages received and then call into the server.

{
   "cmdname": "pollagain",
   "timestamp": "2014-04-21T08:39:06.499035Z"
}

Command: autoroute

This message informs the client about a change in the router status. The message looks as follows:

{
 "cmdname": "autoroute",
 "status": "starting",
 "timestamp": "2014-04-21T08:39:06.499035Z"
}

The “status” field informs about the new router status. There can be additional information depending on the status.

Status: starting

The router is starting up. Expect more messages.

Status: stopping

The router is terminating. Status information is attached to the command.

{
   "cmdname": "autoroute",
   "status": "stopping",
   // whether the routing was completed successfully
   // (if false, the error flags should be evaluated)
   "routesuccess": true,
   // number of local iterations that were performed
   // (0 means the first route passed)
   "localiteration": 0,
   // number of remote iterations that were performed, i.e. number of
   // flight plans that were sent to IFPS for validation
   "remoteiteration": 1,
   // whether there was an error finding a valid enroute segment
   "enrouteerror": false,
   // whether there was an unspecified router error
   "internalerror": false,
   // whether there maximum route iteration limit was reached
   "iterationerror": false,
   // whether there was an error finding a SID
   "siderror": false,
   // whether there was an error finding a STAR
   "starerror": false,
   // whether the routing was interrupted by a stop command
   "userstop": false,
   // whether there was an error with the validator (local or IFPS)
   "validatorerror": false,
   // the timestamp of the message, ISO-8601
   "timestamp":"2014-04-21T08:39:11.243248Z",
   // time spent waiting for the validator (IFPS)
   "validatortime": 0.436086,
   // total time spent for the routing
   "wallclocktime":4.744207
}

Status: terminate

The router process was terminated by the system, most likely due to reaching a timeout.

Status: quit

The router has terminated, sent in response to the “close” command.

Command: fpl

This transmits a new flight plan. There can be several flight plans throughout the course of the routing and other messages such as fplvalidation refer to the last transmitted fpl message. Please note that a fpl message only represents an intermediary flight plan and does not necessarily validate against IFPS or is to be considered a final solution. It is merely provided to allow a client to display progress. A flight plan is presented as both an IFPS conforming string and a list of waypoints. The message for a Z flight plan from EDTH to EDMS via the waypoints RIXED and MAMOR would look as follows. Comments are inline for the most important fields.

   {
      "cmdname": "fpl",
      "curwpt": 0,
      // the flight plan string as required by IFPS
      "fpl": "-(FPL-ZPTZA-ZG -1C82R\/L -SDFGRY\/S -EDTH0943 -N0138VFR RIXED\/N0138F040 IFR DCT ERNAS DCT MAMOR DCT -EDMS0046 -PBN\/A1B2S1 DOF\/140421 EET\/RIXED0010 )",
      // the flight plan waypoint array, first entry is the departure aerodrome,
      // last entry the destination aerodrome. Alternates are not included.
      "fplan": [
      {
         // altitude in feet
         "altitude": 1407,
         // altitude is given for local QNH, can also be "std" for flight level
         "altmode": "qnh",
         // whether the leg from this waypoint to the next is a climb
         "climb": true,
         // several different representations of the waypoint coordinates follow
         // clients can choose the most convenient format
         "coord": "582233202,118439686",
         "coordlat": 582233202,
         "coordlatdeg": 48.802223224193,
         "coordlatstr": "N48 48.13339",
         "coordlon": 118439686,
         "coordlondeg": 9.9274997971952,
         "coordlonstr": "E009 55.64999",
         "declination": 0,
         // whether the leg from this waypoint to the next is a descent
         "descent": false,
         // distance in nautical miles from this waypoint to the next
         "dist": 19.5078125,
         "flags": 16386,
         // the flight rules on this leg, can be "vfr" or "ifr". If the first
         // waypoint has "vfr" flight rules, it's a Z flight plan.
         "flightrules": "vfr",
         // time elapsed in seconds until reaching this waypoint
         "flighttime": 0,
         "frequency": 0,
         // fuel burned until reaching this waypoint
         // (in fuel units of the aircraft)
         "fuel": 0,
         // ground speed in knots
         "gs": 138,
         // ICAO identifier of the waypoint, can be an empty string
         "icao": "EDTH",
         "isaoffset": 0,
         // magnetic heading and track from this waypoint to the next
         "magneticheading": 85.001220703125,
         "magnetictrack": 85.001220703125,
         "mp": 0,
         // name of the waypoint, can be an empty string. Entries with empty name
         // are not part of the flight plan and can be ignored. They usually indicate
         // a change in path properties, such crossing a FIR boundary or an amended
         // max cruise level on an airway segment
         "name": "HEUBACH",
         "note": "",
         // whether the next leg is a partial standard route segment
         "partialstandardroute": false,
         // the type of connection to the following waypoint. This can be
         // - None: for VFR legs
         // - Direct To: a DCT
         // - Airway: via an airway
         // - SID: on a standard instrument departure
         // - STAR: on a standard instrument arrival
         "pathcode": "None",
         // the name of the path, this would be the name of the airway/SID/STAR
         // or an empty string for VFR legs and DCTs
         "pathname": "",
         "qff": 1003.21875,
         "rpm": 0,
         "save_time":-2114380800,
         // whether the next leg is part of a standard route (UK/Ireland)
         "standardroute": false,
         // true airspeed in nautical miles
         // identical to ground speed unless the GFS wind forecast was activated
         "tas": 138,
         // time in seconds since the Unix epoch when reaching this waypoint
         "time":1398073380,
         "truealt": 4000,
         "trueheading": 85.001220703125,
         "truetrack": 85.001220703125,
         // whether a change in course (as per BRNAV requirements) is performed
         // at this waypoint
         "turnpoint": true,
         // the type of waypoint, this can be
         // - ARPT: airport
         // - INT: intersection
         // - NDB: NDB
         // - VOR: VOR
         // - VORDME: VOR/DME
         // - VORTAC: VORTAC
         // - DME: DME
         // - NDBDME: NDB/DME
         // - TACAN: TACAN
         "type": "ARPT",
         // wind direction in degrees overhead the waypoint
         // zero unless GFS wind forecasts are active
         "winddir": 0,
         // wind speed in knots overhead this waypoint
         // zero unless GFS wind forecasts are active
         "windspeed": 0
      },
      {
         "altitude": 4000,
         // this means FL040
         "altmode": "std",
         "climb": false,
         "coord": "582557969,124298877",
         "coordlat": 582557969,
         "coordlatdeg": 48.829444879666,
         "coordlatstr": "N48 49.76669",
         "coordlon": 124298877,
         "coordlondeg": 10.418611513451,
         "coordlonstr": "E010 25.11669",
         "declination": 0,
         "densityalt": 4000.0104980469,
         "descent": false,
         "dist": 31.6953125,
         "flags": 49153,
         // as the previous waypoint has "vfr", this is the IFR pickup point
         "flightrules": "ifr",
         "flighttime": 581,
         "frequency": 0,
         "fuel": 2.90625,
         "gs": 138,
         "icao": "",
         "isaoffset": 0,
         "magneticheading": 88.033447265625,
         "magnetictrack": 88.033447265625,
         "mp": 0.08984375,
         "name": "RIXED",
         "note": "",
         "partialstandardroute": false,
         // the type of connection to the following waypoint
         "pathcode": "Direct To",
         "pathname": "",
         "qff": 1003.34375,
         "rpm": 2100,
         "save_time": -2114380800,
         "standardroute": false,
         "tas": 138,
         "time": 1398073961,
         "truealt": 4000,
         "trueheading": 88.033447265625,
         "truetrack": 88.033447265625,
         "turnpoint": true,
         // RIXED is an IFR waypoint (intersection)
         "type": "INT",
         "winddir": 0,
         "windspeed": 0
      },
      {
         "altitude": 4000,
         "altmode": "std",
         "climb": false,
         "coord": "582740241,133853184",
         "coordlat": 582740241,
         "coordlatdeg": 48.844722742215,
         "coordlatstr": "N48 50.68336",
         "coordlon": 133853184,
         "coordlondeg": 11.219444274902,
         "coordlonstr": "E011 13.16666",
         "declination": 0,
         "densityalt": 4000.0104980469,
         "descent": false,
         "dist": 39.7265625,
         "flags": 49153,
         "flightrules": "ifr",
         "flighttime": 1408,
         "frequency": 0,
         "fuel": 5.59375,
         "gs": 138,
         "icao": "",
         "isaoffset": 0,
         "magneticheading": 86.055908203125,
         "magnetictrack": 86.055908203125,
         "mp": 0.08984375,
         "name": "ERNAS",
         "note": "",
         "partialstandardroute": false,
         "pathcode": "Direct To",
         "pathname": "",
         "qff": 1003.65625,
         "rpm": 2100,
         "save_time": -2114380800,
         "standardroute": false,
         "tas": 138,
         "time": 1398074788,
         "truealt": 4000,
         "trueheading": 86.055908203125,
         "truetrack": 86.055908203125,
         "turnpoint": true,
         "type": "INT",
         "winddir": 0,
         "windspeed": 0
      },
      {
         "altitude": 4000,
         "altmode": "std",
         "climb": false,
         "coord": "583230714,145816792",
         "coordlat": 583230714,
         "coordlatdeg": 48.885833714157,
         "coordlatstr": "N48 53.15002",
         "coordlon": 145816792,
         "coordlondeg": 12.222222313285,
         "coordlonstr": "E012 13.33334",
         "declination": 0,
         "densityalt": 4000.0104980469,
         // we descend after this waypoint
         "descent": true,
         "dist": 11.7265625,
         "flags": 49157,
         "flightrules": "ifr",
         "flighttime": 2444,
         "frequency": 0,
         "fuel": 8.9609375,
         "gs": 138,
         "icao": "",
         "isaoffset": 0,
         "magneticheading": 85.4736328125,
         "magnetictrack": 85.4736328125,
         "mp": 0.08984375,
         "name": "MAMOR",
         "note": "",
         "partialstandardroute": false,
         "pathcode": "Direct To",
         "pathname": "",
         "qff": 1004.375,
         "rpm": 2100,
         "save_time": -2114380800,
         "standardroute": false,
         "tas": 138,
         "time": 1398075824,
         "truealt": 4000,
         "trueheading": 85.4736328125,
         "truetrack": 85.4736328125,
         "turnpoint": true,
         "type": "INT",
         "winddir": 0,
         "windspeed": 0
      },
      {
         // airport elevation
         "altitude": 1040,
         "altmode": "qnh",
         "climb": false,
         "coord": "583409664,149346224",
         "coordlat": 583409664,
         "coordlatdeg": 48.900833129883,
         "coordlatstr": "N48 54.04999",
         "coordlon": 149346224,
         "coordlondeg": 12.51805588603,
         "coordlonstr": "E012 31.08335",
         "declination": 0,
         "descent": false,
         // there is no next waypoint therefore distance to next is 0
         "dist": 0,
         "flags": 49152,
         "flightrules": "ifr",
         "flighttime": 2750,
         "frequency": 0,
         "fuel": 9.95703125,
         "gs": 0,
         "icao": "EDMS",
         "isaoffset": 0,
         "magneticheading": 0,
         "magnetictrack": 0,
         "mp": 0,
         "name": "STRAUBING",
         "note": "",
         "partialstandardroute": false,
         "pathcode": "None",
         "pathname": "",
         "qff": 1004.625,
         "rpm": 0,
         "save_time": -2114380800,
         "standardroute": false,
         "tas": 0,
         "time": 1398076130,
         "truealt": 0,
         "trueheading": 0,
         "truetrack": 0,
         "turnpoint": true,
         "type": "ARPT",
         "winddir": 0,
         "windspeed": 0
      }],
      // great circle distance in nautical miles, i.e. the direct line
      // from departure to destination
      "gcdist": 102.62730001524,
      // initial altitude of the cruise segment, corresponds to speed/altitude
      // group at the start of item15. For "VFR" as the cruise altitude, a
      // low value will be returned
      "initialaltitude": 3500,
      // either "qnh" for local QNH or "std" for 1013.25hPa
      "initialaltitudemode": "qnh",
      // number of IFPS iterations required for the route
      "iteration": 0,
      // number of local iterations required
      "localiteration": 0,
      // maximum cruise altitude within the flight plan
      "maxaltitude": 4000,
      // either "qnh" for local QNH or "std" for 1013.25hPa
      "maxaltitudemode": "std",
      // fuel required when flying great circle distance
      "minfuel": 9.9492188660358,
      // fuel required when flying great circle distance and ignoring the wind
      "minfuelzerowind": 9.9492188660358,
      // time in seconds required when flying great circle distance
      "mintime": 2748,
      // time in seconds required when flying great circle distance
      // and ignoring the wind
      "mintimezerowind": 2748,
      "note": "",
      // offblock time, in seconds since Unix epoch
      "offblock": 1398073080,
      // onblock time, in seconds since Unix epoch
      "onblock": 1398076430,
      // number of IFPS iterations required for the flight plan
      "remoteiteration": 0,
      // whether the solution is from the route cache
      "routecache": false,
      // route distance in nautical miles
      "routedist": 102.65652987672,
      // fuel required for route
      "routefuel": 9.9563835760488,
      // fuel required for route when ignoring the wind forecast
      "routefuelzerowind": 9.9563835760488,
      // time required in seconds
      "routetime": 2750,
      // time required in seconds when ignoring the wind forecast
      "routetimezerowind": 2750,
      "save_offblock": -2114380800,
      "save_onblock": -2114380800,
      "timestamp": "2014-04-21T08:39:10.780144Z",
      // time spent in the validator to determine the route
      "validatortime": 0,
      // time required to determine this route
      "wallclocktime": 4.281111}
   }

Command: solution

The solution command is like the fpl command with the difference that it contains a valid flight plan that has passed IFPS validation. Multiple solutions are usually provided with different properties, such as VFR departure and VFR arrival and SID or direct and STAR or direct connections.

It is up to the client to choose the solution it prefers based on its own criteria for route quality. It could assume that an flight without VFR legs is preferred of one with VFR legs and that SID/STARs are preferred over direct connections. It could also use the route length as its main criterion.

If “routecache: true” is passed to the route request, solutions from the route cache will have a “routecache: true” attribute. A non cached solution can replace a previously returned cached route entry through its “obsoletedsolutions” member which is an array of strings, giving the IDs of the previously returned solutions. Such previously returned solutions would have a string “solutionid” member carrying the ID that “obsoleltedsolutions” refers to.

Command: log

The log command provides several diagnostic messages, one of them being flight plan validation results. These can be useful to show progress to the user and make him understand where the router is experiencing difficulties. A log command always has an “item” identifier that determines the type of log message and a “text” field that contains the log message.

Log message: fplvalidation

{
   "cmdname": "log",
   "item": "fplvalidation",
   "text": "NO ERRORS"
}

This message contains the last route validation result. For a route that gets the “routesuccess”: true status in the autoroute message, it will either be “NO ERRORS” or “(R)ROUTE152: FLIGHT NOT APPLICABLE TO IFPS” if the route is outside the area of IFPS. The status messages are defined by IFPS and can be found in the Annex to the IFPS USERS MANUAL on the Eurocontrol site.

Stop routing

In order to stop a routing in progress, a client can issue

HTTP PUT https://api.autorouter.aero/v1.0/router/<routeid>/stop

The response would be an autorouter message with the status “quit” which will either be contained in the body of the response to the stop request or a following poll request.

Close routing session

During a routing process and for some time afterwards, the server keeps a structure in memory. Once a client is done with a particular routing, it is recommended to close the routing session to allow the server to free the resources.

HTTP PUT https://api.autorouter.aero/v1.0/router/<routeid>/close

The response to the message would be an autorouter message with the status “quit” which will either be contained in the body of the response to the close request or a following poll request. Note that after receiving the quit message, the client should not longer poll for messages for the given route id.

Use external route

In order to use some of the platform features (such as briefing packs) with routes that already exist, it is possible to call the router with an existing routing which it will parse and then store as solution without performing a search.

HTTP POST https://api.autorouter.aero/v1.0/router

The invocation is the same as for searching a route but in the parameter list, a member “fpl” should be set which contains the flight plan string in ICAO format. Additionally the “aircraftid” parameter may be given with the same values as for the regular call (ID of a defined aircraft or JSON definition of an aircraft or 0 for the builtin aircraft). Note that the details of the given aircraft will be applied to the flight plan passed, i.e. fields like callsign and equipment will be taken from the aircraft configuration.

{
   // same as in the normal route request
   "aircraftid": 0,
   // ICAO flight plan string, if this is present, the router is not invoked
   "fpl": "(FPL-ZZZZZ-IG -1P28R/L -SDFGBRY/S -EDDS0725 -N0132F050 STG2H STG DCT NOTGA -EDTY0018 -PBN/B2D2)"
}

Retrieve route log

The router keeps several log files for each route which can allow trained staff to get some insight into the routing process and help with problem determination. The logs can be retrieved using the following call:

HTTP GET https://api.autorouter.aero/v1.0/router/<routeid>/log?type=<type>[&download=yes]

The following log types are currently recognized:

  • message
    Diagnostic and progress output of the router
  • json
    JSON communication between the API web service and the router engine
  • initialgraph
  • loadedgraph
  • stdroutegraph
  • depdestgraph
  • compedgegraph
  • finalgraph

The download parameter sends the raw file, otherwise HTML is returned.

Storing a route

In order to work with routes as identified by their route ID, you have to choose among the solutions you get from the router and store the one you want to use.

HTTP PUT https://api.autorouter.aero/v1.0/router/<routeid>

The PUT parameters are as follows:

  • fpl
    The ICAO flight plan string returned in the solution.
  • routedistance
    The route distance in NM (real number).
  • departuretime
    The departure time (EOBT) in seconds since the Unix expoch (integer).
  • fuelonboard
    The fuel on board in aircraft fuel units (real number).
  • loading
    The W&B JSON string giving for each station the loading. Can be empty. Loading is an array where each object refers to a loading station as defined in the aircraft profile. Each loading object has two required members: “pos” and “mass” where the former is the index of the station (0 for the first) as defined in the aircraft and mass is the loaded mass in aircraft mass units. Note that the fuel tank is also a loading station and that its content is given in aircraft mass units, not fuel units. Also keep in mind that the above parameter “fuelonboard” is not used when a loading structure is given. Stations that are not referenced in the loading array are loaded with mass zero.
  • gar
    The General Aviation Report information as JSON string. Can be empty.
  • alt1routeid
    Route ID containing the route from destination to the first alternate. Can be omitted. Empty value removes the setting.
  • alt2routeid
    Route ID containing the route from the destination to the second alternate. Can be omitted. Empty value removes the setting.

This is a pure database operation, meaning the data you supply will be stored and it is the only data available when you retrieve the route. For your convenience, apart from the flight plan in ICAO format, a few additional route properties are stored as well such as the distances for easier identification of route properties without having to parse the ICAO flight plan string.

Listing past routes

autorouter remains past routes in its database and presents them through its web interface. It is also possible to retrieve this information via an API by performing

HTTP GET https://api.autorouter.aero/v1.0/router/logs?offset=0&limit=10&order=desc

The query parameters are as follows:

  • offset
    Offset of the result items to be returned with 0 for the first item of the query.
  • limit
    Number of items to return in the query. The maximum that can be returned in one query is 100.
  • order
    The sort order, can be “desc” for descending or “asc” for ascending.
  • sort
    The criterion to sort by, defaults to “departuretime”.

As a result you get a JSON array with the following structure. Only a subset of the returned members are currently documented here, please contact us if you need additional information.

[
  {
    aircraftdescription: "Cessna CitationJet (1999)",
    callsign: "N1235",
    departure: "LFSB",
    departurename: "Basle-Mulhouse",
    departuretime: 1494587700,
    destination: "LYTV",
    destinationname: "Tivat",
    fplan: "(FPL-N1235....."),
    fuelunit: "lb",
    gcddistance: 568,
    routedistance: 639,
    routefuel: 1504.2
    routeid: "LFSB-LYTV-59156af893577",
    // when the route was created
    timestamp: 1494575864
  }
]

WARNING: this API is considered to be unstable, meaning that we reserve the right to perform incompatible changes to it without adhering to the API versioning guidelines. Should you require this API as part of your application, please let us know so that we can change its status to stable and guarantee API stability.

Deleting routes

Using this API, routes can be deleted and omitted from future lists. To delete a single route, issue

HTTP PUT https://api.autorouter.aero/v1.0/router/<routeid>/hide

To do a bulk delete of multiple route IDs, issue

HTTP PUT https://api.autorouter.aero/v1.0/router/hide

As body, pass a JSON structure that is an array of strings with each string containing the route ID.

WARNING: this API is considered to be unstable, meaning that we reserve the right to perform incompatible changes to it without adhering to the API versioning guidelines. Should you require this API as part of your application, please let us know so that we can change its status to stable and guarantee API stability.