# Weather Forecast and History by Place Name (`gubidonius/weather-forecast`) Actor

Hourly weather for any place, by name or coordinates, up to 16 days ahead and 92 days back. Every row carries both the local time and a real UTC instant, so readings from different locations are actually comparable. No key and no login.

- **URL**: https://apify.com/gubidonius/weather-forecast.md
- **Developed by:** [Gregory Bolshakov](https://apify.com/gubidonius) (community)
- **Categories:** Developer tools, MCP servers, Agents
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Weather Forecast and History by Place Name

Hourly weather for any place, given a name or a coordinate pair. Up to 16 days ahead and 92
days back, in one flat table.

### The timestamp problem, which is the reason this exists

Open-Meteo returns the same timestamp string whether it answered in GMT or in Tokyo. Only a
separate `utc_offset_seconds` field says which moment it is.

```
Tokyo    localTime 2026-08-30T00:00   really 2026-08-29T15:00Z
London   localTime 2026-08-30T00:00   really 2026-08-30T00:00Z
```

Put two locations in one table and the timestamps look comparable and are not. Sort by them
and you get nonsense. Join two locations on time and you join the wrong hours together.

Every row here carries both. `localTime` is the reading in the location's own clock, which
is what you want for a chart of one place. `utcTime` is the real instant, which is what you
need the moment there is more than one location in the file.

### Place names

Type `London`, or `51.5,-0.13` if you already know the point.

A bare name that matches several places resolves to the most populated one, and the run
summary lists the rest under `otherPlacesWithThisName`. Springfield is five real towns in
the United States alone. Pass coordinates when you need a specific one.

A name that matches nothing is reported as not found. It is never quietly resolved to
somewhere nearby.

### Null is not zero

A null reading means the model has no value for that hour. It is left null rather than
filled with a zero, which matters most for precipitation, where zero is a real and very
common answer and the two are easy to confuse.

Units are recorded on every row, because they depend on which variables you asked for.

### Output

One row per location per hour. Location, coordinates, elevation, timezone, both timestamps,
then one column per variable you selected.

### Access

Free, no key, no login. Ten rapid requests with no pacing all returned 200, so it does not
throttle at the rate this Actor works at.

# Actor input Schema

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

A place name such as London, or a coordinate pair such as 51.5,-0.13. A bare name that matches several places resolves to the most populated one, and the others are listed in the run summary.

## `variables` (type: `array`):

Each becomes its own column. Units are recorded on every row.

## `forecastDays` (type: `integer`):

How far forward to forecast. The model produces up to 16 days.

## `pastDays` (type: `integer`):

Include recent history alongside the forecast, up to 92 days back.

## Actor input object example

```json
{
  "locations": [
    "London",
    "Tokyo",
    "40.71,-74.01"
  ],
  "variables": [
    "temperature_2m",
    "precipitation",
    "wind_speed_10m"
  ],
  "forecastDays": 3,
  "pastDays": 0
}
```

# Actor output Schema

## `readings` (type: `string`):

Hourly weather with both local and UTC timestamps.

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

What each name resolved to, and which other places share that name.

# 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": [
        "London",
        "Tokyo",
        "40.71,-74.01"
    ],
    "variables": [
        "temperature_2m",
        "precipitation",
        "wind_speed_10m"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gubidonius/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": [
        "London",
        "Tokyo",
        "40.71,-74.01",
    ],
    "variables": [
        "temperature_2m",
        "precipitation",
        "wind_speed_10m",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("gubidonius/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": [
    "London",
    "Tokyo",
    "40.71,-74.01"
  ],
  "variables": [
    "temperature_2m",
    "precipitation",
    "wind_speed_10m"
  ]
}' |
apify call gubidonius/weather-forecast --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gubidonius/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/BjVXbZJX63uku3PJS/builds/xnreTgcgKQC81CNeV/openapi.json
