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

getHurricanesCount

getHurricanesCount(): Promise<HttpPayload<ActiveStormCountPayload>>

Returns http promise for active hurricanes count

Returns

Promise<HttpPayload<ActiveStormCountPayload>>


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
idstring

Returns

string


getPointForecastData

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

Gets point forecast data 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
latLonStepInterpolateT-
pointForecastOptions?Record<string, string>Additional options of point forecast API
httpOptions?HttpOptionsAdditional HTTP options

Returns

Promise<HttpPayload<WeatherDataPayload<DataHash>>>

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