Skip to main content
GET
/
api
/
explain
AI Explanation
curl --request GET \
  --url https://app.airrating.io/api/explain
{
  "origin": "<string>",
  "destination": "<string>",
  "airline": "<string>",
  "date": "<string>",
  "score": 123,
  "explanation": "<string>",
  "drivers": [
    {
      "factor": "<string>",
      "contribution": "<string>",
      "detail": "<string>"
    }
  ]
}

Overview

Returns a detailed AI-generated explanation of why a flight has its risk score. The explanation covers the main delay drivers: historical performance, weather patterns, airport congestion, seasonal factors, and airline-specific reliability. Powered by Claude (Anthropic).

Request

origin
string
required
IATA code of the departure airport.
dest
string
required
IATA code of the arrival airport.
airline
string
required
IATA airline code.
date
string
required
Departure date in YYYY-MM-DD format.
api_key
string
required
Your API key.

Response

origin
string
IATA code of the departure airport.
destination
string
IATA code of the arrival airport.
airline
string
IATA airline code.
date
string
Requested departure date.
score
integer
Risk Score (same as /api/score).
explanation
string
Full AI-generated explanation of the risk drivers. Typically 2–4 sentences covering historical performance, seasonal context, and notable factors.
drivers
array
Structured list of the main risk factors identified by the model.

Example

curl "https://app.airrating.io/api/explain?origin=FCO&dest=LHR&airline=AZ&date=2026-04-10&api_key=YOUR_API_KEY"
Response
{
  "origin": "FCO",
  "destination": "LHR",
  "airline": "AZ",
  "date": "2026-04-10",
  "score": 62,
  "explanation": "ITA Airways on the Rome Fiumicino → London Heathrow route has a historical delay rate of 31%, which is above the European average of 27%. April sees elevated congestion at Heathrow due to school holiday traffic. The ML model assigns a 38% probability of delay exceeding 30 minutes, with high confidence based on 312 recorded flights. The main risk factors are historical airline performance and destination airport congestion.",
  "drivers": [
    {
      "factor": "historical_delay_rate",
      "contribution": "high",
      "detail": "31% of flights on this route/airline delayed > 30 min historically"
    },
    {
      "factor": "airport_congestion",
      "contribution": "medium",
      "detail": "Heathrow ranks in the top 20% for congestion in April"
    },
    {
      "factor": "weather",
      "contribution": "low",
      "detail": "No significant weather events forecast for the route"
    }
  ]
}
The /api/score endpoint already includes a short explanation field. Use /api/explain when you need the full breakdown with structured drivers.