ML Flight Time Estimation
Gate-to-gate flight time between any two airports, predicted by a GradientBoosting model trained on historical operational data (R² ≈ 0.98). Block time is the scheduled gate-to-gate duration including taxi at both ends.
Use this endpoint when you need block-time estimates for scheduling, connection buffers, or delay-risk dashboards.
Provide origin and destination as ICAO or IATA codes. Pass an optional ICAO aircraft type code (B738, A320, B77W) for a tighter estimate.
Important: Wind and live en-route weather are not model inputs — the result is a statistical average for the route and aircraft category.
Request
Requirements
x-api-key on every request (direct subscription). Learn more →https://data.skylinkapi.com/v3/ml/flight-time| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
from | string | Yes | - | Origin airport ICAO or IATA code, e.g. KSFO |
to | string | Yes | - | Destination airport ICAO or IATA code, e.g. KJFK |
aircraft | string | No | model default | ICAO aircraft type code, e.g. B738, A320 |
Response
{
"origin": "KSFO",
"destination": "KJFK",
"aircraft_type": "B738",
"distance_nm": 2241.75,
"estimated_minutes": 294,
"estimated_hours_display": "4h 54m",
"min_minutes": 259,
"max_minutes": 329,
"model_version": "2.0.0-wind"
}| Field | Type | Required | Null? | Description |
|---|---|---|---|---|
origin | string | Yes | Never | Resolved origin ICAO code |
destination | string | Yes | Never | Resolved destination ICAO code |
aircraft_type | string | null | No | Yes | Aircraft type used, or null when omitted |
distance_nm | number | Yes | Never | Great-circle distance in nautical miles |
estimated_minutes | integer | Yes | Never | Gate-to-gate estimate in minutes |
estimated_hours_display | string | Yes | Never | Human-readable duration |
min_minutes | integer | Yes | Never | Lower bound of estimate range |
max_minutes | integer | Yes | Never | Upper bound of estimate range |
model_version | string | Yes | Never | Model artifact version |
Client types
"""ML flight time response models for /ml/flight-time."""from __future__ import annotationsfrom dataclasses import dataclass@dataclassclass FlightTimeRequest: """Query input for GET /ml/flight-time.""" from_airport: str to_airport: str aircraft: str | None = None@dataclassclass FlightTimePrediction: origin: str destination: str aircraft_type: str | None distance_nm: float estimated_minutes: int estimated_hours_display: str min_minutes: int max_minutes: int model_version: strIntegration
import osfrom dataclasses import dataclassimport requestsBASE = "https://data.skylinkapi.com/v3"HEADERS = { "x-api-key": os.getenv("SKYLINK_API_KEY", "YOUR_API_KEY")}@dataclassclass FlightTimeEstimate: origin: str destination: str block_minutes: int display: str min_minutes: int max_minutes: int distance_nm: floatdef fetch_flight_time(*, origin: str, destination: str, aircraft: str | None = None) -> dict: """Fetch ML gate-to-gate flight time between two airports.""" params: dict[str, str] = {"from": origin.upper(), "to": destination.upper()} if aircraft: params["aircraft"] = aircraft.upper() r = requests.get(f"{BASE}/ml/flight-time", headers=HEADERS, params=params, timeout=(10, 20)) r.raise_for_status() return r.json()def flight_time_estimate(origin: str, destination: str, aircraft: str | None = None) -> FlightTimeEstimate: data = fetch_flight_time(origin=origin, destination=destination, aircraft=aircraft) return FlightTimeEstimate( origin=data["origin"], destination=data["destination"], block_minutes=int(data["estimated_minutes"]), display=data["estimated_hours_display"], min_minutes=int(data["min_minutes"]), max_minutes=int(data["max_minutes"]), distance_nm=float(data["distance_nm"]), )if __name__ == "__main__": import json from dataclasses import asdict estimate = flight_time_estimate("KJFK", "KLAX", aircraft="B738") print(json.dumps(asdict(estimate), indent=2))Implementation notes
Aircraft type. Narrow-body vs wide-body codes materially change block time on long routes.
Bounds vs point estimate. min_minutes and max_minutes bracket typical operational variance.
Error responses
422 — invalid airport code
Returned when from or to cannot be resolved to a known airport.
Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Query Parameters
Origin airport ICAO or IATA code
3 <= length <= 4Destination airport ICAO or IATA code
3 <= length <= 4Aircraft type code (e.g. B738, A320, C172)
length <= 4Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/ml/flight-time?from=stri&to=stri"{
"origin": "string",
"destination": "string",
"aircraft_type": "string",
"distance_nm": 0,
"estimated_minutes": 0,
"estimated_hours_display": "string",
"min_minutes": 0,
"max_minutes": 0,
"model_version": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}