# Japan Law & Statute Lookup (e-Gov API v2) (`strata-mcp/japan-law-egov-lookup`) Actor

Search Japanese statutes, regulations, and official legal articles via Japan Digital Agency's e-Gov Law API v2. Supports English legal aliases (APPI, Companies Act, Labor Standards Act, Civil Code, Constitution), clean article extraction, English metadata labels, and MCP integration.

- **URL**: https://apify.com/strata-mcp/japan-law-egov-lookup.md
- **Developed by:** [Strata MCP](https://apify.com/strata-mcp) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 law 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?

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 Law & Statute Lookup (e-Gov API v2)

Fast, structured lookup of **Japanese national statutes, cabinet orders, ministerial ordinances, and individual legal articles** powered directly by **Japan Digital Agency's official e-Gov Law API v2** (`https://laws.e-gov.go.jp/api/2`).

Designed for **international legal teams, companies expanding into Japan, compliance researchers, and AI agents (MCP)**. Built with pure TypeScript and standard `fetch` (zero headless browser, zero runtime LLM calls) for sub-second-to-few-second latency, tiny memory footprint (`128–256 MB`), and predictable **Pay-Per-Event (PPE)** pricing.

***

### Key Features

- **English Legal Alias Dictionary**: Query major Japanese statutes naturally in English — including `APPI`, `Companies Act`, `Labor Standards Act`, `Civil Code`, `Constitution`, `Antimonopoly Act`, `FIEA`, `FEFTA`, `Copyright Act`, `Patent Act`, `Payment Services Act`, `Subcontract Act`, `Whistleblower Protection Act`, `Immigration Act`, and 25+ more — automatically mapped to official Japanese statutory titles.
- **Dual Operation Modes**:
  - `search`: Prioritizes official law title & abbreviation matches (`/laws`) and supplements with full-text search (`/keyword`), deduplicated and ranked by statutory authority.
  - `get_law`: Retrieves structured legal text by official e-Gov Law ID (e.g., `321CONSTITUTION`, `415AC0000000057`), official Japanese Law Number (e.g., `平成十五年法律第五十七号`), or English alias.
- **Precision Single-Article Extraction**: Pass `articleNumber` in flexible formats (`1`, `9`, `第1条`, `第九条`, `23-2`, `第23条の2`, `Article 9`) to extract only that article as clean structured JSON (paragraphs, items, subitems, and furigana-free plain text) — preventing context-window bloat for AI agents.
- **English Metadata Labels & Official Citations**: Every record includes Japanese official title, kana, law number, promulgation/enforcement dates, English statute-type translations (`Act (Statute)`, `Cabinet Order`, `Ministerial Ordinance`, etc.), official e-Gov URL (`https://laws.e-gov.go.jp/law/{law_id}`), and **PDL 1.0 / CC BY 4.0 compliant attribution**.

***

### Sample Inputs

#### 1. Default Search (Japanese Keyword)

```json
{
  "mode": "search",
  "keyword": "個人情報保護",
  "limit": 5
}
```

#### 2. Search Using an English Legal Alias

```json
{
  "mode": "search",
  "keyword": "APPI",
  "limit": 5
}
```

#### 3. Extract a Specific Article (`get_law` Mode)

Retrieve Article 9 of the Constitution of Japan (`321CONSTITUTION`):

```json
{
  "mode": "get_law",
  "lawIdOrNum": "321CONSTITUTION",
  "articleNumber": "9"
}
```

Or retrieve Article 1 of Japan's Personal Information Protection Act (APPI) by official Law Number:

```json
{
  "mode": "get_law",
  "lawIdOrNum": "平成十五年法律第五十七号",
  "articleNumber": "第1条"
}
```

***

### Sample Output JSON (`get_law` with `articleNumber`)

```json
{
  "status": "ok",
  "mode": "get_law",
  "query": {
    "lawIdOrNum": "321CONSTITUTION",
    "articleNumber": "9",
    "searchMatchSource": "direct_lookup",
    "normalizedArticleKey": "9"
  },
  "law": {
    "lawId": "321CONSTITUTION",
    "lawRevisionId": "321CONSTITUTION_19470503_000000000000000",
    "lawNum": "昭和二十一年憲法",
    "lawTitleJa": "日本国憲法",
    "lawTitleKana": "にほんこくけんぽう",
    "lawTitleEn": "The Constitution of Japan",
    "abbreviationJa": null,
    "lawType": "Constitution",
    "lawTypeJa": "憲法",
    "lawTypeEn": "Constitution",
    "categoryJa": "憲法",
    "categoryEn": "Constitution",
    "promulgationDate": "1946-11-03",
    "enforcementDate": "1947-05-03",
    "currentRevisionStatus": "CurrentEnforced",
    "currentRevisionStatusEn": "Currently Enforced",
    "repealStatus": "None",
    "repealStatusEn": "In Force (Not Repealed)",
    "lastUpdated": "2024-07-22T15:04:51+09:00",
    "lastAmendment": {
      "lawId": null,
      "lawNum": null,
      "lawTitleJa": null,
      "promulgateDate": "1946-11-03",
      "enforcementDate": "1947-05-03"
    },
    "officialUrl": "https://laws.e-gov.go.jp/law/321CONSTITUTION"
  },
  "article": {
    "articleNum": "9",
    "articleTitle": "第九条",
    "articleCaption": null,
    "paragraphs": [
      {
        "num": "1",
        "label": "1",
        "text": "日本国民は、正義と秩序を基調とする国際平和を誠実に希求し、国権の発動たる戦争と、武力による威嚇又は武力の行使は、国際紛争を解決する手段としては、永久にこれを放棄する。"
      },
      {
        "num": "2",
        "label": "2",
        "text": "前項の目的を達するため、陸海空軍その他の戦力は、これを保持しない。国の交戦権は、これを認めない。"
      }
    ],
    "plainText": "第九条　日本国民は、正義と秩序を基調とする国際平和を誠実に希求し、国権の発動たる戦争と、武力による威嚇又は武力の行使は、国際紛争を解決する手段としては、永久にこれを放棄する。\n2　前項の目的を達するため、陸海空軍その他の戦力は、これを保持しない。国の交戦権は、これを認めない。"
  },
  "englishSummary": "The Constitution of Japan (日本国憲法) — Constitution (昭和二十一年憲法), promulgated 1946-11-03, enforced 1947-05-03. Status: Currently Enforced. Extracted 第九条 (2 paragraph(s)).",
  "metadataLabelsEn": {
    "jurisdiction": "Japan (National)",
    "sourceAgency": "Digital Agency of Japan (e-Gov Law API v2)",
    "statuteTypeLabel": "Constitution",
    "statusLabel": "Currently Enforced"
  },
  "attribution": {
    "sourceJa": "出典：e-Gov法令検索（デジタル庁）（https://laws.e-gov.go.jp/law/321CONSTITUTION）",
    "sourceEn": "Source: e-Gov Law Search, Digital Agency of Japan (https://laws.e-gov.go.jp/law/321CONSTITUTION)",
    "sourceUrl": "https://laws.e-gov.go.jp/law/321CONSTITUTION",
    "license": "Public Data License 1.0 (PDL 1.0) / Government Standard Terms of Use v2.0 (CC BY 4.0 compatible)",
    "licenseUrl": "https://www.digital.go.jp/resources/open_data/public_data_license_v1.0",
    "processingNoticeJa": "e-Gov法令検索（デジタル庁）の法令API v2データを加工・構造化し、英語メタデータラベルを付与して作成（国の公式翻訳・公的証明ではありません）。",
    "processingNoticeEn": "Structured and enriched with English metadata labels by japan-law-egov-lookup based on e-Gov Law API v2 data (Digital Agency of Japan). Not an official government publication or official legal translation.",
    "retrievedAt": "2026-11-25T07:40:00.000Z"
  }
}
```

***

### Using with AI Agents (Apify MCP)

You can expose this Actor directly as a tool to **Claude Desktop, Cursor, Windsurf, or any MCP-compatible AI agent** via the [Apify MCP Server](https://mcp.apify.com/):

#### Claude Desktop / MCP Client Config Example

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "YOUR_APIFY_USERNAME/japan-law-egov-lookup"
      ],
      "env": {
        "APIFY_TOKEN": "YOUR_APIFY_API_TOKEN"
      }
    }
  }
}
```

#### Example Agent Prompts

- *"Look up Japan's APPI using japan-law-egov-lookup and fetch Article 1 and Article 2."*
- *"Find the official Japanese law ID and latest enforcement date of the Labor Standards Act."*
- *"Retrieve Article 9 of the Japanese Constitution from e-Gov Law API v2 and cite the official e-Gov URL."*

***

### Input Parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | `"search" \| "get_law"` | `"search"` | Choose keyword/title search or direct law/article retrieval. |
| `keyword` | `string` | `"個人情報保護"` | Japanese keyword, title, or English alias (used in `search` mode). |
| `lawIdOrNum` | `string` | — | Official e-Gov Law ID, Japanese Law Number, or English alias (used in `get_law` mode). |
| `articleNumber` | `string` | — | Optional article selector (e.g., `1`, `9`, `第1条`, `23-2`, `Article 9`). Returns only that article in clean JSON. |
| `limit` | `integer` | `5` | Maximum number of search results (`1`–`50`, used in `search` mode). |

***

### Pricing, Politeness & Error Handling

- **Pay-Per-Event (`law-record-retrieved`)**: Charged **1 event per successfully retrieved law record** (`status: "ok"`). Errors or unmatched queries return `status: "error"` and are **never charged**. Respects `eventChargeLimitReached` immediately to protect user budgets.
- **API Politeness**: Enforces a maximum concurrency of 2, per-host request spacing (`250 ms`), 15-second timeouts, and exponential-backoff retries on transient upstream failures.

***

### Data Source, License & Disclaimer

- **Official Source**: Powered by **e-Gov Law Search (e-Gov法令検索 / 法令API v2)** operated by the **Digital Agency of Japan (デジタル庁)**.
- **License**: e-Gov Law Search data is published under Japan's **Public Data License 1.0 (PDL 1.0)** (successor to Government Standard Terms of Use v2.0, compatible with **CC BY 4.0**), permitting commercial and non-commercial reuse and processing with proper source attribution and modification notice.
- **Disclaimer**: This Actor structures e-Gov Law API v2 responses and adds convenience English metadata labels. It is **not** an official government publication, official English translation, or legal advice. Always consult qualified Japanese legal counsel (*bengoshi*) and official e-Gov texts for binding legal decisions.

# Actor input Schema

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

Choose 'search' to search Japanese laws by Japanese keyword, law title, or common English alias (e.g., APPI, Companies Act, Civil Code), or 'get_law' to retrieve structured statutory text for a specific law ID or law number.

## `keyword` (type: `string`):

Used in 'search' mode. Accepts Japanese keywords/titles (e.g., '個人情報保護', '民法', '労働基準法') or built-in English aliases (e.g., 'APPI', 'Companies Act', 'Labor Standards Act', 'Civil Code', 'Constitution', 'Antimonopoly Act', 'FIEA').

## `lawIdOrNum` (type: `string`):

Used in 'get_law' mode. Official e-Gov Law ID (e.g., '321CONSTITUTION', '415AC0000000057'), official Japanese Law Number (e.g., '平成十五年法律第五十七号'), or a supported English alias (e.g., 'Constitution', 'APPI').

## `articleNumber` (type: `string`):

Optional article selector (e.g., '1', '9', '第1条', '第九条', '23-2', 'Article 9'). When provided, only the matching article is extracted as clean structured JSON to keep output concise and LLM-friendly.

## `limit` (type: `integer`):

Maximum number of law records to return in 'search' mode (1 to 50). Defaults to 5.

## Actor input object example

```json
{
  "mode": "search",
  "keyword": "個人情報保護",
  "lawIdOrNum": "415AC0000000057",
  "articleNumber": "1",
  "limit": 5
}
```

# Actor output Schema

## `results` (type: `string`):

JSON array of retrieved Japanese law records stored in the default dataset.

# 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": "search",
    "keyword": "個人情報保護",
    "limit": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("strata-mcp/japan-law-egov-lookup").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": "search",
    "keyword": "個人情報保護",
    "limit": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("strata-mcp/japan-law-egov-lookup").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": "search",
  "keyword": "個人情報保護",
  "limit": 5
}' |
apify call strata-mcp/japan-law-egov-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,strata-mcp/japan-law-egov-lookup"
        }
    }
}
```

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/kxIHdneUHGoSWBeaY/builds/aZ4F7QtUUbVZW7ept/openapi.json
