# checkFlightDelays

**Identifier:** `aviationstack_checkFlightDelays`

**Provider:** [Aviationstack](https://kirha.com/providers/aviationstack.md)

Check if a flight is delayed and get detailed delay information for both departure and arrival.

## Run it with the CLI

```bash
kirha tools run aviationstack_checkFlightDelays \
  --input '{
    "flightIdentifier": "1004"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "aviationstack_checkFlightDelays",
  "input": {
    "flightIdentifier": "1004"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "arrivalAirport": {
      "description": "Arrival airport IATA code (e.g., 'LAX') to narrow down search results.",
      "type": "string"
    },
    "departureAirport": {
      "description": "Departure airport IATA code (e.g., 'SFO') to narrow down search results.",
      "type": "string"
    },
    "flightDate": {
      "description": "Flight date in YYYY-MM-DD format. Defaults to today if not provided.",
      "type": "string"
    },
    "flightIdentifier": {
      "description": "Flight identifier: can be a flight number (e.g., '1004'), IATA code (e.g., 'AA1004'), or ICAO code (e.g., 'AAL1004').",
      "type": "string"
    },
    "nearHour": {
      "description": "Approximate departure time in HH:mm format (e.g., '14:30') to find the closest matching flight. If not provided, returns the most recent flight.",
      "type": "string"
    }
  },
  "required": [
    "flightIdentifier"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "arrivalDelay": {
      "additionalProperties": false,
      "properties": {
        "actualTime": {
          "type": "string"
        },
        "airportIata": {
          "type": "string"
        },
        "airportName": {
          "type": "string"
        },
        "delayMinutes": {
          "type": "number"
        },
        "estimatedTime": {
          "type": "string"
        },
        "scheduledTime": {
          "type": "string"
        }
      },
      "required": [
        "delayMinutes",
        "airportName"
      ],
      "type": "object"
    },
    "context": {
      "type": "string"
    },
    "departureDelay": {
      "additionalProperties": false,
      "properties": {
        "actualTime": {
          "type": "string"
        },
        "airportIata": {
          "type": "string"
        },
        "airportName": {
          "type": "string"
        },
        "delayMinutes": {
          "type": "number"
        },
        "estimatedTime": {
          "type": "string"
        },
        "scheduledTime": {
          "type": "string"
        }
      },
      "required": [
        "delayMinutes",
        "airportName"
      ],
      "type": "object"
    },
    "flightIata": {
      "type": "string"
    },
    "flightNumber": {
      "type": "string"
    },
    "flightStatus": {
      "enum": [
        "scheduled",
        "active",
        "landed",
        "cancelled",
        "incident",
        "diverted"
      ],
      "type": "string"
    },
    "isDelayed": {
      "type": "boolean"
    },
    "totalDelayMinutes": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "flightNumber",
    "isDelayed",
    "totalDelayMinutes"
  ],
  "type": "object"
}
```

-----

[All Aviationstack tools](https://kirha.com/providers/aviationstack.md) · [< Back to tools list](https://kirha.com/tools.md)