# Japan e-Stat MCP

> Japan e-Stat connects your agent to the official Japanese government statistics portal. It lets you search across thousands of topics—like population, GDP, industrial output, and trade—and pull raw numerical data from specific tables. You don't have to navigate foreign databases or copy-paste spreadsheets; your AI client gets the numbers directly.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** economic-statistics, census-data, market-intelligence, public-data

## Description

This MCP connects your agent to the e-Stat Portal, Japan's primary source for national statistics. Getting reliable economic and demographic data used to mean sifting through dense government websites, dealing with foreign language interfaces, and manually cross-referencing spreadsheets. Now, you simply ask your AI client what specific numbers you need—say, population changes in Osaka or the year-over-year CPI index. The MCP finds the relevant data tables across multiple ministries and pulls the raw figures for you. You can access these powerful resources from anywhere by connecting via Vinkius, giving your agent a reliable view into global macro analysis. It's essential for anyone doing trade research or market intelligence on Asia.

## Tools

### get_japan_stats_data
Retrieves raw statistical data from a specific Japanese e-Stat table using a known ID, classifying results by area and time.

### search_japan_statistics
Searches the entire e-Stat database for relevant tables, returning IDs and titles for topics like GDP or employment.

## Prompt Examples

**Prompt:** 
```
Find Japanese population statistics by prefecture.
```

**Response:** 
```
I've searched e-Stat for population data by prefecture. Found 15 relevant tables from the Statistics Bureau. The most recent census table (ID: 0003448237) shows Tokyo at 14.0 million, Kanagawa at 9.2 million, and Osaka at 8.8 million. Japan's total population stands at approximately 125.5 million.
```

**Prompt:** 
```
Fetch the latest Consumer Price Index (CPI) data for Tokyo.
```

**Response:** 
```
I retrieved the latest CPI data for the Ku-area of Tokyo. The all-items index currently stands at 106.5 (2020=100), representing a 2.4% year-over-year increase, driven primarily by rising food and energy costs.
```

**Prompt:** 
```
Show me the industrial production index for the automotive sector.
```

**Response:** 
```
According to the latest METI data from e-Stat, the Indices of Industrial Production (IIP) for the motor vehicles, parts, and accessories sector rests at 98.2, showing a slight month-over-month decrease of 1.1%.
```

## Capabilities

### Search Japanese data sources
Find the specific table IDs and topics across various Japanese government ministries using keywords.

### Extract raw statistical values
Pull precise, structured numerical data from a known Japanese e-Stat table, classified by area or time period.

## Use Cases

### Modeling population shifts
A researcher needs to compare Tokyo’s 2015 population numbers with its 2023 figures. They first use `search_japan_statistics` for 'population' to get the correct table ID, then feed that ID into `get_japan_stats_data` specifying the desired years and regions.

### Tracking trade performance
A consultant needs a quick comparison of commodity exports in 2022 versus 2023. They use `search_japan_statistics` for 'foreign trade' to find the table ID, then run `get_japan_stats_data` using that ID and specifying both years and key product categories.

### Assessing industrial health
An analyst wants to know if the auto sector is slowing down. They search for 'industrial production' with `search_japan_statistics`, find the relevant index table, and then use `get_japan_stats_data` to pull the latest month-over-month figures.

### Calculating CPI trends
You need to track inflation. You search for 'Consumer Price Index' using `search_japan_statistics`, get the table ID, and then use `get_japan_stats_data` to pull the index values over a decade.

## Benefits

- Stop struggling with foreign government websites. Use `search_japan_statistics` to find the right table ID, even if you only know a general topic like 'industrial production.'
- Avoid manual data scraping entirely. Once you have the ID, `get_japan_stats_data` pulls structured numbers for multiple areas and dates in one go.
- Analyze diverse metrics—from population counts to foreign trade figures. The MCP covers key national accounts across various Japanese ministries.
- The API supports English translations where available. You don't have to rely on perfect Japanese keywords; your agent handles the complexity.
- This tool is vital for global macro analysis, giving you access to some of the world's most reliable and detailed economic statistics.

## How It Works

The bottom line is: You use the search tool first to find what's available, then the data retrieval tool to actually pull the specific figures you need.

1. First, use the search tool to run keywords (like 'GDP' or 'population') across the entire database. This returns a list of relevant tables and their unique IDs.
2. Next, take a specific Table ID from that list. You feed this ID into the data retrieval function, specifying the exact time periods and geographical areas you need.
3. The MCP sends the query to e-Stat and brings back a clean dataset containing the raw numbers, ready for your agent to analyze.

## Frequently Asked Questions

**How do I get an e-Stat API key?**
Register for a free account at e-stat.go.jp, then visit your My Page to generate an Application ID (appId). Approval is instant.

**Is the data available in English?**
Many tables support English translations for table titles and category names. The API uses lang=E by default. Some specialized datasets may only be available in Japanese.

**What types of statistics are covered?**
The database covers national census data, labor force surveys, consumer price indices (CPI), trade statistics, industrial production, health, and education metrics published by all Japanese government ministries.

**When should I run `search_japan_statistics` before using `get_japan_stats_data`?**
Always use `search_japan_statistics` first to get the necessary table ID. This initial search returns available organization names, titles, and survey dates, allowing you to identify the precise Table ID required for accurate data retrieval with `get_japan_stats_data`.

**What happens if I request data outside a known period using `get_japan_stats_data`?**
The MCP will return an error or an empty dataset. Check the specific time periods and geographical areas available for that table ID, as the API requires valid dates to pull raw numbers.

**Are there any rate limits I should be aware of when calling `search_japan_statistics`?**
Yes, standard API rate limits apply. We recommend managing your calls sequentially and implementing a small delay between requests to ensure reliable access across multiple data points.

**Can the keywords used in `search_japan_statistics` handle complex or combined concepts?**
Yes, the search function accepts both English and Japanese keywords. You can use these broad terms to locate relevant tables that cover specific combinations of topics like 'employment' and 'industry'.

**What level of detail does `get_japan_stats_data` provide regarding classification?**
The tool returns fully classified raw numerical data. Every dataset pulled is structured by category, geographic area, and specific time periods, giving you granular metrics for analysis.