API Documentation
Integrate WeatherUpdateHub weather data into your applications
API Overview
WeatherUpdateHub provides a RESTful API for accessing weather data, forecasts, and air quality information. Our API is built on Open-Meteo's reliable weather data and is completely free to use.
Base URL
https://weatherupdatehub.com/apiRate Limit
1000 requests per hour
Data Source
Open-Meteo API
API Endpoints
GET
/api/weatherGet current weather conditions
Parameters
latitude(number)RequiredLatitude coordinatelongitude(number)RequiredLongitude coordinateExample
/api/weather?latitude=31.5204&longitude=74.3587GET
/api/forecast/hourlyGet hourly weather forecast
Parameters
latitude(number)RequiredLatitude coordinatelongitude(number)RequiredLongitude coordinatehours(number)Number of hours (max: 24)Example
/api/forecast/hourly?latitude=31.5204&longitude=74.3587&hours=12GET
/api/forecast/dailyGet daily weather forecast
Parameters
latitude(number)RequiredLatitude coordinatelongitude(number)RequiredLongitude coordinatedays(number)Number of days (max: 7)Example
/api/forecast/daily?latitude=31.5204&longitude=74.3587&days=5GET
/api/air-qualityGet air quality data
Parameters
latitude(number)RequiredLatitude coordinatelongitude(number)RequiredLongitude coordinateExample
/api/air-quality?latitude=31.5204&longitude=74.3587Code Examples
javascript
// Fetch current weather
const response = await fetch('https://weatherupdatehub.com/api/weather?latitude=31.5204&longitude=74.3587');
const data = await response.json();
console.log(data.current.temperature); // Current temperature
console.log(data.current.weatherCode); // Weather condition codepython
import requests
# Fetch current weather
response = requests.get('https://weatherupdatehub.com/api/weather?latitude=31.5204&longitude=74.3587')
data = response.json()
print(f"Temperature: {data['current']['temperature']}°C")
print(f"Weather Code: {data['current']['weatherCode']}")curl
# Fetch current weather
curl "https://weatherupdatehub.com/api/weather?latitude=31.5204&longitude=74.3587"Response Format
{
"current": {
"temperature": 25.4,
"weatherCode": 61,
"windSpeed": 12.3,
"humidity": 65
},
"hourly": [
{
"time": "2024-01-15T12:00:00Z",
"temperature": 26.1,
"weatherCode": 61,
"precipitation": 20
}
],
"daily": [
{
"date": "2024-01-15",
"maxTemperature": 28.5,
"minTemperature": 18.2,
"weatherCode": 61,
"precipitationProbability": 30
}
]
}Error Handling
400 Bad Request
Invalid parameters or missing required fields
429 Too Many Requests
Rate limit exceeded. Try again later.
500 Internal Server Error
Server error. Please try again later.
Need Help?
If you have questions about our API or need integration support, we're here to help!