# Japan Weather Forecast & Warnings (JMA official data) (`jpopendata/japan-weather-jma`) Actor

Unofficial tool reading Japan Meteorological Agency (JMA) open JSON data: 3-day + weekly forecasts, warnings/advisories, and regional outlooks per prefecture, with weather and warning codes resolved to English. Public open data, no API key. Not affiliated with JMA.

- **URL**: https://apify.com/jpopendata/japan-weather-jma.md
- **Developed by:** [JP Open Data](https://apify.com/jpopendata) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 records

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

## Japan Weather Forecast & Warnings (JMA official data)

Turn the **Japan Meteorological Agency (JMA / 気象庁)** open weather feeds into clean, English-labelled records. This Actor reads JMA's own public `bosai` JSON — the same data that powers the official jma.go.jp site — and restructures it: weather codes and warning codes resolved to English, wind directions parsed to cardinals, precipitation probability and representative temperatures attached per day.

No API key. No login. Public government open data.

> **Forecasts, not observations.** For what the weather **is** right now — live temperature, rain, wind, sunshine and humidity from JMA's ~1,300 AMeDAS stations — see the sibling Actor **[Japan AMeDAS Weather Observations (JMA)](https://apify.com/jpopendata/japan-amedas-observations)**. This Actor covers what the weather **will be**.

### Quick start — verified input

Copy, paste, run. This exact input is verified on the platform (SUCCEEDED, items > 0):

```json
{
  "mode": "forecast",
  "prefecture": "Tokyo",
  "maxItems": 100
}
```

Running with **no input at all** also works (it uses the same defaults). `prefecture` is a dropdown of the 47 English prefecture names; via the API you may also pass the Japanese name (`"東京都"`), the JIS code (`"13"`), or common romanisations (`"osaka-fu"`, `"Ōsaka"`, `"Tokyo-to"`).

### What you get

Pick a **prefecture** (`Tokyo`, `13`, or `東京都`) and a **mode**:

- **`forecast`** — one record per forecast subdivision, with a merged daily `forecasts[]` array covering the 3-day near-term forecast (weather, wind, wave, precipitation probability) plus the extended weekly forecast (weather, precipitation probability, reliability grade, min/max temperature).
- **`warning`** — one record per forecast area listing the current 警報・注意報 (warnings / advisories), each with the JMA code resolved to an English name and a `severity` class (`emergency` / `warning` / `advisory`), plus `hasActiveWarning`.
- **`overview`** — the plain-language regional outlook (概況) text, passed through verbatim in Japanese with attribution.

#### Example output (forecast, one day)

```json
{
  "mode": "forecast",
  "prefectureCode": "13",
  "areaCode": "130010",
  "areaNameEn": "Tokyo Region",
  "areaNameJa": "東京地方",
  "reportDatetime": "2026-08-25T17:00:00+09:00",
  "publishingOffice": "気象庁",
  "forecasts": [
    {
      "date": "2026-08-26",
      "weatherCode": "111",
      "weatherEn": "Clear, later cloudy",
      "weatherJa": "晴後曇",
      "windDirection": "South",
      "waveJa": "0.5メートル",
      "precipProbability": 30,
      "tempMin": 26,
      "tempMax": 35,
      "reliability": null,
      "timeframe": "near_term"
    }
  ],
  "source": "気象庁 bosai JSON ... / Japan Meteorological Agency (JMA) open weather data",
  "sourceUrl": "https://www.jma.go.jp/bosai/",
  "license": "出典：気象庁ホームページ（https://www.jma.go.jp/）。...",
  "retrievedAt": "2026-08-26T12:00:00.000Z"
}
```

Every record carries the four attribution fields (`source`, `sourceUrl`, `license`, `retrievedAt`).

### Input

| Field | Description |
|-------|-------------|
| `mode` | `forecast` (default), `warning`, or `overview`. Case-insensitive. |
| `prefecture` | One of the 47 prefectures — English name (`"Tokyo"`), Japanese (`"東京都"`), or JIS code (`"13"`). Required unless `areaCode` is set. |
| `areaCode` | Optional 6-digit JMA office code (e.g. `"130000"`); overrides `prefecture`. Needed for individual Hokkaido regions (prefecture `Hokkaido` defaults to the Sapporo office `016000`). |
| `maxItems` | Max area records to output, 1–500 (default 100). |
| `maxApiRequests` | Hard per-run request cap, 1–20 (default 6). |
| `proxyConfiguration` | Apify proxy; default is a direct connection. |

Values are validated **before** the first request; an invalid value fails the run immediately with a message that lists the valid values.

#### Common input mistakes

| Mistake | Correct |
|---------|---------|
| `"prefecture": "Osaka-shi"` / `"Yokohama"` (a city) | `"prefecture": "Osaka"` / `"Kanagawa"` — prefectures only |
| `"prefecture": "Tokio"` | `"prefecture": "Tokyo"` (standard Hepburn spelling; `Tōkyō`, `Tokyo-to` are also accepted) |
| `"mode": "weather"` | `"mode": "forecast"` (or `warning` / `overview`) |
| `"areaCode": "13"` | `"areaCode": "130000"` (6 digits) — or leave it empty and set `prefecture` |
| `"maxItems": "all"` | a number, e.g. `100` |
| Wanting Kushiro/Asahikawa forecasts with `"prefecture": "Hokkaido"` | set `"areaCode"` to that office (e.g. `"014100"` 釧路・根室, `"012000"` 上川・留萌) |

#### Empty results?

A valid prefecture always yields at least one record in every mode (warning mode emits a record per area with `hasActiveWarning: false` when nothing is in force). Zero records only happen when `areaCode` is a code JMA does not publish a feed for (e.g. a sub-area code instead of an office code) — the run then ends with 0 items and a warning in the log (or the upstream HTTP 404 error). Use `prefecture` instead, or take the office code from https://www.jma.go.jp/bosai/common/const/area.json (`offices`).

### How it fetches (politeness)

A single sequential connection, **≥ 1.2 s between requests**, exponential backoff on 429/5xx, and a hard per-run request budget. A normal run makes only ~2 requests (the area-name index plus one feed). The Actor never evades a block: on a persistent 429 it fails visibly rather than hammering the server.

### Attribution, terms & disclaimer

- **Public open data.** JMA website content is provided under the 公共データ利用規約（第1.0版）(Public Data License 1.0), which permits copying, adaptation, and **commercial** use provided the source is displayed. The required credit — **出典：気象庁** — is embedded verbatim in every record's `license` field. See the [JMA terms of use](https://www.jma.go.jp/jma/kishou/info/coment.html).
- **Unofficial — not affiliated.** This is an independent tool. It is **not** affiliated with, endorsed by, or operated by the Japan Meteorological Agency.
- **Edited / adapted.** Per the terms, note that this tool **edits and adapts** JMA data (structuring Japanese data into English); it does not present the data as if produced by JMA. It redistributes JMA-published values; it is **not a forecasting service** (気象業務法第17条) and does **not itself issue warnings** (第23条). For life-safety decisions, always consult the official JMA site.
- **Your responsibility.** You are responsible for your own compliance with the JMA website terms and any applicable law (including data-protection law such as the GDPR) in how you use the output. The data is aggregate meteorology and contains no personal data.

### Search terms

japan weather api · jma forecast data · japan weather warnings english · japan meteorological data · 気象庁 json · japan weather forecast scraper · tokyo weather api · japan rain probability · japan weather alerts

# Actor input Schema

## `mode` (type: `string`):

What to fetch. `forecast` = 3-day + weekly forecast per area (default). `warning` = current warnings/advisories (警報・注意報) per area. `overview` = the plain-language regional outlook text. Example: "forecast".

## `prefecture` (type: `string`):

Prefecture to fetch (required unless areaCode is set). Pick one of the 47 prefectures by English name, e.g. "Tokyo", "Osaka", "Hokkaido". The API also accepts the Japanese name ("東京都") or the JIS code ("13"). Note: Hokkaido defaults to the Sapporo office — use areaCode for other Hokkaido regions.

## `areaCode` (type: `string`):

Optional (advanced). 6-digit JMA forecast office code, e.g. "130000" (Tokyo), "016000" (Sapporo), "270000" (Osaka). Overrides `prefecture`. Find codes in https://www.jma.go.jp/bosai/common/const/area.json (offices). Leave empty to use `prefecture`.

## `maxItems` (type: `integer`):

Maximum number of area records to output (1-500). A prefecture has ~1-4 forecast subdivisions; overview mode always outputs 1. Example: 100.

## `maxApiRequests` (type: `integer`):

Hard safety cap on requests to www.jma.go.jp per run (1-20; a normal run needs ~2: area index + feed). Politeness (1 connection, >= 1.2 s spacing, exponential backoff on 429/5xx) is enforced in code. Example: 6.

## `proxyConfiguration` (type: `object`):

Apify proxy settings. Default is NO proxy (direct connection) — a public JSON feed rarely needs one. The Actor backs off exponentially on 429/5xx and fails visibly on a persistent block; it never attempts rate-limit evasion.

## Actor input object example

```json
{
  "mode": "forecast",
  "prefecture": "Tokyo",
  "maxItems": 100,
  "maxApiRequests": 6,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

JMA weather records (forecast / warning / overview) with source attribution (source, sourceUrl, license, retrievedAt) on every item.

# 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 = {
    "mode": "forecast",
    "prefecture": "Tokyo",
    "maxItems": 100,
    "maxApiRequests": 6
};

// Run the Actor and wait for it to finish
const run = await client.actor("jpopendata/japan-weather-jma").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 = {
    "mode": "forecast",
    "prefecture": "Tokyo",
    "maxItems": 100,
    "maxApiRequests": 6,
}

# Run the Actor and wait for it to finish
run = client.actor("jpopendata/japan-weather-jma").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 '{
  "mode": "forecast",
  "prefecture": "Tokyo",
  "maxItems": 100,
  "maxApiRequests": 6
}' |
apify call jpopendata/japan-weather-jma --silent --output-dataset

```

## MCP server setup

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

```

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/2cgpN8lFmBxvcnm2q/builds/kAJWGuFkzxpWYJKPX/openapi.json
