the_paragliding_app

Aviation Weather Center API Integration (METAR Format)

API Endpoint

https://aviationweather.gov/api/data/metar

Request Format

curl -s "https://aviationweather.gov/api/data/metar?bbox={minLat},{minLon},{maxLat},{maxLon}&format=json" \
  -H "Accept: application/json" \
  -H "User-Agent: TheParaglidingApp/1.0"

Parameters

Example

# Get METAR stations near Annecy (45.9°N, 6.1°E)
curl -s "https://aviationweather.gov/api/data/metar?bbox=45.5,5.7,46.3,6.5&format=json"

Response Format

Returns JSON array of station objects:

[
  {
    "icaoId": "LFLP",
    "name": "Annecy/Meythet Arpt, AR, FR",
    "lat": 45.93,
    "lon": 6.106,
    "elev": 460,
    "reportTime": "2025-10-03T22:00:00.000Z",
    "wdir": 70,      // Wind direction in degrees (0-360)
    "wspd": 4,       // Wind speed in knots
    "temp": 11,      // Temperature in Celsius
    "dewp": 9,       // Dew point in Celsius
    "visib": "6+",   // Visibility in miles ("6+" means 6+ miles)
    "altim": 1020,   // Altimeter setting in hPa
    "cover": "CAVOK", // Cloud cover summary
    "fltCat": "VFR"  // Flight category
  }
]

Extracting Wind Data

Wind Direction (wdir)

Wind Speed (wspd)

Wind Gust (wgst)

Example Extraction

final response = await http.get(Uri.parse(url));
final List<dynamic> stations = json.decode(response.body);

for (final station in stations) {
  final windDir = station['wdir'];      // null if calm
  final windSpeed = station['wspd'];    // null if calm
  final windGust = station['wgst'];     // null if no gusts
  final stationName = station['name'];

  if (windDir != null && windSpeed != null) {
    final gustStr = windGust != null ? ' gusting ${windGust}kt' : '';
    print('$stationName: ${windSpeed}kt from ${windDir}°$gustStr');
  }
}

Key Fields Reference

Field Type Units Description
icaoId String - ICAO station identifier
name String - Station name and location
lat Double degrees Latitude
lon Double degrees Longitude
elev Integer meters Elevation
wdir Integer degrees Wind direction (0-360)
wspd Integer knots Wind speed
wgst Integer knots Wind gust (only present if gusts reported)
temp Integer °C Temperature
altim Integer hPa QNH pressure
fltCat String - VFR/MVFR/IFR/LIFR

Notes