# Weather Forecast — Zapi reference > Retrieve current weather conditions and forecast for a geographic location. **Base URL:** `https://api.zpi.web.id` **Auth:** Send `x-api-key: YOUR_KEY` header on every request. Get a free key at https://zpi.web.id/dashboard/keys. **Response envelope:** `{ status, message, content }` **Rate limit:** 60 req/min on free tier. **Related:** - Detail page: https://zpi.web.id/api/web-tools/weather - Endpoint catalog: https://zpi.web.id/category/web-tools - Concise index: https://zpi.web.id/llms.txt - Full reference: https://zpi.web.id/llms-full.txt --- ## Weather Forecast **Category:** web-tools · **Slug:** `weather` **Detail page:** https://zpi.web.id/api/web-tools/weather Retrieve current weather conditions and forecast for a geographic location. **Tags:** utility, weather ### Weather Forecast Get current and forecast weather data for a location. - **Method:** `GET` - **Endpoint:** `https://api.zpi.web.id/v1/web-tools:weather/forecast` - **Cache TTL:** 300s **Parameters:** | Name | Type | Location | Required | Description | |------|------|----------|----------|-------------| | `lat` | number | query | yes | Latitude (-90..90) | | `lon` | number | query | yes | Longitude (-180..180) | | `days` | number | query | no | Forecast days (1-7). Default 3 | **cURL:** ```bash curl "https://api.zpi.web.id/v1/web-tools:weather/forecast?lat=-6.2088&lon=106.8456&days=3" \ -H "x-api-key: YOUR_API_KEY" ``` **JavaScript / TypeScript:** ```javascript const res = await fetch("https://api.zpi.web.id/v1/web-tools:weather/forecast?lat=-6.2088&lon=106.8456&days=3", { headers: { "x-api-key": process.env.ZAPI_KEY } }); const data = await res.json(); ``` **Python:** ```python import requests r = requests.get("https://api.zpi.web.id/v1/web-tools:weather/forecast?lat=-6.2088&lon=106.8456&days=3", headers={"x-api-key": "YOUR_API_KEY"}) data = r.json() ``` **Example response:** ```json { "ok": true, "daily": { "time": [ "2026-05-27", "2026-05-28", "2026-05-29" ], "precipitation_sum": [ 0, 0, 0.7 ], "temperature_2m_max": [ 32.2, 32.7, 33.1 ], "temperature_2m_min": [ 24.1, 22.9, 23.9 ] }, "current": { "time": "2026-05-27T20:45", "interval": 900, "weather_code": 0, "temperature_2m": 27.6, "wind_speed_10m": 4.9, "relative_humidity_2m": 82 }, "latitude": -6.221441, "timezone": "Asia/Jakarta", "elevation": 12, "longitude": 106.856186, "daily_units": { "time": "iso8601", "precipitation_sum": "mm", "temperature_2m_max": "°C", "temperature_2m_min": "°C" }, "current_units": { "time": "iso8601", "interval": "seconds", "weather_code": "wmo code", "temperature_2m": "°C", "wind_speed_10m": "km/h", "relative_humidity_2m": "%" }, "generationtime_ms": 0.1575946807861328, "utc_offset_seconds": 25200, "timezone_abbreviation": "GMT+7" } ``` --- _Generated: 2026-08-02T14:23:48.318Z_