# Weather Forecast API (`sfoln/weather-forecast`)

Weather forecast API for any list of place names or coordinates: current conditions, a daily forecast of up to 10 days and optional hourly steps, with temperature, feels-like, rain, wind, UV and sunrise/sunset in local time. MET Norway data. $1 per 1,000 locations.

- Family: Data utilities
- Categories: Developer tools, Automation, Travel
- Store: https://apify.com/sfoln/weather-forecast (Markdown: https://apify.com/sfoln/weather-forecast.md)
- JSON: https://www.sfoln.com/actors/weather-forecast.json
- MCP: https://mcp.apify.com?tools=sfoln/weather-forecast
- REST (sync): POST https://api.apify.com/v2/actors/sfoln~weather-forecast/run-sync-get-dataset-items
- REST (async): POST https://api.apify.com/v2/actors/sfoln~weather-forecast/runs

Weather Forecast API returns current conditions plus a daily forecast of up to 10 days (and optional hourly steps) for any list of place names or coordinates in one call. Forecasts come from MET Norway, the Norwegian Meteorological Institute (the forecasts behind yr.no), for any point on Earth. Place names are geocoded automatically, and every record is in the location's own time zone with readable conditions ("Light rain showers"), feels-like temperature, UV index and sunrise/sunset. Built for logistics and field-service planning, travel and event apps, agriculture dashboards and AI agents that need a reliable weather answer.

## Price per delivered record

| Event | Price | Per 1,000 | Charged for |
| --- | --- | --- | --- |
| Location forecast (`weather-forecast`) | $0.001 | $1 / 1,000 | Charged once per location for which current conditions and the daily (and optional hourly) forecast were returned. |

Pay-per-event, USD, billed by Apify; no platform usage charge. Only records with status `ok` are charged. Cap a run with `maxTotalChargeUsd`. Apify free plan: up to 10 per run.

## Run

```bash
curl -X POST "https://api.apify.com/v2/actors/sfoln~weather-forecast/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"locations":["Berlin","40.7128,-74.0060"]}'
```

MCP client configuration:

```json
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=sfoln/weather-forecast"
    }
  }
}
```

Example prompt: What is the 7-day weather forecast for Berlin and New York? Include daily highs, lows and how much rain to expect.

## Input

List places or coordinates (one per line). Each location produces one dataset record with current conditions and a daily (optionally hourly) forecast.

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `locations` (required) | array | — | Locations: One per line: a place name ("Berlin", "Paris, France") or "latitude,longitude" ("40.7128,-74.0060"). Via the API you can also pass objects like {"latitude": 52.52, "longitude": 13.41, "name": "Office"} or {"place": "Springfield", "countryCode": "US"}. Accounts on the Apify free plan can process up to 10 locations per run. |
| `days` | integer | `7` | Forecast days: Calendar days to return, today included. The forecast reaches about 10 days ahead, so values above 10 return the whole forecast (10 days). |
| `hourly` | boolean | `false` | Include hourly forecast: Add an `hourly` array: one entry per forecast step (hourly for about the first 2.5 days, then every 6 hours) with temperature, feels-like, humidity, precipitation, conditions and wind. |
| `units` | string | `"metric"` | Units: metric = °C, km/h, mm · imperial = °F, mph, inch. One of `"metric"`, `"imperial"`. |
| `timezone` | string | `"auto"` | Time zone: auto (default) = each location's own time zone: days and times are local there. Or one IANA time zone for every location, e.g. UTC or Europe/Berlin. |
| `maxLocations` | integer | `1000` | Max locations: Safety cap on how many locations are processed in this run. |
| `concurrency` | integer | `5` | Concurrency: How many locations are processed in parallel. |
| `includeRaw` | boolean | `false` | Include raw upstream response: Attach the unmodified MET Norway forecast (GeoJSON) to each record (larger output). |

Example input:

```json
{
  "locations": [
    "Berlin",
    "40.7128,-74.0060"
  ]
}
```

## Output

One record per input item with `status` (`ok` is charged; `not_found`, `error`, `skipped_*` are free) and `charged`. The run stores an `OUTPUT` summary record.

| Field | Type | Meaning |
| --- | --- | --- |
| `input` | string | object | Input: The parsed location input. |
| `location` | string | null | Location: Resolved place label ("Berlin, State of Berlin, Germany"), the given name, or "lat,lng". |
| `resolvedPlace` | object | null | Resolved place: Geocoding match for place-name inputs: name, latitude, longitude, country, countryCode, admin1, timezone, elevation, population. |
| `latitude` | number | null | Latitude: Latitude of the forecast point (4 decimals). |
| `longitude` | number | null | Longitude: Longitude of the forecast point (4 decimals). |
| `elevation` | number | null | Elevation (m): Altitude the forecast temperatures refer to (the place's elevation, else MET Norway's terrain model). |
| `timezone` | string | null | Timezone: IANA time zone of all days and times in the record. |
| `timezoneAbbreviation` | string | null | TZ abbreviation: e.g. CEST, EDT or GMT+9. |
| `utcOffsetSeconds` | integer | null | UTC offset (s): Current offset of the time zone from UTC. |
| `timezoneSource` | string | null | Timezone source: geocoder (the place's zone) \| nearest_place (coordinates: zone of the nearest populated place) \| input (the timezone input) \| default (UTC). |
| `units` | object | null | Units: { temperature, windSpeed, precipitation } unit labels. |
| `current` | object | null | Current conditions: The current forecast hour: time, temperature, apparentTemperature, dewPoint, relativeHumidity, precipitation, weatherCode, symbolCode, weatherText, cloudCover, windSpeed, windDirection, windGusts, pressure, uvIndexClearSky, isDay. |
| `daily` | array | Daily forecast: Per local calendar day: date, tempMax, tempMin, precipitationSum, precipitationProbabilityMax, weatherCode, symbolCode, weatherText, windMax, windGustMax, uvIndexMax, sunrise, sunset, hoursCovered. |
| `hourly` | array | Hourly forecast: Only when `hourly` is enabled: one entry per forecast step (hourly, later 6-hourly): time, periodHours, temperature, apparentTemperature, dewPoint, relativeHumidity, precipitation, precipitationProbability, weatherCode, symbolCode, weatherText, windSpeed, windDirection, windGusts, cloudCover, uvIndexClearSky. |
| `forecastDays` | integer | null | Forecast days: Number of days in `daily`. |
| `forecastStart` | string | null | Forecast start: Local time of the first forecast step. |
| `forecastEnd` | string | null | Forecast end: Local time of the last forecast step (about 10 days ahead). |
| `forecastUpdatedAt` | string | null | Forecast updated: When MET Norway last updated this forecast (ISO, UTC). |
| `attribution` | string | null | Attribution: Weather data from MET Norway (api.met.no), CC BY 4.0. |
| `status` | string | Status: ok \| not_found \| error \| skipped_invalid \| skipped_budget \| skipped_free_plan |
| `charged` | boolean | Charged: Whether this record incurred a pay-per-event charge. |
| `chargedEvent` | string | null | Charged event: weather-forecast when charged. |
| `source` | string | Source: metno |
| `fetchedAt` | string | Fetched at: ISO timestamp. |
| `warnings` | array | null | Warnings: Non-fatal notes (a geocoding fallback, fewer days than requested). |
| `error` | object | null | Error: { code, message, provider?, status? } when status is not ok. |

Example record:

```json
{
  "input": {
    "kind": "place",
    "place": "New York"
  },
  "location": "New York, United States",
  "resolvedPlace": {
    "name": "New York",
    "latitude": 40.71427,
    "longitude": -74.00597,
    "country": "United States",
    "countryCode": "US",
    "admin1": "New York",
    "timezone": "America/New_York",
    "elevation": 10,
    "population": 8804190
  },
  "latitude": 40.7128,
  "longitude": -74.006,
  "elevation": 28,
  "timezone": "America/New_York",
  "timezoneAbbreviation": "EDT",
  "utcOffsetSeconds": -14400,
  "timezoneSource": "geocoder",
  "units": {
    "temperature": "°C",
    "windSpeed": "km/h",
    "precipitation": "mm"
  },
  "current": {
    "time": "2026-10-14T19:00",
    "temperature": 23,
    "apparentTemperature": 23,
    "dewPoint": 19.7,
    "relativeHumidity": 81.1,
    "precipitation": 0,
    "weatherCode": 2,
    "symbolCode": "partlycloudy_night",
    "weatherText": "Partly cloudy",
    "cloudCover": 71.1,
    "windSpeed": 16.6,
    "windDirection": 260.2,
    "windGusts": null,
    "pressure": 1011.1,
    "uvIndexClearSky": 0,
    "isDay": false
  },
  "daily": [
    {
      "date": "2026-10-16",
      "tempMax": 23.9,
      "tempMin": 12.7,
      "precipitationSum": 6.7,
      "precipitationProbabilityMax": null,
      "weatherCode": 81,
      "symbolCode": "rainshowers_day",
      "weatherText": "Rain showers",
      "windMax": 21.6,
      "windGustMax": null,
      "uvIndexMax": 4.5,
      "sunrise": "2026-10-16T07:08",
      "sunset": "2026-10-16T18:14",
      "hoursCovered": 24
    }
  ],
  "hourly": [
    {
      "time": "2026-10-14T19:00",
      "periodHours": 1,
      "temperature": 23,
      "apparentTemperature": 23,
      "dewPoint": 19.7,
      "relativeHumidity": 81.1,
      "precipitation": 0,
      "precipitationProbability": null,
      "weatherCode": 2,
      "symbolCode": "partlycloudy_night",
      "weatherText": "Partly cloudy",
      "windSpeed": 16.6,
      "windDirection": 260.2,
      "windGusts": null,
      "cloudCover": 71.1,
      "uvIndexClearSky": 0
    }
  ],
  "forecastDays": 3,
  "forecastStart": "2026-10-14T19:00",
  "forecastEnd": "2026-10-23T20:00",
  "forecastUpdatedAt": "2026-10-14T19:17:47Z",
  "attribution": "Weather data from MET Norway (api.met.no), CC BY 4.0",
  "status": "ok",
  "charged": true,
  "chargedEvent": "weather-forecast",
  "source": "metno",
  "fetchedAt": "2026-10-14T23:38:02.000Z"
}
```

## FAQ

**How far ahead does the forecast go?**

About 10 days: hourly steps for roughly the first 2.5 days, then 6-hour steps. Ask for up to 10 days; larger values return the whole forecast.

**Which time zone are the dates and times in?**

The location's own time zone by default (from the place name, or for coordinates the zone of the nearest populated place). Set timezone to UTC or any IANA zone to use that instead.


## Related

- [Historical Weather Data API](https://www.sfoln.com/actors/historical-weather.md) (`sfoln/historical-weather`)
- [Geocoding API – Address to Coordinates](https://www.sfoln.com/actors/geocode-address.md) (`sfoln/geocode-address`)
- [Currency Exchange Rates API](https://www.sfoln.com/actors/fx-rates.md) (`sfoln/fx-rates`)

Publisher: SFOLN LLC, contact@sfoln.com. Catalogue: https://www.sfoln.com/catalog.json. Agent guide: https://www.sfoln.com/agents.md.
