Error handling

Production TTLs: Caching & monitoring. Platform errors: Error Handling.

NOTAMs

GET /notams/{icao} returns 200 with notams: [] when no active notices apply — not an error. Three-letter US codes are normalized (JFK → KJFK).

Filter on scope and type client-side; the API returns all active notices for the location.

FAA delays

total_alerts: 0 with an optional message string is a valid "no active programs" response. Coverage is US FAA NAS only — international airports will not appear here.

import os

import requests

HEADERS = {
    "X-RapidAPI-Key": os.getenv("RAPIDAPI_KEY", "YOUR_RAPIDAPI_KEY"),
    "X-RapidAPI-Host": "skylink-api.p.rapidapi.com",
}
BASE = "https://skylink-api.p.rapidapi.com"


def fetch_notams(icao: str) -> list[dict]:
    r = requests.get(f"{BASE}/notams/{icao}", headers=HEADERS, timeout=(10, 15))
    r.raise_for_status()
    return r.json().get("notams") or []


def fetch_faa_delays() -> dict:
    r = requests.get(f"{BASE}/delays/faa", headers=HEADERS, timeout=(10, 15))
    r.raise_for_status()
    return r.json()


if __name__ == "__main__":
    notams = fetch_notams("KJFK")
    print(f"KJFK NOTAMs: {len(notams)} active")

    delays = fetch_faa_delays()
    total = delays.get("total_alerts", 0)
    if total == 0:
        print("No active FAA delay programs nationwide.")
    else:
        print(f"Active FAA alerts: {total}")

Related: NOTAMs · FAA delays · Caching & monitoring

On this page