Weather forecast API
A forecast for a place, by coordinates, region code or place name. National weather services answer where we hold them, and MET Norway covers any other point on earth.
GET /v1/weather1 creditAbout $0.001Try it
curl 'https://api.apifor.dev/v1/weather?lat=-7.83&lng=110.33' \
-H 'x-api-key: YOUR_API_KEY'{
"success": true,
"data": {
"location": {
"country": "ID",
"region_code": "34.02.16.2003",
"province": "Daerah Istimewa Yogyakarta",
"regency": "Bantul",
"district": "Kasihan",
"village": "Tamantirto",
"lat": -7.8210832262,
"lng": 110.3255892396,
"timezone_offset": "+0700",
"distance_km": 1.1
},
"issued_at": "2026-11-30T12:00:00Z",
"fetched_at": "2026-11-30T13:02:11.512Z",
"stale": false,
"source": "BMKG",
"forecasts": [
{
"time": "2026-11-30T13:00:00Z",
"local_time": "2026-11-30 20:00:00",
"condition": "Mostly Cloudy",
"condition_local": "Berawan",
"condition_code": "3",
"temperature_c": 25,
"humidity_percent": 96,
"cloud_cover_percent": 98,
"precipitation_mm": 0.1,
"wind_speed_kmh": 1.2,
"wind_from": "NW",
"wind_to": "SE",
"wind_degrees": 357,
"visibility_m": null,
"visibility_text": null
},
{
"time": "2026-11-30T16:00:00Z",
"local_time": "2026-11-30 23:00:00",
"condition": "Mostly Cloudy",
"condition_local": "Berawan",
"condition_code": "3",
"temperature_c": 25,
"humidity_percent": 96,
"cloud_cover_percent": 98,
"precipitation_mm": 0,
"wind_speed_kmh": 2.3,
"wind_from": "W",
"wind_to": "E",
"wind_degrees": 310,
"visibility_m": null,
"visibility_text": null
}
]
},
"meta": {
"attribution": {
"source": "BMKG (Badan Meteorologi, Klimatologi, dan Geofisika)",
"licence": "BMKG open data, attribution required",
"license": "BMKG open data, attribution required",
"license_url": "https://data.bmkg.go.id",
"source_url": "https://data.bmkg.go.id",
"attribution_page": "https://apifor.dev/sources",
"notice": "Source: BMKG (Badan Meteorologi, Klimatologi, dan Geofisika). Show BMKG as the data source wherever you display this data. Fields normali..."
},
"freshness": {
"mode": "cached",
"source": "BMKG",
"source_published_at": "2026-11-30T12:00:00Z",
"fetched_at": "2026-11-30T13:02:11.512Z",
"refresh_interval_minutes": 360,
"max_lag_minutes": 360
}
}
}A real response from our OpenAPI file, with long lists and strings shortened.
Endpoints and price
| Endpoint | Credits | About |
|---|---|---|
GET /v1/weather | 1 credit | $0.001 |
GET /v1/weather/locations | 1 credit | $0.001 |
GET /v1/weather/coverage (Free) | Free | $0 |
USD at Starter pack prices ($5 for 5,000 credits). Calls that fail before work starts are refunded.
Coverage today
Works for any country. Country-specific data: Indonesia, Malaysia and Singapore.
Leave country out to get every covered country, or pass one to narrow it.
Sources, row counts and country-only fields per country: GET /v1/weather/coverage, free with your API key. How coverage works
Limits
- Step length depends on the source: 3-hourly, hourly, 2-hour or daily.
- A point with no national forecast nearby falls back to MET Norway.
- BMKG issues Indonesian forecasts twice a day, and we refresh each place from BMKG once our copy is 6 hours old. meta.freshness shows when.
- If the source is down we serve the last copy with stale: true.
Questions
How do I find a region code?
Search by place name with /v1/weather/locations, or skip it and pass lat and lng.
Do I have to credit the source?
Yes. Each weather service asks for credit. Pass meta.attribution along.