---
title: "Weather API"
url: "https://dev-portal.dehaven.org/apis/empty-api-v1/versions/e40571fa-f6cf-4b13-a833-6fc3b759e34d"
---

# Weather API

OpenAPI specification document.

```json
{"openapi":"3.1.0","info":{"title":"Weather API","description":"API for retrieving weather information, including current conditions, forecasts, and historical data.","version":"1.0.0","contact":{"name":"API Support","url":"https://example.com/support","email":"support@example.com"}},"servers":[{"url":"https://api.example.com/weather/v1","description":"Main API server"}],"tags":[{"name":"Weather","description":"Operations related to weather data"}],"paths":{"/current-weather":{"get":{"summary":"Get current weather","description":"Retrieves current weather conditions for a specified location.","operationId":"getCurrentWeather","tags":["Weather"],"parameters":[{"name":"location","in":"query","description":"Location for which to retrieve weather data.","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentWeather"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/forecast":{"get":{"summary":"Get 7-day forecast","description":"Provides a 7-day weather forecast for a given location.","operationId":"getForecast","tags":["Weather"],"parameters":[{"name":"location","in":"query","description":"Location for which to retrieve the forecast.","schema":{"type":"string"},"required":true},{"name":"limit","in":"query","description":"Maximum number of items to return","schema":{"type":"integer","format":"int32","minimum":1,"maximum":7,"default":7}},{"name":"offset","in":"query","description":"Number of items to skip","schema":{"type":"integer","format":"int32","minimum":0,"default":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastList"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/historical-weather":{"get":{"summary":"Get historical weather data","description":"Fetches historical weather data for a specific location and date range.","operationId":"getHistoricalWeather","tags":["Weather"],"parameters":[{"name":"location","in":"query","description":"Location for which to retrieve historical weather data.","schema":{"type":"string"},"required":true},{"name":"start_date","in":"query","description":"Start date for the historical data (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"required":true},{"name":"end_date","in":"query","description":"End date for the historical data (YYYY-MM-DD).","schema":{"type":"string","format":"date"},"required":true},{"name":"limit","in":"query","description":"Maximum number of items to return","schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":20}},{"name":"offset","in":"query","description":"Number of items to skip","schema":{"type":"integer","format":"int32","minimum":0,"default":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoricalWeatherList"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CurrentWeather":{"type":"object","properties":{"location":{"type":"string","description":"Location of the weather data."},"temperature":{"type":"number","format":"float","description":"Current temperature in Celsius."},"humidity":{"type":"integer","description":"Current humidity percentage."},"wind_speed":{"type":"number","format":"float","description":"Current wind speed in km/h."},"description":{"type":"string","description":"Description of the current weather conditions."}},"example":{"location":"London","temperature":15.5,"humidity":80,"wind_speed":15.2,"description":"Partly Cloudy"}},"Forecast":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the forecast."},"high_temperature":{"type":"number","format":"float","description":"High temperature in Celsius."},"low_temperature":{"type":"number","format":"float","description":"Low temperature in Celsius."},"condition":{"type":"string","description":"Weather condition for the day."}},"example":{"date":"2024-07-08","high_temperature":22,"low_temperature":14,"condition":"Sunny"}},"ForecastList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Forecast"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"offset":{"type":"integer","description":"The number of items to skip before starting to collect the result set.","example":0},"limit":{"type":"integer","description":"The numbers of items to return.","example":7},"total":{"type":"integer","description":"The total number of items available.","example":7},"estimated_total":{"type":"boolean","description":"If the total number of items available is an estimate.","example":false}}}}}},"example":{"data":[{"date":"2024-07-08","high_temperature":22,"low_temperature":14,"condition":"Sunny"},{"date":"2024-07-09","high_temperature":23,"low_temperature":15,"condition":"Cloudy"}],"meta":{"page":{"offset":0,"limit":7,"total":7,"estimated_total":false}}}},"HistoricalWeather":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Date of the historical weather data."},"temperature":{"type":"number","format":"float","description":"Average temperature in Celsius."},"humidity":{"type":"integer","description":"Average humidity percentage."},"wind_speed":{"type":"number","format":"float","description":"Average wind speed in km/h."},"description":{"type":"string","description":"Description of the weather conditions."}},"example":{"date":"2024-07-01","temperature":20,"humidity":75,"wind_speed":10,"description":"Sunny"}},"HistoricalWeatherList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/HistoricalWeather"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"offset":{"type":"integer","description":"The number of items to skip before starting to collect the result set.","example":0},"limit":{"type":"integer","description":"The numbers of items to return.","example":20},"total":{"type":"integer","description":"The total number of items available.","example":30},"estimated_total":{"type":"boolean","description":"If the total number of items available is an estimate.","example":false}}}}}},"example":{"data":[{"date":"2024-07-01","temperature":20,"humidity":75,"wind_speed":10,"description":"Sunny"},{"date":"2024-07-02","temperature":22,"humidity":70,"wind_speed":12,"description":"Cloudy"}],"meta":{"page":{"offset":0,"limit":20,"total":30,"estimated_total":false}}}},"Error":{"type":"object","properties":{"code":{"type":"string","description":"Error code.","example":"400"},"message":{"type":"string","description":"Error message.","example":"Bad Request"}}}}}}
```
