git.orvira.onl OWAPI / master docs / README.md
master

Tree @master (Download .tar.gz)

README.md @masterview markup · raw · history · blame

OWAPI Wiki

OWAPI (Orvira's Weather API) is a simple, cache-focussed abstraction of the NWS's forecast API, as well as OpenStreetMap's Nominatim for address/city lookup in order to get latitude and longitude coordinates for NWS location lookup.

This wiki contains a simple explanation of the OWAPI routes. These routes can also be imported into Insomnia using the provided exports in docs/.

Reference

Status:

https://wapi.orvira.onl/

Example Return:

{
  "version": "1.0.4",
  "osmStatus": "OK",
  "nwsStatus": "OK",
  "sourceUrl": "https://github.com/orvira/OWAPI",
  "licenseUrl": "https://github.com/orvira/OWAPI/blob/master/LICENSE"
}

Latitude,Longitude Lookup:

https://wapi.orvira.onl/lookup/coordinates/[LATITUDE],[LONGITUDE]

Example Return:

{
  "forecastZone": "CAZ041",
  "officeId": "LOX",
  "office": {
    "id": "LOX",
    "name": "Los Angeles, CA",
    "phoneNumber": "805-988-6610",
    "email": "w-lox.webmaster@noaa.gov"
  },
  "gridX": 154,
  "gridY": 44,
  "latitude": 34.0536909,
  "longitude": -118.2427666
}

Address/City Lookup:

https://wapi.orvira.onl/lookup/address/[URL_ESCAPED_ADDRESS]

Example Return:

{
  "forecastZone": "NYZ072",
  "officeId": "OKX",
  "office": {
    "id": "OKX",
    "name": "New York, NY",
    "phoneNumber": "631-924-0517",
    "email": "okx.webmaster@noaa.gov"
  },
  "gridX": 32,
  "gridY": 34,
  "latitude": 40.7127281,
  "longitude": -74.0060152
}

Weather Forecast:

https://wapi.orvira.onl/forecast/[NWS_OFFICE]/[NWS_GRID_X],[NWS_GRID_Y]

Example Return:

[
  {
    "forecastPeriodId": 313,
    "forecastId": 3,
    "sortOrder": 1,
    "name": "This Afternoon",
    "startTime": "2020-07-09T00:00:00+00:00",
    "endTime": "2020-07-09T01:00:00+00:00",
    "isDayTime": true,
    "temperature": 84,
    "temperatureUnit": "F",
    "windSpeed": 5,
    "windSpeedUnit": "mph",
    "windDirection": "SW",
    "icon": "https://api.weather.gov/icons/land/day/skc?size=medium",
    "shortForecast": "Sunny",
    "detailedForecast": "Sunny, with a high near 84. Southwest wind around 5 mph."
  },
  ...
]

Hourly Weather Forecast:

https://wapi.orvira.onl/forecast/[NWS_OFFICE]/[NWS_GRID_X],[NWS_GRID_Y]/hourly

Example Return:

[
  {
    "forecastPeriodId": 1,
    "forecastId": 1,
    "sortOrder": 1,
    "name": "",
    "startTime": "2020-07-09T00:00:00+00:00",
    "endTime": "2020-07-09T01:00:00+00:00",
    "isDayTime": false,
    "temperature": 78,
    "temperatureUnit": "F",
    "windSpeed": 6,
    "windSpeedUnit": "mph",
    "windDirection": "S",
    "icon": "https://api.weather.gov/icons/land/night/bkn?size=small",
    "shortForecast": "Mostly Cloudy",
    "detailedForecast": ""
  },
  ...
]

NWS Alerts:

https://wapi.orvira.onl/alerts/[NWS_FORECAST_ZONE]

Example Return:

[
  {
    "id": "NWS-IDP-PROD-4315554-3620340",
    "forecastZone": "NYZ072",
    "effectiveOn": "2020-07-08T14:55:00+00:00",
    "expiresOn": "2020-07-08T23:00:00+00:00",
    "messageType": "Alert",
    "category": "Met",
    "severity": "Moderate",
    "certainty": "Likely",
    "urgency": "Expected",
    "event": "Heat Advisory",
    "senderName": "NWS Upton NY",
    "headline": "Heat Advisory issued July 8 at 10:55AM EDT until July 9 at 6:00PM EDT by NWS Upton NY",
    "description": "* WHAT...Heat index values up to 96 expected.\n\n* WHERE...New York (Manhattan), Bronx, Richmond (Staten Island),\nKings (Brooklyn), Northern Queens and Southern Queens Counties.\n\n* WHEN...From noon today to 6 PM EDT Thursday.\n\n* IMPACTS...Hot temperatures and high humidity may cause heat\nillnesses to occur."
  },
  ...
]