@squawk
    Preparing search index...
    • Fetches METARs from the Aviation Weather Center text API and parses each record. Partial failures (a single malformed METAR) are surfaced via the parseErrors field rather than thrown; network-level errors and non-2xx HTTP responses throw.

      import { fetchMetar } from '@squawk/weather/fetch';

      const { metars } = await fetchMetar('KJFK');
      console.log(metars[0]?.stationId); // "KJFK"

      Multiple stations are comma-joined into a single request:

      const { metars } = await fetchMetar(['KJFK', 'KLAX', 'KORD']);
      

      Parameters

      • ids: string | string[]

        A single ICAO station identifier or an array of identifiers.

      • options: FetchWeatherOptions = {}

        Optional abort signal and base URL override.

      Returns Promise<FetchMetarResult>

      The parsed METARs, any per-record parse errors, and the raw body.