githubEdit

Point Queries

Single Point & Init Time

Check the weather for Zurich.

query = {
    "models": ["ept2"],
    "geo": {
        "type": "point",
        "value": [47.3784, 8.5387],  # [longitude, latitude] - Zurich
        "method": "nearest",
    },
    "variables": [
        "air_temperature_at_height_level_2m",
        "wind_speed_at_height_level_100m",
    ],
    "init_time": "latest",
    "prediction_timedelta": {"start": 0, "end": 72},  # 0-72 hours ahead
}

# Estimate cost before executing
cost_response = requests.post(cost_url, headers=headers, json=query)
cost_response.raise_for_status()
cost_info = cost_response.json()
print(f"Estimated cost: {cost_info['total_credits_needed']:.4f} credits")
print(f"Rows to return: {cost_info['total_rows_returned']}")
print(f"Rows to access: {cost_info['total_rows_accessed']}")

response = requests.post(url, headers=headers, json=query)
response.raise_for_status()

data = response.json()
df = pd.DataFrame(data)
print(f"✅ Retrieved {len(df)} rows")
print(df.head())

Multiple Points, Single Init Time

Get the latest forecast for three points of interest.

Multiple Models & Points

Request data for mulitple models and locations to compare them.

Historical Data for Single Point

Query two months of 3-day forecasts for Zurich

Last updated