# Japan Macro Economy & Demographics API (Official e-Stat) (`japan-data-bridge/japan-macro-statistics-api`) Actor

Official Japan macroeconomic, inflation (CPI), GDP, labor, wage, population, and inbound tourism time-series API in English JSON via e-Stat Statistics Dashboard. No API key required. Built for global investors, market research, and AI/MCP agents.

- **URL**: https://apify.com/japan-data-bridge/japan-macro-statistics-api.md
- **Developed by:** [Japan Open Data Bridge](https://apify.com/japan-data-bridge) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Japan Macro Economy & Demographics API (Official e-Stat Bridge)

> **Launch Beta Notice:** Currently **free to use** during our initial launch period while we benchmark usage across AI agents and research workflows. Pay-per-result pricing may be introduced in the future with Apify's standard 14-day advance notice.

Retrieve official **Japanese macroeconomic, inflation (CPI), GDP, labor market, nominal wage, demographic, and inbound tourism time-series statistics** in clean, structured **English JSON** directly from the Government of Japan's **e-Stat Statistics Dashboard API** (`dashboard.e-stat.go.jp`).

**Zero API key registration required.** Designed for global quant researchers, macro investors, cross-border market-entry analysts, and **AI / MCP agents** that need authoritative Japanese government numbers without wrestling with 19-digit Japanese series codes, 8-character cycle timestamps, or JIS regional classifications.

***

### Why Use This Actor?

Japan's official Statistics Dashboard aggregates over **5,800 government time series** across the Ministry of Internal Affairs and Communications (MIC), Cabinet Office, Ministry of Health, Labour and Welfare (MHLW), Ministry of Economy, Trade and Industry (METI), and Japan Tourism Agency (MLIT). However, direct integration poses several hurdles for international teams and LLM tool-calling pipelines:

1. **Cryptic 19-Digit Series Codes:** Finding Bank of Japan's core inflation benchmark (`0703010501010030010`) vs. headline CPI (`0703010501010090000`) requires navigating nested metadata hierarchies.
2. **Strict Cycle-Coupled Time Filters:** Passing a monthly date (`20240100`) to a quarterly series like Real GDP (`20241Q00`) or an annual prefecture series (`2024CY00`) causes raw API calls to return empty results or HTTP 404 errors.
3. **Subnational Quirks & JIS Codes:** Regional queries require 5-digit JIS prefecture codes (`01000`–`47000`), while urban-only surveys like Tokyo CPI report under `13100` (*Ku-area of Tokyo*) rather than `13000`.

This bridge solves all three automatically—providing **curated English presets**, **flexible ISO/human date parsing**, **English prefecture resolution**, and **typed numeric records**.

***

### Curated English Presets (`indicatorPreset`)

| Preset Key | Official 19-Digit Code | Series Description | Unit | Primary Frequency | Subnational Support |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `cpi_all_items` | `0703010501010090000` | Consumer Price Index (All Items, 2020=100) | `index (2020=100)` | Monthly | National & Major Cities (`13100` Tokyo) |
| `cpi_core_yoy` | `0703010501010030010` | Core CPI Inflation YoY % (All Items Less Fresh Food — BOJ Benchmark) | `%` | Monthly | National & Major Cities |
| `unemployment_rate` | `0301010000020020010` | Unemployment Rate (Both Sexes) | `%` | Monthly | National |
| `job_openings_ratio` | `0301020001000010010` | Active Job Openings-to-Applicants Ratio | `ratio (times)` | Monthly | National & All 47 Prefectures |
| `monthly_wages` | `0302020000000010000` | Monthly Total Cash Earnings per Employee (Nominal Wages) | `JPY` | Monthly | National |
| `total_population` | `0201010000000010000` | Total Population (National Monthly & Prefecture Annual) | `persons` | Monthly / Annual | National & All 47 Prefectures |
| `real_gdp` | `0705020501000010000` | Real GDP (Expenditure Approach, 2020 Chained Yen) | `billion JPY` | Quarterly | National |
| `inbound_visitors` | `0204030003000010010` | Inbound Foreign National Entries / Arrivals | `persons` | Monthly | National |
| `inbound_hotel_nights` | `1003010201000110000` | Inbound Foreign Overnight Hotel Stays | `person-nights` | Monthly | National & All 47 Prefectures |
| `retail_sales` | `0601010201010010000` | Retail Sales Value (Nominal Commercial Sales) | `billion JPY` | Monthly | National |
| `macro_dashboard_bundle` | *(8 Core Series)* | Fetches latest observations across 8 headline Japan macro indicators in one run | Mixed | Mixed | National |
| `custom` | *(Any of 5,800+ series)* | Supply any 19-digit `indicatorCode` **or** an English search keyword | Auto | Auto | Series-dependent |

***

### Input Parameters

- **`indicatorPreset`** *(select, default: `cpi_all_items`)*: Choose one of the verified macroeconomic presets above, `macro_dashboard_bundle` for an instant 8-series macro snapshot, or `custom`.
- **`indicatorCode`** *(string, optional)*:
  - Enter any official 19-digit e-Stat IndicatorCode (or comma-separated codes such as `0703010501010030010,0301010000020020010`).
  - **English Keyword Discovery:** You can also enter plain English terms (e.g. `fertility`, `housing starts`, `foreign residents`) to automatically search all 5,800+ official indicators and retrieve the top active series.
- **`regionCode`** *(string, default: `00000`)*:
  - `00000` or `Japan` — National total
  - English prefecture name (`Tokyo`, `Osaka`, `Kyoto`, `Hokkaido`, `Fukuoka`, `Okinawa`, etc.) or 5-digit JIS code (`13000`, `27000`, `26000`, `01000`)
  - `ALL_PREFECTURES` — Retrieve all 47 Japanese prefectures in a single call (ideal for `total_population`, `inbound_hotel_nights`, and `job_openings_ratio`)
- **`timeFrom`** *(string, default: `20230100`)*:
  - Accepts e-Stat 8-character codes (`20230100`, `20231Q00`, `2022CY00`, `2022FY00`) **and** standard human/ISO formats (`2023`, `2024-01`, `2023-Q1`). Automatically adapts to monthly, quarterly, or annual cycles.
- **`seasonalityFilter`** *(select, default: `all`)*: Choose `all`, `seasonally_adjusted`, or `original`.
- **`maxItems`** *(integer, default: `100`)*: Maximum records returned, sorted **newest-first** so small limits (e.g. `maxItems: 12`) always deliver the most recent observations.

***

### Example Usage Scenarios

#### 1. Track Bank of Japan Core CPI Inflation (`cpi_core_yoy`)

```json
{
  "indicatorPreset": "cpi_core_yoy",
  "regionCode": "00000",
  "timeFrom": "2024-01",
  "maxItems": 24
}
```

#### 2. Regional Inbound Tourism Demand Across All 47 Prefectures

```json
{
  "indicatorPreset": "inbound_hotel_nights",
  "regionCode": "ALL_PREFECTURES",
  "timeFrom": "2025-01",
  "maxItems": 200
}
```

#### 3. Complete Japan Macro Snapshot for an AI / MCP Agent

```json
{
  "indicatorPreset": "macro_dashboard_bundle",
  "timeFrom": "2025-01",
  "seasonalityFilter": "seasonally_adjusted",
  "maxItems": 40
}
```

***

### Output Record Example

```json
{
  "period": "2026-10",
  "periodLabel": "Oct 2026",
  "rawTimeCode": "20261000",
  "frequency": "Monthly",
  "indicatorPreset": "cpi_core_yoy",
  "indicatorCode": "0703010501010030010",
  "indicatorName": "Core CPI Inflation YoY % (All Items Less Fresh Food, BOJ Benchmark)",
  "officialIndicatorNameEn": "(Changes from same month of previous year (%)) Consumer Price Index (All items, less fresh food) 2020 base",
  "indicatorNameJa": "（前年同月比）消費者物価指数（生鮮食品を除く総合）2020年基準",
  "category": "Inflation & Prices",
  "value": 2.3,
  "rawValue": "2.3",
  "unit": "%",
  "seasonality": "Original Series",
  "isSeasonallyAdjusted": false,
  "isProvisional": false,
  "regionCode": "00000",
  "regionName": "Japan (National)",
  "regionRank": "National",
  "surveySource": "Consumer Price Index (Ministry of Internal Affairs and Communications)",
  "sourceCredit": "Statistics Dashboard (Ministry of Internal Affairs and Communications, Japan)",
  "sourceUrl": "https://dashboard.e-stat.go.jp/",
  "fetchedAt": "2026-11-22T17:40:00Z"
}
```

***

### Attribution & Terms of Use

This Actor retrieves public statistical data provided under the **Government of Japan Standard Terms of Use (Version 2.0)**, which is compatible with the **Creative Commons Attribution License 4.0 (CC BY 4.0)**. This service is an independent data bridge and is not endorsed by or affiliated with the Government of Japan or the Ministry of Internal Affairs and Communications.

Source: Statistics Dashboard (Ministry of Internal Affairs and Communications, Japan) — https://dashboard.e-stat.go.jp/ (Edited/structured into English JSON by Japan Open Data Bridge)

# Actor input Schema

## `indicatorPreset` (type: `string`):

Choose a verified Japanese government statistical series, 'macro_dashboard_bundle' for an 8-indicator macro snapshot, or 'custom' to use Indicator Code / Keyword below.

## `indicatorCode` (type: `string`):

Optional 19-digit e-Stat Statistics Dashboard IndicatorCode (e.g. '0703010501010090000', comma-separated codes allowed) or an English keyword (e.g. 'fertility', 'housing starts') to search 5,800+ official series. Overrides preset when non-empty.

## `regionCode` (type: `string`):

Use '00000' (or 'Japan') for National data, a 5-digit JIS code or English prefecture name (e.g. '13000' or 'Tokyo', '27000' or 'Osaka', '26000' or 'Kyoto', '01000' or 'Hokkaido'), or 'ALL_PREFECTURES' to fetch all 47 prefectures at once.

## `timeFrom` (type: `string`):

Start time filter. Accepts e-Stat 8-char codes ('20230100', '20231Q00', '2022CY00', '2022FY00') as well as ISO/human formats ('2023', '2023-01', '2023-Q1'). Automatically adapts to monthly, quarterly, or annual series.

## `seasonalityFilter` (type: `string`):

Filter series by seasonal adjustment when an indicator publishes both Original and Seasonally Adjusted series.

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

Maximum number of time-series observations to output (sorted newest-first so smaller limits always return the latest available data).

## Actor input object example

```json
{
  "indicatorPreset": "cpi_all_items",
  "indicatorCode": "",
  "regionCode": "00000",
  "timeFrom": "20230100",
  "seasonalityFilter": "all",
  "maxItems": 100
}
```

# Actor output Schema

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

Dataset items containing structured Japanese macroeconomic, labor, demographic, and inbound tourism statistics in English JSON.

# 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 = {
    "indicatorCode": "",
    "regionCode": "00000",
    "timeFrom": "20230100"
};

// Run the Actor and wait for it to finish
const run = await client.actor("japan-data-bridge/japan-macro-statistics-api").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 = {
    "indicatorCode": "",
    "regionCode": "00000",
    "timeFrom": "20230100",
}

# Run the Actor and wait for it to finish
run = client.actor("japan-data-bridge/japan-macro-statistics-api").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 '{
  "indicatorCode": "",
  "regionCode": "00000",
  "timeFrom": "20230100"
}' |
apify call japan-data-bridge/japan-macro-statistics-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,japan-data-bridge/japan-macro-statistics-api"
        }
    }
}
```

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/AcFIjx2CzEacPA7VJ/builds/x1LFGaakk1p8g4MtQ/openapi.json
