GnistAI GnistAI
Log in

Getting Started with AviationStack (Flight Status)

Live flight tracking — departures, arrivals, delays, and airport status.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Transport

Data source: AviationStack, OpenSky Network

Overview

AviationStack (Flight Status) wraps AviationStack, OpenSky Network, handling authentication, pagination, and rate limits for you. This tutorial covers all 5 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-aviationstack": {
      "url": "https://context.gnist.ai/mcp/aviationstack/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (5)

get_flight_status

Get the current status of a flight by IATA flight number. Args: flight_iata: IATA flight number, e.g. "BA123" or "SK451". date: Date in YYYY-MM-DD format. Defaults to today's flights. Returns: List of matching flights with status, gate, delay, and times. Requires AVIATIONSTACK_API_KEY to be configured.

ParameterTypeRequiredDescription
flight_iatastringrequiredIATA flight number, e.g. "BA123" or "SK451".
dateanyoptionalDate in YYYY-MM-DD format. Defaults to today's flights.
curl -X POST "https://context.gnist.ai/mcp/aviationstack/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_flight_status", "arguments": {"flight_iata": "BA123"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/aviationstack/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'flight_iata': 'BA123'}, 'name': 'get_flight_status'}},
)
print(resp.json())

search_flights

Search scheduled flights between two airports. Args: origin: Departure airport IATA code, e.g. "OSL" (Oslo) or "LHR" (London Heathrow). destination: Arrival airport IATA code, e.g. "JFK" (New York). date: Date in YYYY-MM-DD format. Defaults to today's flights. Returns: List of scheduled flights with flight numbers, times, and status. Requires AVIATIONSTACK_API_KEY to be configured.

ParameterTypeRequiredDescription
originstringrequiredDeparture airport IATA code, e.g. "OSL" (Oslo) or "LHR" (London Heathrow).
destinationstringrequiredArrival airport IATA code, e.g. "JFK" (New York).
dateanyoptionalDate in YYYY-MM-DD format. Defaults to today's flights.
curl -X POST "https://context.gnist.ai/mcp/aviationstack/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_flights", "arguments": {"origin": "OSL", "destination": "JFK"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/aviationstack/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'destination': 'JFK', 'origin': 'OSL'},
            'name': 'search_flights'}},
)
print(resp.json())

get_airport_departures

Get the live departure board for an airport. Args: airport_iata: Airport IATA code, e.g. "OSL" (Oslo Gardermoen) or "AMS" (Amsterdam Schiphol). window_hours: Hours ahead to include (1–12, default 2). Returns: List of upcoming departures with flight, destination, times, gate, and delay. Requires AVIATIONSTACK_API_KEY to be configured.

ParameterTypeRequiredDescription
airport_iatastringrequiredAirport IATA code, e.g. "OSL" (Oslo Gardermoen) or "AMS" (Amsterdam Schiphol).
window_hoursintegeroptionalHours ahead to include (1–12, default 2). (default: 2)
curl -X POST "https://context.gnist.ai/mcp/aviationstack/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_airport_departures", "arguments": {"airport_iata": "OSL"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/aviationstack/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'airport_iata': 'OSL'},
            'name': 'get_airport_departures'}},
)
print(resp.json())

get_aircraft_position

Get the live ADS-B position of an aircraft by ICAO 24-bit transponder address. The ICAO24 address is a 6-character hexadecimal string unique to each aircraft (e.g. "400f86" for a British Airways 777). It can be found on sites like Flightradar24 or OpenSky Explorer. Args: icao24: 6-character hex transponder address, e.g. "400f86". Returns: Live position with latitude, longitude, altitude, speed, and heading. Returns not_found: true if the aircraft is not currently transmitting. Uses OpenSky Network (free, no API key required).

ParameterTypeRequiredDescription
icao24stringrequired6-character hex transponder address, e.g. "400f86".
curl -X POST "https://context.gnist.ai/mcp/aviationstack/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_aircraft_position", "arguments": {"icao24": "400f86"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/aviationstack/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'icao24': '400f86'}, 'name': 'get_aircraft_position'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/aviationstack/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/aviationstack/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_flights to find items, then get_flight_status to get full details. This two-step pattern is common for exploring data before drilling down.

FAQ

What data does AviationStack (Flight Status) provide?

Live flight tracking — departures, arrivals, delays, and airport status. It exposes 5 tools: get_flight_status, search_flights, get_airport_departures, get_aircraft_position, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the AviationStack (Flight Status) API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials