Making Requests

The version number used by the Weather Route API resources refer to semantic major version (breaking) changes. Minor version changes (additions or bug fixes) will be applied opaquely to the same major version resource endpoints.
When you are consuming from the API, build your consumers to adapt to the release of added functionality. This may take the form of new endpoints or additional properties added to existing objects.

Setting Your API Key

All requests made to the Weather Route API have a standard requirement to set your API key in the headers sent with the request.
Set your API key in the x-api-key header with your request.
Example:
x-api-key: abcd1234xyz
        
All query parameters are expected to follow snake_case formatting.

Standard Response Format

Every response follows a standard JSON format. This includes the following properties:
data
This will be an object or array containing the results of a successful request. Each resource will specify the expected output data that will be filled in this property. If the request fails, this property will be null.
errors
This will be an array of error message strings for any problems with your request. If the request failed, this array will be populated with one or more reasons for the failure. If the request was successful, this may or may not be an empty array and it will indicate non-blocking problems related to your request.
apiUsage
This will be an object containing current details about your API usage. See the ApiUsage object for more details.
All response properties will be returned in camelCase formatting.

Example of a successful request:

{
  "apiUsage": {
    "cycleResetTime": 1634342400000,
    "numDirectionRequestPoints": 200,
    "numForecastRequestPoints": 150,
    "numGeocodeRequestPoints": 500,
    "numTotalRequestPoints": 850,
    "requestPointQuota": 500000
  },
  "data": {
    "gps": "39.526,-119.813",
    "latitude": 39.5261206,
    "longitude": -119.8126581,
    "postal_code": null,
    "city": "Reno",
    "county": "Washoe County",
    "state": "Nevada",
    "country": "United States",
    "osmId": 170120,
    "longName": "Reno, Nevada, United States",
    "shortName": "Reno, NV, US"
  },
  "errors": []
}
        

Example of an unsuccessful request:

{
  "apiUsage": {
    "cycleResetTime": 1634342400000,
    "numDirectionRequestPoints": 200,
    "numForecastRequestPoints": 150,
    "numGeocodeRequestPoints": 500,
    "numTotalRequestPoints": 850,
    "requestPointQuota": 500000
  },
  "data": null,
  "errors": [
    "Two or more 'point' query parameters must be specified."
  ]
}