### Gribstream API CSV Response Example Source: https://gribstream.com/docs Example response data in CSV format. Note that the response is not strictly in order. ```csv forecasted_at,forecasted_time,lat,lon,name,uwind,vwind,wind_direction,wind_magnitude 2024-09-10T02:00:00Z,2024-09-10T03:00:00Z,40.7306,-73.9352,New York City,7.1213,1.7680,256,7.3375 2024-09-10T05:00:00Z,2024-09-10T08:00:00Z,40.7306,-73.9352,New York City,5.2585,-1.1512,282,5.3831 2024-09-10T01:00:00Z,2024-09-10T02:00:00Z,40.7306,-73.9352,New York City,8.1815,1.6363,258,8.3435 2024-09-10T05:00:00Z,2024-09-10T07:00:00Z,40.7306,-73.9352,New York City,6.9156,-1.4414,281,7.0642 2024-09-10T00:00:00Z,2024-09-10T01:00:00Z,40.7306,-73.9352,New York City,8.0572,2.9389,249,8.5765 2024-09-10T03:00:00Z,2024-09-10T04:00:00Z,40.7306,-73.9352,New York City,6.4841,2.5385,248,6.9633 2024-09-10T05:00:00Z,2024-09-10T06:00:00Z,40.7306,-73.9352,New York City,6.8368,0.1001,269,6.8375 2024-09-10T04:00:00Z,2024-09-10T05:00:00Z,40.7306,-73.9352,New York City,6.4087,3.0921,244,7.1157 2024-09-09T23:00:00Z,2024-09-10T00:00:00Z,40.7306,-73.9352,New York City,6.1795,3.9539,237,7.3362 2024-09-10T05:00:00Z,2024-09-10T09:00:00Z,40.7306,-73.9352,New York City,4.7715,-0.5644,276,4.8047 ``` -------------------------------- ### JSON Response Example (JSON Array) Source: https://gribstream.com/docs This snippet shows an example of a JSON array response from the Gribstream API, containing multiple weather forecast data points for a specific location. ```json [{"forecasted_at":"2024-09-10T02:00:00Z","forecasted_time":"2024-09-10T03:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.121286392211914,"vwind":1.7680130004882812,"wind_direction":256,"wind_magnitude":7.337478439477567} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T01:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.057228088378906,"vwind":2.938892364501953,"wind_direction":249,"wind_magnitude":8.576480210336284} ,{"forecasted_at":"2024-09-10T01:00:00Z","forecasted_time":"2024-09-10T02:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.181510925292969,"vwind":1.6362571716308594,"wind_direction":258,"wind_magnitude":8.34352794400556} ,{"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T06:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.836750030517578,"vwind":0.10012435913085938,"wind_direction":269,"wind_magnitude":6.837483152964509} ,{"forecasted_at":"2024-09-09T23:00:00Z","forecasted_time":"2024-09-10T00:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.179473876953125,"vwind":3.953920364379883,"wind_direction":237,"wind_magnitude":7.33616954846356} ,{"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T07:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.915561676025391,"vwind":-1.4414329528808594,"wind_direction":281,"wind_magnitude":7.064185887458082} ,{"forecasted_at":"2024-09-10T03:00:00Z","forecasted_time":"2024-09-10T04:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.484088897705078,"vwind":2.538473129272461,"wind_direction":248,"wind_magnitude":6.963279016482147} ,{"forecasted_at":"2024-09-10T04:00:00Z","forecasted_time":"2024-09-10T05:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.408748626708984,"vwind":3.0920562744140625,"wind_direction":244,"wind_magnitude":7.115677828885149} ,{"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T08:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":5.258523941040039,"vwind":-1.1512451171875,"wind_direction":282,"wind_magnitude":5.383069696589422} ,{"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T09:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":4.771465301513672,"vwind":-0.564422607421875,"wind_direction":276,"wind_magnitude":4.804732459078015} ] ``` -------------------------------- ### JSON Response Example (JSON Array) Source: https://gribstream.com/docs This snippet shows an example of a JSON array response from the Gribstream API, containing forecasted weather data for a specific location. ```json [{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T09:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.078826904296875,"vwind":2.4223251342773438,"wind_direction":251,"wind_magnitude":7.481807896300802} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T07:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.181903839111328,"vwind":2.596050262451172,"wind_direction":247,"wind_magnitude":6.704879718622265} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-11T09:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":-2.627544403076172,"vwind":-5.187816619873047,"wind_direction":26,"wind_magnitude":5.815275648803582} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T08:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.091346740722656,"vwind":2.6632766723632812,"wind_direction":249,"wind_magnitude":7.5749746686515245} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T04:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.889509201049805,"vwind":2.7773094177246094,"wind_direction":248,"wind_magnitude":7.428242364996697} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T03:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.226800918579102,"vwind":1.7029743194580078,"wind_direction":256,"wind_magnitude":7.424740604863526} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T10:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.271799087524414,"vwind":0.5646705627441406,"wind_direction":265,"wind_magnitude":7.2936900683913555} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T12:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":4.783409118652344,"vwind":-4.369564056396484,"wind_direction":312,"wind_magnitude":6.4787416092446914} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T05:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.676166534423828,"vwind":2.414224624633789,"wind_direction":252,"wind_magnitude":8.046863563053401} ,{"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T01:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.057228088378906,"vwind":2.938892364501953,"wind_direction":249,"wind_magnitude":8.576480210336284} ... ] ``` -------------------------------- ### CSV Response Example Source: https://gribstream.com/docs This is an example of a forecast data response formatted as CSV. Note that the response data may not be strictly in order. ```CSV forecasted_at,forecasted_time,lat,lon,name,uwind,vwind,wind_direction,wind_magnitude 2024-09-10T00:00:00Z,2024-09-10T01:00:00Z,40.7306,-73.9352,New York City,8.0572,2.9389,249,8.5765 2024-09-10T00:00:00Z,2024-09-11T02:00:00Z,40.7306,-73.9352,New York City,2.3471,-5.2970,336,5.7937 2024-09-10T00:00:00Z,2024-09-10T03:00:00Z,40.7306,-73.9352,New York City,7.2268,1.7030,256,7.4247 2024-09-10T00:00:00Z,2024-09-11T06:00:00Z,40.7306,-73.9352,New York City,-2.9925,-5.0025,30,5.8292 2024-09-10T00:00:00Z,2024-09-11T07:00:00Z,40.7306,-73.9352,New York City,-2.9643,-4.9196,31,5.7437 2024-09-10T00:00:00Z,2024-09-10T12:00:00Z,40.7306,-73.9352,New York City,4.7834,-4.3696,312,6.4787 2024-09-10T00:00:00Z,2024-09-10T10:00:00Z,40.7306,-73.9352,New York City,7.2718,0.5647,265,7.2937 2024-09-10T00:00:00Z,2024-09-11T10:00:00Z,40.7306,-73.9352,New York City,-2.9361,-4.5728,32,5.4343 2024-09-10T00:00:00Z,2024-09-11T05:00:00Z,40.7306,-73.9352,New York City,-3.1221,-5.8816,27,6.6589 2024-09-10T00:00:00Z,2024-09-10T06:00:00Z,40.7306,-73.9352,New York City,6.6521,1.6799,255,6.8610 2024-09-10T00:00:00Z,2024-09-11T00:00:00Z,40.7306,-73.9352,New York City,3.2101,-3.3758,316,4.6584 2024-09-10T00:00:00Z,2024-09-10T11:00:00Z,40.7306,-73.9352,New York City,6.9390,-2.4367,289,7.3544 ... ``` -------------------------------- ### Authentication Header Example Source: https://gribstream.com/docs This snippet demonstrates how to include the authentication token in the Authorization header for API requests. ```http Authorization: Bearer ``` -------------------------------- ### NDJSON Response Example Source: https://gribstream.com/docs This snippet shows a sample response in NDJSON format, where each line is a valid JSON object representing forecast data for a specific time and location. ```json {"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T07:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.915561676025391,"vwind":-1.4414329528808594,"wind_direction":281,"wind_magnitude":7.064185887458082} {"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T08:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":5.258523941040039,"vwind":-1.1512451171875,"wind_direction":282,"wind_magnitude":5.383069696589422} {"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T09:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":4.771465301513672,"vwind":-0.564422607421875,"wind_direction":276,"wind_magnitude":4.804732459078015} {"forecasted_at":"2024-09-10T05:00:00Z","forecasted_time":"2024-09-10T06:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.836750030517578,"vwind":0.10012435913085938,"wind_direction":269,"wind_magnitude":6.837483152964509} {"forecasted_at":"2024-09-10T03:00:00Z","forecasted_time":"2024-09-10T04:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.484088897705078,"vwind":2.538473129272461,"wind_direction":248,"wind_magnitude":6.963279016482147} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T01:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.057228088378906,"vwind":2.938892364501953,"wind_direction":249,"wind_magnitude":8.576480210336284} {"forecasted_at":"2024-09-09T23:00:00Z","forecasted_time":"2024-09-10T00:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.179473876953125,"vwind":3.953920364379883,"wind_direction":237,"wind_magnitude":7.33616954846356} {"forecasted_at":"2024-09-10T01:00:00Z","forecasted_time":"2024-09-10T02:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.181510925292969,"vwind":1.6362571716308594,"wind_direction":258,"wind_magnitude":8.34352794400556} {"forecasted_at":"2024-09-10T04:00:00Z","forecasted_time":"2024-09-10T05:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.408748626708984,"vwind":3.0920562744140625,"wind_direction":244,"wind_magnitude":7.115677828885149} {"forecasted_at":"2024-09-10T02:00:00Z","forecasted_time":"2024-09-10T03:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.121286392211914,"vwind":1.7680130004882812,"wind_direction":256,"wind_magnitude":7.337478439477567} ``` -------------------------------- ### NDJSON Response Example Source: https://gribstream.com/docs This snippet shows a sample NDJSON response containing forecast data for a specific location. Each line represents a distinct forecast record. ```json {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T03:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":7.226800918579102,"vwind":1.7029743194580078,"wind_direction":256,"wind_magnitude":7.424740604863526} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T17:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":2.3053665161132812,"vwind":-3.231029510498047,"wind_direction":324,"wind_magnitude":3.969164455061737} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T19:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":1.7580318450927734,"vwind":-2.8487396240234375,"wind_direction":328,"wind_magnitude":3.3475354238366912} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T16:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":2.373655319213867,"vwind":-3.552021026611328,"wind_direction":326,"wind_magnitude":4.272129790622153} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T20:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":1.9354515075683594,"vwind":-2.271472930908203,"wind_direction":319,"wind_magnitude":2.9842187945922025} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T02:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":8.008834838867188,"vwind":1.1038799285888672,"wind_direction":262,"wind_magnitude":8.084552329782657} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T12:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":4.783409118652344,"vwind":-4.369564056396484,"wind_direction":312,"wind_magnitude":6.4787416092446914} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T04:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":6.889509201049805,"vwind":2.7773094177246094,"wind_direction":248,"wind_magnitude":7.428242364996697} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T13:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":2.683929443359375,"vwind":-4.015068054199219,"wind_direction":326,"wind_magnitude":4.829518478770162} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T18:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":1.8502693176269531,"vwind":-3.0554637908935547,"wind_direction":328,"wind_magnitude":3.5720240096076235} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-11T09:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":-2.627544403076172,"vwind":-5.187816619873047,"wind_direction":26,"wind_magnitude":5.815275648803582} {"forecasted_at":"2024-09-10T00:00:00Z","forecasted_time":"2024-09-10T14:00:00Z","lat":40.7306,"lon":-73.9352,"name":"New York City","uwind":1.9734878540039062,"vwind":-4.105434417724609,"wind_direction":334,"wind_magnitude":4.555134034047598}... ``` -------------------------------- ### Gribstream API Time Series Request Source: https://gribstream.com/docs Example POST request to the /api/v2/hrrr/timeseries endpoint. Includes parameters for time range, location, variables, and expressions. ```json { "fromTime": "2024-09-10T00:00:00Z", "untilTime": "2024-09-10T10:00:00Z", "asOf": "2024-09-10T05:00:00Z", "minLeadTime": "1h", "maxLeadTime": "48h", "coordinates": [{ "lat": 40.7306, "lon": -73.9352, "name": "New York City" }], "variables": [ { "name": "UGRD", "level": "1000 mb", "alias": "uwind" }, { "name": "VGRD", "level": "1000 mb", "alias": "vwind" } ], "expressions": [ { "expression": "func.Hypot(uwind, vwind)", "alias": "wind_magnitude" }, { "expression": "int(270 - func.Atan2(vwind, uwind) * 180 / 3.14159) % 360", "alias": "wind_direction" } ] } ``` -------------------------------- ### Timeseries Endpoint URL Source: https://gribstream.com/docs This is the base URL for the Timeseries Endpoint. Replace with the desired weather model. ```bash POST https://gribstream.com/api/v2//timeseries ``` -------------------------------- ### Runs Endpoint Source: https://gribstream.com/docs Retrieve all forecast runs during a time range, for a list of coordinates, for a list of weather parameters. Optionally filtering for a range of hours ahead (min/max horizons). ```APIDOC ## POST /api/v2//runs ### Description Retrieve all forecast runs during a time range, for a list of coordinates, for a list of weather parameters. Optionally filtering for a range of hours ahead (min/max horizons). ### Method POST ### Endpoint /api/v2//runs ### Parameters #### Path Parameters - **model** (string) - Required - The weather model to retrieve runs for. Available models include rap, gfs, gdas, nbm, and many others. #### Query Parameters - **startTime** (string) - Required - The start of the time range for forecast runs. - **endTime** (string) - Required - The end of the time range for forecast runs. - **minHorizon** (integer) - Optional - The minimum forecast horizon in hours. - **maxHorizon** (integer) - Optional - The maximum forecast horizon in hours. #### Request Body - **coordinates** (array) - Required - A list of coordinate objects, each with `lat` and `lon` properties. - **parameters** (array) - Required - A list of weather parameter strings. ### Request Example ```json { "coordinates": [ { "lat": 40.7128, "lon": -74.0060 }, { "lat": 34.0522, "lon": -118.2437 } ], "parameters": ["TMP:2 m above ground", "UGRD:10 m above ground"] } ``` ### Response #### Success Response (200) - **runs** (array) - A list of forecast run objects, each containing details about the run and its associated data. ``` -------------------------------- ### POST /api/v2/hrrr/runs Source: https://gribstream.com/docs Retrieves HRRR forecast data for a specified time range and location. The response format can be CSV, JSON, or NDJSON, and can be gzip-compressed. Custom expressions can be used to derive new variables. ```APIDOC ## POST /api/v2/hrrr/runs ### Description Retrieves HRRR forecast data for a specified time range and location. The response format can be CSV, JSON, or NDJSON, and can be gzip-compressed. Custom expressions can be used to derive new variables. ### Method POST ### Endpoint https://gribstream.com/api/v2/hrrr/runs ### Parameters #### Header Parameters - **Content-Type** (string) - Required - `application/json` - **Accept-Encoding** (string) - Optional - `gzip` - **Authorization** (string) - Required - `Bearer ` - **Accept** (string) - Optional - `text/csv`, `application/json`, or `application/ndjson` #### Request Body - **forecastedFrom** (string) - Required - The start time for the forecast data. - **forecastedUntil** (string) - Required - The end time for the forecast data. - **minLeadTime** (string) - Required - The minimum lead time for the forecast (e.g., "1h"). - **maxLeadTime** (string) - Required - The maximum lead time for the forecast (e.g., "48h"). - **coordinates** (array) - Required - An array of coordinate objects, each with `lat`, `lon`, and `name`. - **lat** (number) - Required - Latitude. - **lon** (number) - Required - Longitude. - **name** (string) - Required - Name of the location. - **variables** (array) - Optional - An array of variable objects to include in the forecast. - **name** (string) - Required - The name of the variable (e.g., "UGRD"). - **level** (string) - Required - The atmospheric level for the variable (e.g., "1000 mb"). - **alias** (string) - Optional - An alias for the variable. - **expressions** (array) - Optional - An array of expression objects to derive new variables. - **expression** (string) - Required - The expression to evaluate (e.g., "func.Hypot(uwind, vwind)"). - **alias** (string) - Required - An alias for the derived variable. ### Request Example ```json { "forecastedFrom": "2024-09-10T00:00:00Z", "forecastedUntil": "2024-09-10T00:00:00Z", "minLeadTime": "1h", "maxLeadTime": "48h", "coordinates": [{ "lat": 40.7306, "lon": -73.9352, "name": "New York City" }], "variables": [ { "name": "UGRD", "level": "1000 mb", "alias": "uwind" }, { "name": "VGRD", "level": "1000 mb", "alias": "vwind" } ], "expressions": [ { "expression": "func.Hypot(uwind, vwind)", "alias": "wind_magnitude" }, { "expression": "int(270 - func.Atan2(vwind, uwind) * 180 / 3.14159) % 360", "alias": "wind_direction" } ] } ``` ### Response #### Success Response The response format is determined by the `Accept` header. - **`Accept: text/csv`**: A CSV file containing the forecast data. - **`Accept: application/json`**: A single JSON array of objects. - **`Accept: application/ndjson`**: Newline-delimited JSON, with one JSON object per line. If `Accept-Encoding: gzip` is included, the response will be gzip-compressed. **NOTE**: The response is not strictly in-order. #### CSV Response Example ```csv forecasted_at,forecasted_time,lat,lon,name,uwind,vwind,wind_direction,wind_magnitude 2024-09-10T00:00:00Z,2024-09-10T01:00:00Z,40.7306,-73.9352,New York City,8.0572,2.9389,249,8.5765 2024-09-10T00:00:00Z,2024-09-11T02:00:00Z,40.7306,-73.9352,New York City,2.3471,-5.2970,336,5.7937 ... ``` #### JSON Response Example ```json [ { "forecasted_at": "2024-09-10T00:00:00Z", "forecasted_time": "2024-09-10T01:00:00Z", "lat": 40.7306, "lon": -73.9352, "name": "New York City", "uwind": 8.0572, "vwind": 2.9389, "wind_direction": 249, "wind_magnitude": 8.5765 }, { "forecasted_at": "2024-09-10T00:00:00Z", "forecasted_time": "2024-09-11T02:00:00Z", "lat": 40.7306, "lon": -73.9352, "name": "New York City", "uwind": 2.3471, "vwind": -5.2970, "wind_direction": 336, "wind_magnitude": 5.7937 } ] ``` #### NDJSON Response Example ```json { "forecasted_at": "2024-09-10T00:00:00Z", "forecasted_time": "2024-09-10T01:00:00Z", "lat": 40.7306, "lon": -73.9352, "name": "New York City", "uwind": 8.0572, "vwind": 2.9389, "wind_direction": 249, "wind_magnitude": 8.5765 } { "forecasted_at": "2024-09-10T00:00:00Z", "forecasted_time": "2024-09-11T02:00:00Z", "lat": 40.7306, "lon": -73.9352, "name": "New York City", "uwind": 2.3471, "vwind": -5.2970, "wind_direction": 336, "wind_magnitude": 5.7937 } ``` ``` -------------------------------- ### Gribstream API Request Structure Source: https://gribstream.com/docs This snippet details the structure of a request to the Gribstream API, including required headers and the various parameters that can be included in the request body. ```APIDOC ## Gribstream API Request Details ### Description This section describes the necessary request headers and the structure of the request body for interacting with the Gribstream API. It covers authentication, content negotiation, and the parameters for specifying forecast data retrieval. ### Request Headers | Header | Value | Comment | |------------------|-------------------------------------------|-----------------------------------------------| | `Content-Type` | `application/json` | Default and only valid value. | | `Accept` | `text/csv`, `application/json`, `application/ndjson` | Selects the response format. Defaults to `text/csv`. | | `Accept-Encoding`| `gzip` | Optional, recommended, for compressed response. | | `Authorization` | `Bearer ` | Replace `` with your authentication token. | ### Request Body Parameters The request body should be a JSON object with the following structure: | Parameter | Type | Description | Required | |---------------|-------------------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------------------| | `fromTime` | `string` (ISO 8601) | Start time of the forecast period. | Yes, either (fromTime, untilTime) or timesList | | `untilTime` | `string` (ISO 8601) | End time of the forecast period. | Yes, either (fromTime, untilTime) or timesList | | `timesList` | `array` of string (ISO 8601) | Explicit list of valid times to return; each value corresponds to `forecasted_time`. | Yes, either (fromTime, untilTime) or timesList | | `asOf`? | `string` (ISO 8601) | Model-run-time cutoff: only model runs generated at or before this timestamp are considered. | No | | `minLeadTime` | `string` (duration) | Minimum lead time (inclusive). Duration string like `"45m"` or `"18h"`. Takes precedence over `minHorizon`/`maxHorizon`. | No | | `maxLeadTime` | `string` (duration) | Maximum lead time (inclusive). Duration string like `"45m"` or `"18h"`. Takes precedence over `minHorizon`/`maxHorizon`. | No | | `minHorizon` | `integer` | **Deprecated** (use `minLeadTime`). Minimum lead time in hours (inclusive). | No | | `maxHorizon` | `integer` | **Deprecated** (use `maxLeadTime`). Maximum lead time in hours (inclusive). | No | | `coordinates` | `array` of `coordinate` | List of geographical coordinates. Optional when `grid` is provided; you may send both. | Yes — at least one of coordinates or grid must be supplied | | `grid` | `grid` object | Regular rectangular domain. The server returns every point within the bounds at the given spatial `step`. May be used together with `coordinates`. | Yes — at least one of coordinates or grid must be supplied | | `variables` | `array` of `variable` | List of weather variables to retrieve. | Yes | | `expressions`| `array` of `expression` | Server‑side calculated columns built from the variables you request. Each entry returns as its own column, using the supplied alias. See the documentation | No | | `filter` | `filter` object | Boolean filter applied after all `expressions` are evaluated. Must contain a single `expression` string. Rows for which the expression evaluates to `false` are omitted from the response. | No | | `members` | `array` of integer | For ensemble models (`gefsatmos`, `ifsenfo`, `ifswaef` …) this selects which ensemble members to include in the response. Example: `"members": [2,3,4]`. Defaults to `[0]`, returning only member 0, the control forecast. | No (ensemble models only) | **NOTE**: Selected time must be specified via range `(fromTime, untilTime)` or `timesList` ### Coordinate Object | Field | Type | Description | |-----------|-----------|---------------------------------| | `lat` | `float` | Latitude of the coordinate. | | `lon` | `float` | Longitude of the coordinate. | | `name`? | `string` | Optional name for the coordinate, which will be returned in the response to help identify the location. | ### Grid Object | Field | Type | Description | |-----------------|---------|-------------------------| | `minLatitude` | number | Southern edge (°N) | | `maxLatitude` | number | Northern edge (°N) | | `minLongitude` | number | Western edge (°E) | | `maxLongitude` | number | Eastern edge (°E) | | `step` | number | Resolution in decimal degrees | ### Variable Object The fields `name`, `level`, and `info` form the exact weather variable selector. Copy these values from the catalog or model page; they are API identifiers, not labels to translate. * Check the full list of available parameters per model. | Field | Type | Description | Required | |-------|---------|----------------------------------------------------------------------------------------------------------|----------| | `name`| `string`| Exact weather parameter code from the catalog (e.g., `"TMP"` for temperature). Do not translate it. | Yes | | `level`| `string`| Exact atmospheric or surface level from the catalog (e.g., `"2 m above ground"`). | Yes | | `info`| `string`| Exact differentiator used when the model has multiple parameters with the same `name` and `level`. Leave empty only when the catalog value is empty. | No | | `alias`?| `string`| Optional alias for the variable. If provided, this alias will be used as the column header in the response. | No | ### Expression Object | Field | Type | Description | Required | |------------|---------|----------------------------------------------------------------------------------------------------------|----------| | `expression`| `string`| Create calculated columns. All selected variables are addressable by their alias. See the documentation. | Yes | | `alias` | `string`| Column name used in the response for this calculated result. | Yes | ``` -------------------------------- ### POST Request to Runs Endpoint Source: https://gribstream.com/docs This snippet shows the base URL and HTTP method for querying the Runs Endpoint to retrieve forecast runs. You need to specify the model in the URL path. ```http POST https://gribstream.com/api/v2//runs ```