GET /v1/forecast • HTTP 200 OK
Weather Forecast Public API Example — Request & Response Example
A genuine public API example querying Open-Meteo for temperature, wind speed, and weather codes with zero API key required.
1. HTTP Client Request (GET)
GET /v1/forecast HTTP/1.1
{
"Accept": "application/json"
}
2. Server JSON Response (HTTP 200 OK)
{
"latitude": 37.7749,
"longitude": -122.4194,
"timezone": "GMT",
"elevation": 28,
"current": {
"time": "2026-10-06T12:00",
"interval": 900,
"temperature_2m": 18.4,
"wind_speed_10m": 14.8
},
"current_units": {
"temperature_2m": "°C",
"wind_speed_10m": "km/h"
}
}
Copy-Paste Code Snippets (cURL, JavaScript Fetch, Python, Node.js)
curl "https://api.open-meteo.com/v1/forecast?latitude=37.7749&longitude=-122.4194¤t=temperature_2m,wind_speed_10m"
fetch('https://api.open-meteo.com/v1/forecast?latitude=37.7749&longitude=-122.4194¤t=temperature_2m,wind_speed_10m')
.then(res => res.json())
.then(weather => console.log(`Temp: ${weather.current.temperature_2m}°C`));
import requests
res = requests.get('https://api.open-meteo.com/v1/forecast', params={
'latitude': 37.7749,
'longitude': -122.4194,
'current': 'temperature_2m,wind_speed_10m'
})
print(res.json()['current'])
How This API Call Works Step-by-Step
- 1. Coordinate Parameters: Latitude and longitude supplied in query string.
- 2. Meteorological Lookup: Backend aggregates radar and weather model readings.
- 3. Units Output: Temperature and wind metrics returned with unambiguous SI units.
Backend API Functions: The weather API function resolves geospatial coordinates and computes current interpolation from numerical weather prediction models.
Frequently Asked Questions
Are there free weather APIs that do not require credit cards?
Yes! Open-Meteo and National Weather Service (US) offer free non-commercial access without requiring API keys or payment registration.