Navigation Log
POST/api/v1/navlog/calculateCommercial Pilot

Calculate Navlog

Calculates a complete VFR navigation log for a cross-country flight.

Generate a complete navigation log for a multi-leg flight — calculates headings, groundspeed, fuel burn, ETEs, and wind corrections using real winds aloft data.

A navigation log (navlog) is the flight plan document pilots prepare before cross-country flights. It accounts for wind at cruise altitude to calculate magnetic headings, fuel requirements, and estimated times en route. This endpoint automates what student pilots do by hand with an E6B flight computer.

Code Examples

curl \
  -X POST \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "waypoints": [
    {
      "id": "KCLT",
      "name": "Charlotte Douglas Intl",
      "latitude": 35.214,
      "longitude": -80.9431,
      "altitude": 748,
      "waypointType": "Airport",
      "isRefuelingStop": false
    },
    {
      "id": "KTYS",
      "name": "McGhee Tyson",
      "latitude": 35.811,
      "longitude": -83.994,
      "altitude": 981,
      "waypointType": "Airport",
      "isRefuelingStop": true,
      "refuelToFull": true
    },
    {
      "id": "KBNA",
      "name": "Nashville Intl",
      "latitude": 36.1245,
      "longitude": -86.6782,
      "altitude": 599,
      "waypointType": "Airport",
      "isRefuelingStop": false
    }
  ],
  "performanceData": {
    "climbTrueAirspeed": 80,
    "cruiseTrueAirspeed": 120,
    "descentTrueAirspeed": 100,
    "climbFpm": 500,
    "descentFpm": 500,
    "climbFuelBurn": 10,
    "cruiseFuelBurn": 8.5,
    "descentFuelBurn": 5,
    "sttFuelGals": 1.2,
    "fuelOnBoardGals": 40
  },
  "plannedCruisingAltitude": 7500,
  "timeOfDeparture": "2026-03-29T14:46:05Z"
}' \
  "https://api.preflightapi.io/api/v1/navlog/calculate"

Description

Provide an ordered list of waypoints (minimum 2) with aircraft performance data, a cruising altitude, and a departure time. The service calculates every leg of the route and returns detailed per-leg data including course, heading, ground speed, distance, estimated time, fuel burn, and wind information.

Automatic Waypoint Insertion

The service automatically inserts calculated waypoints into the route to model climb and descent phases:

  • Top of Climb (TOC) — Inserted after departure (or after a refueling stop) at the point where the aircraft reaches cruising altitude. Position is calculated using the climb true airspeed and climb rate from your performance data. Legs before the TOC use climb airspeed and climb fuel burn rate.
  • Top of Descent (TOD) — Inserted before the destination (or before a refueling stop) at the point where the aircraft should begin descending. Calculated using descent airspeed, descent rate, and a 3 NM final approach buffer. Legs after the TOD use descent airspeed and descent fuel burn rate.
  • Bottom of Descent (BOD) — Inserted 3 NM before the destination airport at Traffic Pattern Altitude (airport elevation + 1000 ft, rounded to the nearest 100 ft). This marks the point where the aircraft levels off at pattern altitude for the approach.

Wind Correction

The service automatically fetches winds aloft forecast data based on your departure time and selects the nearest reporting station to each waypoint. Wind direction, speed, and temperature are interpolated to the leg's altitude. The magnetic heading returned for each leg is the actual heading to fly after accounting for both magnetic variation and wind correction. If wind data is unavailable, the calculation proceeds with zero-wind assumptions (ground speed equals true airspeed).

Fuel Tracking

Fuel is tracked across the entire route. Start/Taxi/Takeoff (STT) fuel is deducted at departure and again after each refueling stop. Each leg burns fuel at the rate matching its phase (climb, cruise, or descent). The RemainingFuelGals field on each leg shows usable fuel remaining at the end of that leg. Refueling stops can either add a specific number of gallons or refuel to full capacity.

Refueling Stops

Any intermediate waypoint can be marked as a refueling stop. When a refueling stop is present, the route is segmented so that each segment gets its own independent TOC, TOD, and BOD waypoints. This models a real multi-leg flight where you climb out after each stop and descend into each landing.

Airspace and Obstacle Detection

After calculating the route, the service queries the database for controlled airspaces (Class B, C, D, E), special use airspaces (Restricted, Prohibited, MOA, Warning, Alert), and obstacles along the route corridor. The response includes identifier collections that you can use with other endpoints to retrieve full details:

  • AirspaceGlobalIds — use with GET /api/v1/airspaces/by-global-ids
  • SpecialUseAirspaceGlobalIds — use with GET /api/v1/airspaces/special-use/by-global-ids
  • ObstacleOasNumbers — use with POST /api/v1/obstacles/by-oas-numbers

Request BodyNavlogRequestDto

plannedCruisingAltitudeinteger

Planned cruising altitude in feet MSL.

timeOfDeparturedate-time

Planned departure time. ISO 8601 UTC format.

Response Schema

200Returns the calculated navigation logNavlogResponseDto
totalRouteDistancenumber

Total route distance in nautical miles (sum of all leg distances).

totalRouteTimeHoursnumber

Total estimated en-route time in hours (including climb and descent phases).

totalFuelUsednumber

Total fuel consumed for the entire route in gallons (including start/taxi/takeoff fuel).

averageWindComponentnumber

Average wind component across all legs in knots. Negative values indicate a net headwind; positive values indicate a net tailwind.

airspaceGlobalIdsstring[]

Global IDs of controlled airspaces (Class B, C, D, E) that the route passes through. Use these IDs with the GET /api/v1/airspaces/by-global-ids?globalIds=... endpoint to retrieve full airspace details including boundaries and altitude limits.

specialUseAirspaceGlobalIdsstring[]

Global IDs of special use airspaces (restricted, prohibited, MOA, warning, alert) that the route passes through. Use these IDs with the GET /api/v1/airspaces/special-use/by-global-ids?globalIds=... endpoint to retrieve full airspace details including boundaries and altitude limits.

obstacleOasNumbersstring[]

OAS (Obstacle Assessment Surface) numbers of obstacles near the route. Use these numbers with the POST /api/v1/obstacles/by-oas-numbers endpoint to retrieve full obstacle details including type, height, and lighting.

400 The request data is invalid. Common causes: fewer than 2 waypoints, missing performance data, or invalid coordinate values. ApiErrorResponse
codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

503 An external service required for the calculation is temporarily unavailable. This can be the NOAA magnetic variation API or the winds aloft data source. ApiErrorResponse
codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

Provide accurate performance data

The accuracy of the navlog depends on realistic aircraft performance numbers (TAS, fuel burn, climb/descent rates). Use values from your aircraft's POH, not estimates.

Mark refueling stops

Set isRefuelingStop: true on waypoints where you plan to refuel. The fuel calculations will account for fuel added at those stops.

Search Documentation

Search docs, endpoints, and schemas