/api/v1/metars/{icaoCodeOrIdent}Student PilotGet Metar For Airport
Gets the most recent METAR observation for a specific airport. Returns decoded weather data including wind, visibility, sky conditions, temperature, and flight category.
Code Examples
curl \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://api.preflightapi.io/api/v1/metars/KJFK"curl \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://api.preflightapi.io/api/v1/metars/KJFK"Description
GET /api/v1/metars/KDFW — by ICAO code
GET /api/v1/metars/DFW — by FAA identifierParameters
| Name | In | Type | Description |
|---|---|---|---|
| icaoCodeOrIdent* | path | string | ICAO code or FAA identifier (e.g., KDFW, DFW). Case-insensitive. |
Response Schema
Database identifier.
Raw METAR text string as received from the source.
ICAO station identifier (e.g., KDFW).
Observation time in ISO 8601 format.
Station latitude in decimal degrees (WGS 84).
Station longitude in decimal degrees (WGS 84).
Temperature in degrees Celsius.
Dewpoint temperature in degrees Celsius.
Wind direction in degrees true, or "VRB" for variable.
Wind speed in knots.
Wind gust speed in knots.
Visibility in statute miles.
Altimeter setting in inches of mercury.
Sea level pressure in millibars. ex: 1016.2
Present weather string (e.g., "-RA" for light rain).
Three-hour pressure tendency in millibars.
Maximum temperature in degrees Celsius.
Minimum temperature in degrees Celsius.
Maximum temperature over the past 24 hours in degrees Celsius.
Minimum temperature over the past 24 hours in degrees Celsius.
Precipitation accumulation in inches since the last routine observation.
Precipitation accumulation in inches over the past 3 hours.
Precipitation accumulation in inches over the past 6 hours.
Precipitation accumulation in inches over the past 24 hours.
Snow depth in inches.
Vertical visibility in feet AGL.
Type of encoding: METAR or SPECI.
Station elevation in meters MSL.
Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").
Human-readable error message suitable for display.
Additional error details (only included in development environment).
Name of the external service that failed (only included for 503 errors).
Field-level validation errors (only for validation failures).
UTC timestamp when the error occurred.
Correlation ID for tracing the request.
Request path that generated the error.