METARs
GET/api/v1/metars/batchStudent Pilot

Get Metars Batch

Gets the most recent METAR observations for multiple airports in a single request. Accepts ICAO codes or FAA identifiers. Identifiers that don't resolve to a METAR are silently skipped.

Code Examples

curl \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://api.preflightapi.io/api/v1/metars/batch?ids=value"

Description

Both ICAO codes and FAA identifiers can be mixed in the same request. Maximum 100 identifiers per request.

GET /api/v1/metars/batch?ids=KDFW,KAUS,KHOU
GET /api/v1/metars/batch?ids=DFW,AUS

Parameters

NameInTypeDescription
idsquerystringComma-separated ICAO codes or FAA identifiers (e.g., KDFW,KAUS,KHOU). Maximum 100.

Response Schema

200Returns the METAR observations
idinteger

Database identifier.

rawTextstringnullable

Raw METAR text string as received from the source.

stationIdstringnullable

ICAO station identifier (e.g., KDFW).

observationTimestringnullable

Observation time in ISO 8601 format.

latitudenumbernullable

Station latitude in decimal degrees (WGS 84).

longitudenumbernullable

Station longitude in decimal degrees (WGS 84).

tempCnumbernullable

Temperature in degrees Celsius.

dewpointCnumbernullable

Dewpoint temperature in degrees Celsius.

windDirDegreesstringnullable

Wind direction in degrees true, or "VRB" for variable.

windSpeedKtintegernullable

Wind speed in knots.

windGustKtintegernullable

Wind gust speed in knots.

visibilityStatuteMistringnullable

Visibility in statute miles.

altimInHgnumbernullable

Altimeter setting in inches of mercury.

seaLevelPressureMbnumbernullable

Sea level pressure in millibars. ex: 1016.2

wxStringstringnullable

Present weather string (e.g., "-RA" for light rain).

flightCategoryFlightCategorynullable

Flight category: VFR, MVFR, IFR, or LIFR.

threeHrPressureTendencyMbnumbernullable

Three-hour pressure tendency in millibars.

maxTCnumbernullable

Maximum temperature in degrees Celsius.

minTCnumbernullable

Minimum temperature in degrees Celsius.

maxT24hrCnumbernullable

Maximum temperature over the past 24 hours in degrees Celsius.

minT24hrCnumbernullable

Minimum temperature over the past 24 hours in degrees Celsius.

precipInnumbernullable

Precipitation accumulation in inches since the last routine observation.

pcp3hrInnumbernullable

Precipitation accumulation in inches over the past 3 hours.

pcp6hrInnumbernullable

Precipitation accumulation in inches over the past 6 hours.

pcp24hrInnumbernullable

Precipitation accumulation in inches over the past 24 hours.

snowInnumbernullable

Snow depth in inches.

vertVisFtintegernullable

Vertical visibility in feet AGL.

metarTypestringnullable

Type of encoding: METAR or SPECI.

elevationMnumbernullable

Station elevation in meters MSL.

400If the ids parameter is empty or exceeds 100 identifiersApiErrorResponse
codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

Search Documentation

Search docs, endpoints, and schemas