Get current weather
Forecast API
This API endpoint makes an HTTP GET request to retrieve the weather forecast based on the provided latitude and longitude coordinates. The request includes query parameters to specify the latitude, longitude, and other options such as current weather and temperature unit.
Request Parameters
latitude
(required): The latitude coordinate for which the forecast is requested.longitude
(required): The longitude coordinate for which the forecast is requested.current_weather
(optional): A boolean value to include current weather information in the forecast.temperature_unit
(optional): The unit of temperature to be used in the forecast (e.g., Celsius or Fahrenheit).
Response
The response will include the forecast details based on the provided coordinates. It contains information such as latitude, longitude, generation time, UTC offset, timezone, elevation, and current weather details including time, temperature, wind speed, wind direction, and weather code.
Example:
json
{
"latitude": 0,
"longitude": 0,
"generationtime_ms": 0,
"utc_offset_seconds": 0,
"timezone": "",
"timezone_abbreviation": "",
"elevation": 0,
"current_weather_units": {
"time": "",
"interval": "",
"temperature": "",
"windspeed": "",
"winddirection": "",
"is_day": "",
"weathercode": ""
},
"current_weather": {
"time": "",
"interval": 0,
"temperature": 0,
"windspeed": 0,
"winddirection": 0,
"is_day": 0,
"weathercode": 0
}
}
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
latitude | string | ||
longitude | string | ||
current_weather | boolean | ||
temperature_unit | string |