Object Loaders
Requests for data to the Xweather Weather API from within your application can be made using a series of object loaders. These loaders automatically handle requesting and parsing the responses and return object models back to your application, preventing you from having to worry about API response property/format changes, parsing the data and handling of storing the loaded responses.
You simply create an instance of one or more of the available object loaders, make the request with the necessary API parameters and your application will be notified once the framework has successfully loaded your requested data. All data will be returned to you as an array of object model that are tied to an object loader, allowing you to simply access properties on object models when using Xweather data throughout your application.
The following object loaders are currently available:
Object Loader | Description | Object Model | Callback Interface |
---|---|---|---|
AdvisoriesTask | Requests active weather advisories (watches/warnings) for a particular location. API Endpoint: alerts (opens in a new tab) | AdvisoriesResponse | AdvisoriesTaskCallback |
AirQualityTask | The Air Quality API endpoint provides current information for locations globally. Observed air quality will be interpolated data or specific station observation data depending on the query action. This endpoint includes the air quality index (AQI), category, dominant pollutant, and information for primary pollutants when available. API Endpoint: airquality (opens in a new tab) | AirQualityResponse | AirQualityTaskCallback |
CountriesTask | Requests profile data for countries, including the full name, abbreviations, capital, population area, and neighboring countries. API Endpoint: countries (opens in a new tab) | CountriesResponse | CountriesTaskCallback |
EarthquakesTask | Requests recent earthquake data globally. API Endpoint: earthquakes (opens in a new tab) | EarthquakesResponse | EarthquakesTaskCallback |
FiresTask | Requests active wildfire data near a particular location or within a defined region. API Endpoint: fires (opens in a new tab) | FiresResponse | FiresTaskCallback |
ForecastsTask | Requests extended forecast information for a particular location, extending out to 15 days. API Endpoint: forecasts (opens in a new tab) | ForecastsResponse | ForecastsTaskCallback |
MoonphasesTask | Requests moon phase calendar information, such as the next full, new and quarter moon phases. API Endpoint: sunmoon/moonphases (opens in a new tab) | MoonphasesResponse | MoonphasesTaskCallback |
NormalsStationsTask | The stations that normals are derived from. API Endpoint: normals/stations (opens in a new tab) | NormStationsResponse | NormalsStationsTaskCallback |
NormalsTask | Requests daily climate normals for a station or close to a particular location, such as normal max/min temperature, normal precipitation and normal snowfall. API Endpoint: normals (opens in a new tab) | NormalsResponse | NormalsTaskCallback |
ObservationsArchiveTask | Request all observations for a station that were reported on a given day. API Endpoint: observations/archive (opens in a new tab) | ObArchiveResponse | ObservationsArchiveTaskCallback |
ObservationsSummaryTask | The observations/summary endpoint provides access to daily summaries based on received observations. API Endpoint: observations/summary (opens in a new tab) | ObSummaryResponse | ObservationsSummaryTaskCallback |
ObservationsTask | Requests weather observations for a particular location. API Endpoint: observations (opens in a new tab) | ObservationResponse | ObservationsTaskCallback |
PlacesAirportsTask | Requests information for airports. API Endpoint: places/airports (opens in a new tab) | PlacesAirportsResponse | PlacesAirportsTaskCallback |
PlacesPostalcodesTask | Requests information about particular US and Canadian Postal Codes. API Endpoint: places/postalcodes (opens in a new tab) | PostalcodesResponse | PlacesPostalcodesTaskCallback |
PlacesTask | Requests information about a particular location, such as latitude/longitude position, population, zip codes, alternate names, timezone, elevation, etc. API Endpoint: places (opens in a new tab) | PlacesResponse | PlacesTaskCallback |
RiversGaugesTask | The rivers/gauges endpoint provides access to enhanced information for the river and lake gauges utilized within the rivers endpoint. The primary source the gauge information is the NOAA Advanced Hydrologic Prediction Service (AHPS). Gauge information will include location information and when available recent crests, historical crests and flood impacts. ***Although listed as RiversGaugesTask, this endpoint uses the RiverTask class, the RiversResponse model and the RiversTaskCallback class. The same response is returned, except when the gauges endpoint is called the additional details will be provided as listed in the river/gauges endpoint documentation.*** API Endpoint: rivers/gauges (opens in a new tab) | RiversResponse | RiversTaskCallback |
RiversTask | The rivers endpoint provides access to the latest river and lakes gauge observations. The primary source of this gauge observations is the NOAA Advanced Hydrologic Prediction Service (AHPS). The gauge observations include information on the current water level or flow, flood stages, and low water thresholds. API Endpoint: rivers (opens in a new tab) | RiversResponse | RiversTaskCallback |
StormCellsTask | Requests storm cell observation and forecast data near a particular location or within a defined region. API Endpoint: stormcells (opens in a new tab) | StormCellResponse | StormCellsTaskCallback |
StormReportsTask | Requests severe storm report data, such as rainfall totals, wind damage and hail reports, near a particular location or within a defined region. API Endpoint: stormreports (opens in a new tab) | StormReportsResponse | StormReportsTaskCallback |
SunmoonTask | Requests solar and lunar information for a particular place and time frame, such as sunrise/set, twilight, moon rise/set and moon phase. API Endpoint: sunmoon (opens in a new tab) | SunmoonResponse | SunmoonTaskCallback |
TidesStationsTask | Request information on tidal observation locations. API Endpoint: tides/stations (opens in a new tab) | TideStationsResponse | TidesStationsTaskCallback |
TidesTask | Requests tide forecast information for a specific station or for stations closest to a location. API Endpoint: tides (opens in a new tab) | TidesResponse | TidesTaskCallback |
TropicalCyclonesTask | The tropicalcyclones endpoint provides access to information on the active tropical cyclones, such as invests, tropical depressions, tropical storms, hurricanes, and typhoons, across the globe. Includes information on an individual storms name, position, historical track and forecasts. The tropical API information is based on data from the National Hurricane Center (NHC), Central Pacific Hurricane Center (CPHC), and the Joint Typhoon Warning Center (JTWC). API Endpoint: tropicalcyclones (opens in a new tab) | TropicalCyclonesResponse | TropicalCyclonesTask |