Overview
WeatherAPI is a feature-rich weather platform that delivers real-time weather, 14-day forecasts, historical data, and extras like astronomy data (sunrise/sunset, moon phases) and geolocation lookups. It has a generous free tier and a simple, consistent API design that makes it easy to get started. Beginners will find the single endpoint approach and clear documentation ideal for building their first weather app.
Beginner Tip
Register at weatherapi.com for a free API key. You can query by city name, coordinates, zip code, or even IP address — all using the same q parameter, making it very flexible for different use cases.
Available Data
Example Response
{
"location": "Tokyo",
"temperature": {
"current": 22,
"feels_like": 24,
"min": 18,
"max": 26
},
"condition": "Partly Cloudy",
"humidity": 65,
"wind": {
"speed": 12,
"direction": "NE"
},
"forecast": [
{
"date": "2025-01-16",
"high": 25,
"low": 17,
"condition": "Sunny"
}
]
} Field Reference
current.temp_c Current temperature in Celsius current.temp_f Current temperature in Fahrenheit (returned alongside Celsius in every response) current.condition.text Human-readable current weather condition such as "Partly cloudy" current.wind_kph Current wind speed in kilometers per hour current.humidity Current relative humidity as a percentage location.localtime Local date and time at the queried location in YYYY-MM-DD HH:MM format Implementation Example
// Get current weather by city name
const url = "http://api.weatherapi.com/v1/current.json?key=YOUR_API_KEY&q=London";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(`Location: ${data.location.name}, ${data.location.country}`);
console.log(`Temperature: ${data.current.temp_c}°C`);
console.log(`Condition: ${data.current.condition.text}`);
console.log(`Humidity: ${data.current.humidity}%`); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Alternatives to WeatherAPI
Technical alternatives for different use cases.
Industry-leading forecast accuracy with MinuteCast feature
Consumer-facing apps where forecast precision matters
Budget-conscious projects (expensive paid tiers)
No API key needed, fully open-source weather data
Quick prototyping without registration
Production apps needing guaranteed uptime
Largest community and most integrations available
Finding existing libraries and community support
Free tier limits (1K calls/day on free plan)
More generous free tier with astronomy data
Apilayer ecosystem compatibility
Free tier with more API calls per month
Recipes Using WeatherAPI
Build something with this API. Each recipe includes step-by-step instructions and code outlines.
Similar APIs
View All →OpenWeatherMap
⭐ Beginner's PickOpenWeatherMap is one of the most popular weather APIs, providing current conditions, forecasts, and historical data for millions of locations worldwide.
Open-Meteo
⭐ Beginner's PickOpen-Meteo is a completely free and open-source weather API for non-commercial use that provides hourly and daily forecasts, historical data, and climate projections for any location worldwide without requiring an API key.
Visual Crossing
⭐ Beginner's PickVisual Crossing offers comprehensive historical weather data, current conditions, and forecasts for any location worldwide, making it particularly valuable for data analysis and building weather-driven insights.
Weatherbit
Weatherbit is a professional-grade weather API offering current observations, hourly and daily forecasts, historical weather, and severe weather alerts sourced from global meteorological stations.
Weatherstack
⭐ Beginner's PickWeatherstack is a real-time and historical weather data API that covers over 200,000 locations worldwide.