Skip to content

@windy/fetch

Basic HTTP requests for getting URLs of our backend services or fetching data from Windy API. Although it works as wrapper around our http module, it ensures standardized way of fetching data.

Table of contents

Functions

Functions

getCapAlertsSummary

getCapAlertsSummary(«destructured»): Promise<HttpPayload<CapAlertHeadline[]>>

Returns loading promise for cap alert headlines

Parameters

NameType
«destructured»LatLon

Returns

Promise<HttpPayload<CapAlertHeadline[]>>


getHurricanesCount

getHurricanesCount(): Promise<HttpPayload<ActiveStormCountPayload>>

Returns

Promise<HttpPayload<ActiveStormCountPayload>>


getHurricanesList

getHurricanesList(): Promise<HttpPayload<StormListJSON>>

Returns

Promise<HttpPayload<StormListJSON>>


getMeteogramForecastData

getMeteogramForecastData<T>(model, latLonStep, pointForecastOptions?, httpOptions?): Promise<HttpPayload<MeteogramDataPayload>>

Gets enhanced point forecast meteogram data for given location

Type parameters

NameType
Textends LatLonStep

Parameters

NameType
model"drought" | "radar" | "satellite" | "radarPlus" | "capAlerts" | "topoMap" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "icon" | "cams" | "efi" | "cmems" | "fireDanger" | "activeFires" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "mblue"
latLonStepT
pointForecastOptions?Record<string, string>
httpOptions?HttpOptions

Returns

Promise<HttpPayload<MeteogramDataPayload>>

Promise with HTTP payload


getMeteogramForecastUrl

getMeteogramForecastUrl<T>(model, «destructured», pointForecastOptions?): Promise<string>

Gets enhanced point forecast meteogram data for given location

Type parameters

NameType
Textends LatLonStep

Parameters

NameType
model"drought" | "radar" | "satellite" | "radarPlus" | "capAlerts" | "topoMap" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "icon" | "cams" | "efi" | "cmems" | "fireDanger" | "activeFires" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "mblue"
«destructured»T
pointForecastOptions?Record<string, string>

Returns

Promise<string>

Promise with HTTP payload


getObservationPoiUrl

getObservationPoiUrl(type, id): string

Get URL for getting observations for a specific station in node-poi server

Parameters

NameType
type"stations" | StationOrPoiType | "metars"
idstring

Returns

string


getPointForecastData

getPointForecastData<K, T>(model, latLonStepInterpolate, pointForecastOptions?, httpOptions?): Promise<HttpPayload<WeatherDataPayload<K>>>

Gets point forecast data for given location

Type parameters

NameType
Kextends DataHash | AirQDataHash = DataHash
Textends LatLonStep = LatLonStep

Parameters

NameTypeDescription
model"drought" | "radar" | "satellite" | "radarPlus" | "capAlerts" | "topoMap" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "icon" | "cams" | "efi" | "cmems" | "fireDanger" | "activeFires" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "mblue"Forecast model
latLonStepInterpolateT-
pointForecastOptions?Record<string, string>Additional options of point forecast API
httpOptions?HttpOptionsAdditional HTTP options

Returns

Promise<HttpPayload<WeatherDataPayload<K>>>

Promise with HTTP payload


getPointForecastUrl

getPointForecastUrl<T>(model, «destructured», pointForecastOptions?): Promise<string>

Gets point forecast data URL for given location

Type parameters

NameType
Textends LatLonStep

Parameters

NameTypeDescription
model"drought" | "radar" | "satellite" | "radarPlus" | "capAlerts" | "topoMap" | "gfs" | "ecmwf" | "ecmwfAnalysis" | "ecmwfWaves" | "gfsWaves" | "icon" | "cams" | "efi" | "cmems" | "fireDanger" | "activeFires" | "nems" | "namConus" | "namHawaii" | "namAlaska" | "iconEu" | "iconD2" | "arome" | "aromeAntilles" | "aromeFrance" | "aromeReunion" | "canHrdps" | "canRdwpsWaves" | "camsEu" | "czeAladin" | "iconEuWaves" | "hrrrAlaska" | "hrrrConus" | "bomAccess" | "bomAccessAd" | "bomAccessBn" | "bomAccessDn" | "bomAccessNq" | "bomAccessPh" | "bomAccessSy" | "bomAccessVt" | "ukv" | "jmaMsm" | "jmaCwmWaves" | "mblue"Forecast model
«destructured»T-
pointForecastOptions?Record<string, string>Additional options of point forecast API

Returns

Promise<string>

URL string for getting point forecast data


getRadarArchiveInfo

getRadarArchiveInfo(): Promise<HttpPayload<RadarMinifest>>

Returns

Promise<HttpPayload<RadarMinifest>>


getRadarCoverage

getRadarCoverage(): Promise<HttpPayload<number[]>>

Returns

Promise<HttpPayload<number[]>>


getRadarInfo

getRadarInfo(): Promise<HttpPayload<RadarMinifest>>

Loads Radar Product info

Returns

Promise<HttpPayload<RadarMinifest>>


getSatelliteArchiveInfo

getSatelliteArchiveInfo(): Promise<HttpPayload<SatelliteInfoJson>>

Returns

Promise<HttpPayload<SatelliteInfoJson>>


getSatelliteInfo

getSatelliteInfo(): Promise<HttpPayload<SatelliteInfoJson>>

Loads Satellite Product info

Returns

Promise<HttpPayload<SatelliteInfoJson>>


getStaticMapImageUrl

getStaticMapImageUrl(params): string

Returns URL for static map image. Max zoom level is 13

Parameters

NameType
paramsLatLon & { bounds?: `${number},${number},${number},$OSM{number}` ; size: number ; zoom: 4 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 }

Returns

string