Getting Started

Get up and running with PreflightAPI in under 2 minutes. By the end of this guide you'll have made your first API call and received live METAR data.

New to aviation data?

METAR — Hourly weather observation for an airport (wind, visibility, clouds, temp). TAF — Terminal forecast covering the next 24-30 hours. ICAO code — 4-letter airport identifier (e.g., KJFK for JFK International). NOTAM — Notice to Air Missions: alerts about closed runways, airspace restrictions, etc.

1. Sign Up & Get Your API Key

Create a free account at preflightapi.io/sign-up — no credit card required. You'll start on the Student Pilot plan with 5,000 API calls per month.

After signing in, go to the API Keys page and copy either your primary or secondary key. Both work identically — having two lets you rotate without downtime.

Keep your API key secret. Never embed it in client-side code or commit it to a public repository. See the authentication guide for best practices.

2. Make Your First Request

Include your API key in the Ocp-Apim-Subscription-Key header. Let's fetch the current METAR for JFK International:

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://api.preflightapi.io/api/v1/metars/KJFK"

A successful response returns the current METAR observation:

{
  "stationId": "KJFK",
  "observationTime": "2026-01-15T14:56:00Z",
  "rawText": "KJFK 151456Z 31012KT 10SM FEW250 M04/M18 A3042 RMK AO2 SLP308 T10441183",
  "tempC": -4.4,
  "dewpointC": -18.3,
  "windDirDegrees": "310",
  "windSpeedKt": 12,
  "windGustKt": null,
  "visibilityStatuteMi": "10",
  "altimInHg": 30.42,
  "seaLevelPressureMb": 1030.8,
  "flightCategory": "VFR",
  "skyCondition": [
    { "skyCover": "FEW", "cloudBaseFtAgl": 25000 }
  ],
  "wxString": null
}

Key fields to know

flightCategory
VFR, MVFR, IFR, or LIFR — a quick go/no-go indicator based on visibility and ceiling.
rawText
The original encoded METAR string. Useful for display to pilots who prefer the raw format.
windSpeedKt
Sustained wind speed in knots. Combine with windDirDegrees to calculate crosswind.
skyCondition
Cloud layers with coverage (FEW, SCT, BKN, OVC) and base height in feet AGL.

Tip

Single-resource endpoints return the object directly. Collection endpoints use a paginated wrapper with data and pagination fields. See the API overview for pagination details.

3. Explore the API

Now that you've made your first request, explore the full range of aviation data available:

Tip

You can also explore without writing code — import our OpenAPI spec into Postman, Insomnia, or any OpenAPI-compatible tool.

Need Help?

Check out the authentication guide, rate limits, and error handling reference, or contact us for support.

Search Documentation

Search docs, endpoints, and schemas