---
title: "Weather forecast API | APIFor"
description: "A forecast for a place, by coordinates, region code or place name. 1 credit per call, REST and MCP, one API key."
canonical: "https://apifor.dev/services/weather/"
---

1. [Services](https://apifor.dev/services/)
2. [Weather](https://apifor.dev/services/weather/)

# 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/weather 1 credit About $0.001

[Get a free API key](https://app.apifor.dev/register) [Endpoint reference](https://apifor.dev/docs/reference/weather/)

## Try it

GET /v1/weather

```bash
curl 'https://api.apifor.dev/v1/weather?lat=-7.83&lng=110.33' \
  -H 'x-api-key: YOUR_API_KEY'
```

Example response · 200

```json
{
  "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`](https://apifor.dev/docs/reference/weather/#get-weather-coverage), free with your API key. [How coverage works](https://apifor.dev/docs/coverage/)

## 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.

## Sources and licences

- **[BMKG](https://data.bmkg.go.id)**: BMKG open data, attribution required
- **[open-admin-data administrative divisions](https://github.com/open-admin-data/indonesia-administrative-divisions)**: CC BY 4.0

### Attribution

- Source: BMKG (Badan Meteorologi, Klimatologi, dan Geofisika)
- Data from MET Norway (The Norwegian Meteorological Institute)
- Source: MET Malaysia via data.gov.my
- Contains information from data.gov.sg made available under the Singapore Open Data Licence version 1.0 (https://data.gov.sg/open-data-licence)

## Also on MCP

Connect `https://mcp.apifor.dev/mcp` and your agent gets a tool for this service, billed the same way.

[MCP setup](https://apifor.dev/docs/mcp/)

## 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.

## Related services

[All services](https://apifor.dev/services/)

- [Weather alerts API](https://apifor.dev/services/weather-alerts/)
- [Earthquakes API](https://apifor.dev/services/earthquakes/)
- [Tsunami alerts API](https://apifor.dev/services/tsunami-alerts/)
- [Volcano alert levels API](https://apifor.dev/services/volcanoes/)
- [Air quality API](https://apifor.dev/services/air-quality/)
