How is the Weather Forecast Point API used?

An overview of the Weather Forecast Point API endpoint and JSON data output.

Example Input:

https://api.wx.spire.com/forecast/point?lat=24.134870&lon=-146.222321&bundle=maritime

Output (JSON):

JSON is a standard text format used by many APIs. It is not specific to weather. In fact, JSON is the same format returned by Spire Maritime’s Vessels API and Messages API. As seen below, JSON text data can be read by humans directly. However, in practice, users will write custom code to process and analyze the data or to display it in applications with maps, graphs, etc.

Below is a shortened sample of the JSON response returned by the API request at the top of this page.

Line breaks have been added to help show the data structure:

{"meta":{"unit_system":"si","forecast":"Spire Operational Forecast"},"data":[



{"location":{"coordinates":{"lat":24.13487,"lon":-146.222321}},"times":{"issuance_time":"2020-03-09T00:00:00+00:00",

"valid_time":"2020-03-09T00:00:00+00:00"},"values":{"sea_surface_temperature":295.42919921875,"sea_surface_wave_significant_height":2.90417003631592,

"eastward_sea_water_velocity":0.00487804412841797,"northward_sea_water_velocity":0.0469294786453247}},



{"location":{"coordinates":{"lat":24.13487,"lon":-146.222321}},"times":{"issuance_time":"2020-03-09T00:00:00+00:00",

"valid_time":"2020-03-09T01:00:00+00:00"},"values":{"sea_surface_temperature":295.430419921875,"sea_surface_wave_significant_height":3.04699802398682,

"eastward_sea_water_velocity":0.000545501708984375,"northward_sea_water_velocity":0.0431367158889771}},



{"location":{"coordinates":{"lat":24.13487,"lon":-146.222321}},"times":{"issuance_time":"2020-03-09T00:00:00+00:00",

"valid_time":"2020-03-09T02:00:00+00:00"},"values":{"sea_surface_temperature":295.4296875,"sea_surface_wave_significant_height":3.17785358428955,

"eastward_sea_water_velocity":-0.00501251220703125,"northward_sea_water_velocity":0.0394898653030396}},

…and so on for each distinct valid_time in the requested forecast (24 hours if short range, 7 days if medium range). All time values are in Coordinated Universal Time (UTC).

 

Spire issues 4 short range forecasts (00:00,  06:00,  12:00,  18:00) and 2 medium range (00:00,  12:00) per day. As a result, a full API response will actually return more forecast data than the snippet included above. This can be seen in the video at the bottom of this page.

 

The following video shows the same exact Point API request being made two times in a row. The second time, the output JSON text is formatted (using the jq command-line tool) to make it clear that the data is structured in a hierarchical set of key and value pairs.

 

Weather-Point-API-cURL-usage