Weather API
Current conditions and 7-day forecasts for MENA cities powered by Open-Meteo. Returns temperatures, humidity, wind, UV index, and WMO weather codes with English/Arabic descriptions and emoji icons. Results are cached for 30 minutes. When the provider fails, cached results may be served for up to another 24 hours with stale=true. fetchedAt records when the data was retrieved, not when conditions were observed; meta.timestamp is the response time.
/api/v1/weatherTry it out
/api/v1/weatherParameters
Used for this request only; it is not saved.
Code
curl -X GET "https://khaleejiapi.dev/api/v1/weather?city=dubai&lat=25.2048&lng=55.2708&days=3" \ -H "Authorization: Bearer your_api_key"Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| city | string | Optional | City name (13 MENA cities supported). Required if lat/lng not provided |
| lat | number | Optional | Latitude (-90 to 90). Requires lng |
| lng | number | Optional | Longitude (-180 to 180). Requires lat |
| days | number | Optional | Forecast days (1–7) |
Supported Cities
Use lat/lng for locations not in the predefined list.
Response Fields
current.temperature
Current temperature in °C
current.humidity
Relative humidity percentage
current.windSpeed
Wind speed in km/h
current.condition
WMO code + English/Arabic text + emoji icon
current.uvIndex
UV index (0–15 scale)
forecast[].maxTemp
Daily high temperature in °C
forecast[].precipitation
Precipitation in mm
location.timezone
IANA timezone identifier
stale
True when expired cached data is served after a provider failure
fetchedAt
ISO 8601 retrieval time, preserved on cache hits and stale fallbacks (not an observation timestamp)
Rate Limits
| Plan | Requests/Month | Rate Limit |
|---|---|---|
| Free | 1,000 | 10 req/min |
| Starter | 10,000 | 60 req/min |
| Professional | 100,000 | 300 req/min |
| Business | 500,000 | 500 req/min |
Debugging & Support
Include X-Request-ID when contacting support
Every response from KhaleejiAPI includes an X-Request-ID header — a unique identifier that lets our support team pull the exact log entry for your request within seconds. Always share it when reporting an unexpected error or unexpected result.
How to capture it
JavaScript / fetch
const res = await fetch("https://khaleejiapi.dev/api/v1/...", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const requestId = res.headers.get("x-request-id");
console.log("Request ID:", requestId);
// → e.g. "req_01j9xkz4vp8..."cURL
curl -si "https://khaleejiapi.dev/api/v1/..." \ -H "Authorization: Bearer YOUR_API_KEY" | grep -i x-request-id # → x-request-id: req_01j9xkz4vp8...
Browser DevTools
Open DevTools (F12) → Network tab → click the failing request → scroll to the Response Headers section → copy the value next to x-request-id.
For a full list of error codes and guidance on common issues, see the Troubleshooting guide.