# Weather Forecast API – Hourly & 10-Day, Any City or Lat/Lon (`gazidev/weather-forecast`) Actor

Hourly and daily weather forecasts for a list of cities or coordinates from MET Norway: temperature, wind, gusts, rain, clouds, humidity, UV, symbol. 10 days, local time zones, flat or nested rows. No API key, commercial use allowed. $2 per 1,000 locations.

- **URL**: https://apify.com/gazidev/weather-forecast.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 location forecasts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Weather Forecast API – Hourly & 10-Day Forecast for Any City or Coordinates

Get **hourly and daily weather forecasts for a list of places** in one run: temperature, feels-like, wind speed, direction and gusts, precipitation, cloud cover, humidity, pressure, dew point, fog, UV index and a weather symbol. The forecast data comes from **MET Norway** (the Norwegian Meteorological Institute), which publishes it under open licences (NLOD 2.0 / CC BY 4.0) that **allow commercial use**.

- **Any location on Earth**: city names (`Berlin`, `Paris, France`, `Springfield, IL`) or `lat, lon` coordinates
- **About 10 days ahead**: hourly steps for the next ~2.5 days, then 6-hour steps
- **Daily summaries per local day**: min/max temperature, total precipitation, max wind and gust, max UV, a day symbol
- **Local time zones** (or UTC, or any time zone you choose)
- **Three output shapes**: one row per location (nested), one row per hour (flat), one row per day (flat)
- **No API key, no sign-up at the weather service.** $2 per 1,000 locations, with every hour and day included

### What this listing does that our other Actors do not

| Actor | What it does |
|---|---|
| **Weather Forecast** (this one) | coordinates or city → hourly + daily **weather forecast** |
| [Reverse Geocoder](https://apify.com/gazidev/reverse-geocoder) | coordinates → country, state, nearest town, time zone (no weather) |
| [Address Geocoder](https://apify.com/gazidev/address-geocoder) | US / French street address → coordinates |
| [Bulk IP Lookup](https://apify.com/gazidev/bulk-ip-lookup) | IP address → network and country |

Typical chain: geocode addresses or scrape places (with coordinates) first, then pass the coordinates here.

### Use cases

- **Logistics and field work**: forecast wind, rain and frost for delivery depots, construction sites, farms, wind or solar sites.
- **Travel and events**: add a 10-day forecast to hotels, venues, trip itineraries or event pages.
- **E-commerce and marketing**: trigger weather-based campaigns (heat, rain, snow) per store or region.
- **Data pipelines and dashboards**: a daily scheduled run with flat hourly rows straight into Sheets, BigQuery or a database.
- **AI agents**: "What will the weather be in Lisbon on Saturday?" through the Apify MCP server.

### Input

| Field | What it is | Default |
|---|---|---|
| `locations` | List of city names or `lat, lon` strings. In JSON/API input also objects: `{"name": "Site A", "lat": 59.91, "lon": 10.75, "altitude": 120, "timezone": "Europe/Oslo"}` or `{"query": "Munich"}` | `["Oslo", "New York", "Tokyo"]` |
| `output` | `perLocation` (nested `hourly[]` + `daily[]`), `hourlyRows` (flat, one row per time step) or `dailyRows` (flat, one row per day) | `perLocation` |
| `hours` | How many hours of time steps to return (max 240) | 48 |
| `days` | How many local days in the daily summary (max 11) | 10 |
| `timezone` | `local`, `UTC` or an IANA name like `America/Chicago` | `local` |
| `detail` | `complete` (adds gusts, feels-like, dew point, fog, UV, probabilities) or `compact` | `complete` |
| `includeHourly` / `includeDaily` | Turn parts of the per-location row off | on |
| `skipDuplicates` | The same point (4 decimals) is forecast and charged once | on |
| `useCache` | Reuse unexpired forecasts (see "Fair use" below) | on |
| `maxLocations` | Optional cap on input locations | – |

City names are matched **offline** against GeoNames' list of about 34,000 cities and towns with 15,000+ inhabitants, including alternative and local names (`München`, `Bombay`, `Saigon`). The most populous match wins; add a country or state after a comma to choose another one (`Paris, TX`, `London, Canada`). For villages, farms, ships or exact sites use coordinates.

Example:

```json
{
  "locations": ["Lisbon", "Paris, TX", "47.3769, 8.5417"],
  "output": "dailyRows",
  "days": 7
}
```

### Output

`perLocation` row (shortened, `hourly` and `daily` hold 48 and 10 entries by default):

```json
{
  "inputIndex": 0,
  "input": "Oslo",
  "result": "ok",
  "location": "Oslo",
  "lat": 59.9127,
  "lon": 10.7461,
  "altitude": 26,
  "country": "Norway",
  "countryCode": "NO",
  "region": "Oslo",
  "timezone": "Europe/Oslo",
  "utcOffset": "+01:00",
  "resolvedFrom": "placeName",
  "updatedAt": "2026-11-21T11:29:51Z",
  "current": {"time": "2026-11-21T12:00:00+01:00", "temperatureC": 2.0, "feelsLikeC": -0.5, "windSpeedMs": 2.3,
              "windGustMs": 4.3, "humidity": 59.9, "precipitationMm": 0.0, "symbol": "clearsky_day"},
  "hourly": [
    {"time": "2026-11-21T12:00:00+01:00", "timeUtc": "2026-11-21T11:00:00Z", "periodHours": 1,
     "temperatureC": 2.0, "feelsLikeC": -0.5, "dewPointC": -5.8, "humidity": 59.9, "pressureHpa": 1005.0,
     "windSpeedMs": 2.3, "windGustMs": 4.3, "windDirection": 315.0, "cloudCover": 7.6, "fogCover": 0.0,
     "uvIndex": 0.2, "precipitationMm": 0.0, "precipitationProbability": 0.0, "thunderProbability": 0.0,
     "symbol": "clearsky_day"}
  ],
  "daily": [
    {"date": "2026-11-22", "minC": 0.3, "maxC": 3.6, "precipitationMm": 0.0, "maxWindMs": 6.0, "maxGustMs": 10.5,
     "maxPrecipitationProbability": 0.0, "maxUvIndex": 0.2, "symbol": "clearsky_day", "hoursCovered": 24,
     "fullDay": true}
  ],
  "source": "Data from MET Norway (CC BY 4.0)",
  "license": "Weather: MET Norway, NLOD 2.0 / CC BY 4.0 (https://api.met.no/doc/License). Places: GeoNames, CC BY 4.0.",
  "error": null
}
```

- Units: °C, m/s, mm, hPa, % and degrees (wind *from* direction). `symbol` is MET's weather symbol code (e.g. `lightrain_showers_day`), which maps to the [MET weather icons](https://github.com/metno/weathericons).
- `periodHours` says whether precipitation and symbol of a step cover 1 or 6 hours (later steps are 6-hourly).
- `result` is `ok` (charged), `notFound` (place name not in the list), `invalid` (bad coordinates) or `failed` (MET Norway gave no forecast). Only `ok` is charged.
- The run summary (counts, requests, cache hits) is in the `OUTPUT` record of the key-value store. Export as JSON, CSV, Excel or via API.

### Pricing

Pay per event. One event per location covers **all** hours and days you ask for:

| Event | Price |
|---|---|
| Location forecast (one location, all hourly steps and daily summaries) | **$0.002** ($2 per 1,000 locations) |
| Actor start | $0.00005 |

Free: place names that are not found, invalid coordinates, duplicates and failed forecasts. Set a maximum total charge and the run stops cleanly when it is reached (`stoppedAtMaxCharge` in the summary).

Comparison (Apify Store, 21 Nov 2026): Open-Meteo-based scrapers charge per hourly row, e.g. $0.0015 per row, so 48 hours for one city cost about $0.07; a US-only NWS scraper charges $0.01 per row. Here 48 hours plus 10 daily summaries cost $0.002. Note that Open-Meteo's free API is meant for non-commercial use; MET Norway's data licence allows commercial use with attribution.

### Accuracy and limits (please read)

- **This is a forecast, not history or official warnings.** No past weather, no severe-weather alerts. For warnings use your national weather service.
- **Gusts, precipitation probability and thunder probability are only available in MET Norway's Nordic area** (roughly the Nordic countries and the Baltic region). Elsewhere these fields are `null`. Temperature, wind, precipitation, clouds, humidity, pressure, dew point, fog and UV are available worldwide. Outside the Nordic area the forecast comes from a coarser global model (ECMWF), so local effects (mountains, coasts, cities) are smoothed.
- **City names**: only places with 15,000+ inhabitants are known; ambiguous names go to the most populous match.
- **Time zone of coordinates** is the zone of the nearest city within 300 km; at sea a nautical zone (`Etc/GMT±N`). Set `timezone` per location (object input) or for the whole run if this matters.
- **Daily totals of the 6-hour part** count each 6-hour period on the day it starts, so a period that crosses local midnight is counted on the earlier day. The first and sometimes the last day are partial (`fullDay: false`, `hoursCovered`).
- MET Norway updates forecasts about once an hour. `updatedAt` is the time of the model run.

### Fair use of MET Norway's free API

MET Norway provides this API for free and asks clients to follow its [terms of service](https://api.met.no/doc/TermsOfService). This Actor:

- identifies itself with its own User-Agent,
- rounds coordinates to 4 decimals,
- sends at most 5 requests per second,
- does not request a point again before the forecast's `Expires` time: with `useCache` on (default), forecasts are kept in a named key-value store in your Apify account (`weather-forecast-met-cache`) and reused until they expire, then revalidated with `If-Modified-Since`. You are charged for a location also when it is served from this cache (you still get the full, current forecast). You can delete that store at any time.

### FAQ

**Do I need an API key?** No.

**Can I run it on a schedule?** Yes. A daily or hourly scheduled run with `hourlyRows` gives a clean time series for a spreadsheet or database.

**How many locations per run?** Thousands. Requests are capped at 5 per second, so 1,000 locations take about 3–4 minutes.

**Fahrenheit, mph or inches?** Not yet: values are metric (°C, m/s, mm). Convert with `°F = °C × 1.8 + 32`, `mph = m/s × 2.237`, `in = mm / 25.4`.

**Why is my village not found?** Only towns with 15,000+ inhabitants are in the offline list. Use its coordinates.

### Use with AI agents / Apify MCP

Through the [Apify MCP server](https://mcp.apify.com) an AI agent can call `gazidev/weather-forecast` with `{"locations": ["Lisbon"], "output": "dailyRows", "days": 3}` and read back three compact daily rows. Use `includeHourly: false` for small answers.

### Data sources and attribution

- Weather: **Data from MET Norway** ([api.met.no](https://api.met.no), Locationforecast 2.0), licensed [NLOD 2.0 and CC BY 4.0](https://api.met.no/doc/License). Every output row carries this credit in `source` and `license`; keep it when you publish the data.
- Places: [GeoNames](https://www.geonames.org) cities15000, CC BY 4.0, bundled at build time.

This Actor is not made, endorsed or supported by MET Norway.

# Actor input Schema

## `locations` (type: `array`):

One place per line: a city name (`Berlin`, `Paris, France`, `Springfield, IL`, `London, Canada`) or coordinates (`40.7128, -74.0060`). City names are matched offline against the GeoNames list of ~34,000 cities and towns with 15,000+ people (the most populous match wins; add the country or state to pick another). For villages, farms, ships or sites use coordinates. In JSON/API input you can also pass objects: `{"name": "Site A", "lat": 59.91, "lon": 10.75, "altitude": 120, "timezone": "Europe/Oslo"}`.

## `output` (type: `string`):

`perLocation`: one row per location with nested `hourly` and `daily` arrays. `hourlyRows`: one flat row per location and time step (easy for spreadsheets and SQL). `dailyRows`: one flat row per location and day. The price is the same: one event per location.

## `hours` (type: `integer`):

How far ahead the `hourly` list goes, in hours from now (max 240). MET Norway gives hourly steps for about the next 2.5 days and 6-hour steps after that, up to about 9-10 days.

## `days` (type: `integer`):

Number of local days in the `daily` summary (min/max temperature, total precipitation, max wind and gust, max precipitation probability and UV, symbol). Today is usually a partial day (`fullDay: false`).

## `timezone` (type: `string`):

`local` (default) uses each location's own time zone (from GeoNames; for coordinates the zone of the nearest city within 300 km, at sea a nautical zone). `UTC` or any IANA name such as `America/Chicago` puts every location on that clock. Daily summaries follow this time zone. `timeUtc` is always included.

## `detail` (type: `string`):

`complete` adds wind gust, feels-like temperature, dew point, fog, UV index and precipitation/thunder probability. `compact` has only temperature, wind, humidity, pressure, cloud cover, precipitation and symbol (those other fields are then empty).

## `includeHourly` (type: `boolean`):

Only for 'One row per location'. Turn off for a small row with the current conditions and daily summary only.

## `includeDaily` (type: `boolean`):

Only for 'One row per location'.

## `skipDuplicates` (type: `boolean`):

Locations that resolve to the same point (4 decimals) are forecast and charged once.

## `useCache` (type: `boolean`):

MET Norway's terms ask clients not to fetch a point again before the forecast's `Expires` time. Responses are kept in a named key-value store in your account (`weather-forecast-met-cache`) and reused until they expire, then revalidated with If-Modified-Since. You are still charged for a location served from the cache.

## `maxLocations` (type: `integer`):

Optional cap on the number of input locations read.

## Actor input object example

```json
{
  "locations": [
    "Oslo",
    "New York",
    "Tokyo"
  ],
  "output": "perLocation",
  "hours": 48,
  "days": 10,
  "timezone": "local",
  "detail": "complete",
  "includeHourly": true,
  "includeDaily": true,
  "skipDuplicates": true,
  "useCache": true
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        "Oslo",
        "New York",
        "Tokyo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/weather-forecast").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "locations": [
        "Oslo",
        "New York",
        "Tokyo",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/weather-forecast").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    "Oslo",
    "New York",
    "Tokyo"
  ]
}' |
apify call gazidev/weather-forecast --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NZe3jT6FP4VKBUiYk/builds/ugLIegA68vvsSwBGU/openapi.json
