# Weather API — forecast, history & air quality (no key) (`synthetic.ia/open-meteo-weather`) Actor

Global weather forecast, historical weather and air quality by city name or coordinates, via Open-Meteo open data. No API key. Clean HTTP API + MCP. Pay per query.

- **URL**: https://apify.com/synthetic.ia/open-meteo-weather.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 weather queries

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 API — forecast, history & air quality (no key)

Get **global weather over a clean HTTP API** — forecast, past weather and air quality — by **city name or coordinates**. Powered by Open-Meteo's open data, wrapped so you just pass a city and get clean JSON: no API key, no separate geocoding step, no signup. Pay per query.

- 🌦️ **Forecast** — up to 16 days, current conditions + daily (temp, precip, wind, UV, sunrise/sunset)
- 🏙️ **By city name** — "Tokyo", "Buenos Aires" — auto-geocoded to coordinates for you (or pass lat/lon)
- 🕰️ **History** — past weather for any date range (80+ years of archive)
- 🌫️ **Air quality** — PM2.5, PM10, ozone, NO₂, US & European AQI
- 📍 **Geocode** — turn a place name into coordinates + timezone
- ⚡ HTTP API (Standby) + usable from AI agents (MCP)

### Sample output (forecast)

```json
{
  "ok": true,
  "place": { "name": "Tokyo", "country": "Japan", "latitude": 35.69, "longitude": 139.69, "timezone": "Asia/Tokyo" },
  "current": { "temperature_2m": 19.0, "weather_code": 1, "wind_speed_10m": 8.3, "relative_humidity_2m": 64 },
  "daily": { "time": ["2026-09-18","2026-09-19","2026-09-20"], "temperature_2m_max": [24.1,25.0,22.8], "precipitation_sum": [0,1.2,5.4] }
}
```

### How to use

#### HTTP API (Standby — recommended)

Base URL: `https://synthetic-ia--open-meteo-weather.apify.actor` with header `Authorization: Bearer <APIFY_TOKEN>`.

| Endpoint | Body | Does |
|---|---|---|
| `POST /forecast` | `{ city \| latitude,longitude, days?: 1-16, current?, daily?, hourly?, temperatureUnit? }` | Weather forecast |
| `POST /history` | `{ city \| latitude,longitude, start_date, end_date, daily?, hourly? }` | Past weather |
| `POST /air-quality` | `{ city \| latitude,longitude, current?, hourly? }` | Air quality |
| `POST /geocode` | `{ name, count?: 1-20, language? }` | Place → coordinates |
| `GET /` | — | Endpoint list |

`GET /forecast?city=Paris&days=3` also works (query-string form).

```bash
## 3-day forecast for a city (auto-geocoded)
curl -X POST ".../forecast" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"city":"Buenos Aires","days":3}'

## Air quality
curl -X POST ".../air-quality" -H "Authorization: Bearer $APIFY_TOKEN" -d '{"city":"Delhi"}'

## Past weather for a date range at coordinates
curl -X POST ".../history" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"latitude":40.71,"longitude":-74.01,"start_date":"2026-01-01","end_date":"2026-01-31"}'
```

### Input

- **operation** — `forecast`, `history`, `air-quality` or `geocode`.
- **city** — place name (auto-geocoded). Or **latitude** + **longitude**.
- **days** — forecast length (1-16). **start\_date**/**end\_date** — history range (YYYY-MM-DD).
- **current / daily / hourly** — comma-separated Open-Meteo variables (empty = sensible defaults). See [open-meteo.com docs](https://open-meteo.com/en/docs) for variable names.
- **temperatureUnit** — `celsius` or `fahrenheit`.

### Pricing

**Per query** from **$0.01** (drops to $0.003 on higher tiers). Platform usage included. A `/forecast` by city does the geocoding + weather in one query fee.

### Related Actors

- **[ESPN Sports Data API](https://apify.com/synthetic.ia/espn-sports-api)** & **[Yahoo Finance API](https://apify.com/synthetic.ia/yahoo-finance-api)** — more clean no-key data APIs.

### FAQ

**Do I need a key?** No. Open-Meteo is open data and we handle geocoding too.

**How far back does history go?** Decades — Open-Meteo's reanalysis archive covers 80+ years.

**Which variables can I request?** Any Open-Meteo variable (temperature\_2m, precipitation, wind\_gusts\_10m, uv\_index, soil\_moisture…). Pass them in `current`/`daily`/`hourly`.

### Legal

Weather data by [Open-Meteo](https://open-meteo.com) (open data). Use is subject to their terms; attribute Open-Meteo where appropriate.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/open-meteo-weather/changelog.md

# Actor input Schema

## `operation` (type: `string`):

What to fetch.

## `city` (type: `string`):

Place name — auto-geocoded to coordinates. For Geocode, this is the search text.

## `latitude` (type: `string`):

Instead of a city: -90 to 90.

## `longitude` (type: `string`):

Instead of a city: -180 to 180.

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

Forecast: how many days (1-16).

## `start_date` (type: `string`):

History: YYYY-MM-DD.

## `end_date` (type: `string`):

History: YYYY-MM-DD.

## `current` (type: `string`):

Comma list, e.g. temperature\_2m,weather\_code,wind\_speed\_10m. Empty = sensible defaults.

## `daily` (type: `string`):

Comma list, e.g. temperature\_2m\_max,precipitation\_sum. Empty = sensible defaults.

## `hourly` (type: `string`):

Comma list (optional), e.g. temperature\_2m,precipitation.

## `temperatureUnit` (type: `string`):

Celsius or Fahrenheit.

## Actor input object example

```json
{
  "operation": "forecast",
  "city": "Berlin",
  "days": 7,
  "temperatureUnit": "celsius"
}
```

# Actor output Schema

## `result` (type: `string`):

The query result JSON.

## `runs` (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 = {
    "latitude": "",
    "longitude": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/open-meteo-weather").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 = {
    "latitude": "",
    "longitude": "",
}

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/open-meteo-weather").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 '{
  "latitude": "",
  "longitude": ""
}' |
apify call synthetic.ia/open-meteo-weather --silent --output-dataset

```

## MCP server setup

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

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/qJNq40zwA7LFIT3O1/builds/cbMfcpDVKZvP2iwXa/openapi.json
