# Japan Law Data — e-Gov + official English translations (`epiconetic/japan-law-data`) Actor

Japanese legislation from the official e-Gov law index: 9,500+ statutes, cabinet orders, ministerial ordinances, rules and the Constitution, with law numbers, promulgation dates, categories and in-force status, joined with the Ministry of Justice's official English translations.

- **URL**: https://apify.com/epiconetic/japan-law-data.md
- **Developed by:** [dedy iskandar](https://apify.com/epiconetic) (community)
- **Categories:** Business, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 legislation records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Data — e-Gov + official English translations

Scrape **Japanese legislation** from the official [e-Gov law index](https://laws.e-gov.go.jp/) and join it with the **Ministry of Justice's official English translations** from [japaneselawtranslation.go.jp](https://www.japaneselawtranslation.go.jp/) — into clean, structured JSON.

Every record is normalised to the **same schema**: e-Gov law id, official law number (`昭和二十五年法律第百三十二号`), promulgation date, subject category, in-force/repeal status, and — where the Ministry of Justice has published one — the **official English title and law number** (`Broadcasting Act`, `Act No. 132 of 1950`).

> **Official translation, not machine translation.** The English titles and law numbers in this dataset come from the Ministry of Justice's own translation database — the same source Japanese lawyers and courts use. Nothing here is machine-translated, and no LLM is involved in the pipeline.

No proxies, no browser, no API key, no AI summarisation. The e-Gov API is public and keyless, and the English translation index is shipped offline with the Actor.

***

### What you get

| What | Detail |
| --- | --- |
| **Coverage** | 9,577 statutes, ordinances, ministerial rules and the Constitution of Japan |
| **Instrument types** | Acts (2,145), Cabinet Orders (2,432), Ministerial Ordinances (4,453), Rules (454), Imperial Orders (71), Constitution (1) |
| **Official numbers** | `昭和二十五年法律第百三十二号` and `Act No. 132 of 1950` — exactly as the sources publish them |
| **Official English** | English title, law number, latest translated version and link to the Ministry of Justice page for 2,261 statutes (23.6% of the corpus) |
| **Dates** | Normalised to ISO-8601 (`YYYY-MM-DD`) |
| **In-force status** | `inForce`, `repealStatus`, `repealDate` — derived from repeal status + revision status, never from e-Gov's `remain_in_force` (which is always `false`) |
| **Amendment trail** | Amending law number, title, promulgation date and enforcement date |
| **Subject categories** | All 50 e-Gov categories (`民事`, `労働`, `国税`, `環境保全`, …) |
| **Deterministic ids** | `id` = the e-Gov `law_id` (`325AC0000000132`), stable across runs |
| **No duplication** | Records are de-duplicated in-flight and across resumed runs |
| **Optional full text** | Turn on `includeFullText` for the Japanese article text and the official English text, article by article |
| **Resumable** | Progress is stored per user, so a long corpus crawl can continue in the next run |

***

### Sources

| Source | What it provides | How it is used |
| --- | --- | --- |
| [e-Gov Law Index](https://laws.e-gov.go.jp/api/2/laws) | The authoritative statute list: law id, law number, era, promulgation date, category, repeal status | Paged at runtime (100 records/page) |
| [e-Gov law detail](https://laws.e-gov.go.jp/api/2/law_data/{law_id}) | Full Japanese article text | Only when `includeFullText` is on |
| [Japan Law Translation](https://www.japaneselawtranslation.go.jp/) | Ministry of Justice English titles, law numbers and translated text | Offline index for metadata; live fetch only for English full text |

The English translation index (2,344 statute families) is **packaged inside the Actor** (`src/data/jlt-index.json`, generated 2026-11-20), so English titles cost zero requests. Only the English *full text* is fetched live, from the Ministry of Justice's bilingual `.txt` download.

***

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `includeEnglish` | boolean | `true` | Attach the official English title and law number where a translation exists. |
| `includeFullText` | boolean | `false` | Also fetch the Japanese article text (`fullText`) and the official English text (`fullTextEn`). |
| `includeRepealed` | boolean | `false` | Include repealed/expired statutes (571). When off, the filter is applied server-side by e-Gov. |
| `refresh` | boolean | `false` | Bulk-refresh mode: cheap Japanese metadata only, for scheduled re-index jobs. |
| `search` | string | `""` | Keyword matched against the Japanese title, law number, category **and** the English title/law number. |
| `lawTypes` | array | `[]` | `Act`, `CabinetOrder`, `MinisterialOrdinance`, `Rule`, `ImperialOrder`, `Constitution`. Filtered client-side: e-Gov ignores `law_type` on the server, so the Actor screens every record itself. A statute with a compound e-Gov type (e.g. `Act,CabinetOrder`) matches if any one of its types is listed. |
| `categories` | array | `[]` | Japanese subject categories, e.g. `["民事", "労働"]`. |
| `eras` | array | `[]` | `Meiji`, `Taisho`, `Showa`, `Heisei`, `Reiwa`. |
| `lawIds` | array | `[]` | Fetch specific statutes by e-Gov `law_id`, e.g. `["325AC0000000144"]`. Exact server-side lookup. |
| `jltIds` | array | `[]` | Fetch specific statutes by Ministry of Justice id, e.g. `["24", "5274"]`. |
| `promulgatedFrom` | string | `""` | Only statutes promulgated on/after `YYYY` or `YYYY-MM-DD`. |
| `promulgatedTo` | string | `""` | Only statutes promulgated on/before `YYYY` or `YYYY-MM-DD`. |
| `maxItems` | integer | `100` | Max records written this run. Hard cap `20000`. |
| `maxPages` | integer | `0` | Max e-Gov pages this run (`0` = unlimited). One page = 100 statutes. |
| `resume` | boolean | `true` | Continue from where the previous identical run stopped. |

> **Input shape.** Pass the fields flat, as shown above. If your client nests the payload under an `input` key (the Apify SDK and the MCP `call-actor` tool do this), the Actor unwraps it and uses your values — the platform's own schema defaults never override your settings.

#### Example: one topic, with the official English titles

```json
{
  "search": "Civil Code",
  "maxItems": 50
}
```

#### Example: the Broadcasting Act, full text in both languages

```json
{
  "lawIds": ["325AC0000000132"],
  "includeFullText": true,
  "includeEnglish": true
}
```

#### Example: every Act enacted in the Reiwa era

```json
{
  "lawTypes": ["Act"],
  "eras": ["Reiwa"],
  "maxItems": 2000
}
```

#### Example: whole corpus, cheap metadata only (scheduled refresh)

```json
{
  "refresh": true,
  "maxItems": 10000
}
```

***

### Output

One dataset row per statute:

| Field | Description |
| --- | --- |
| `id`, `lawId` | e-Gov law id, e.g. `325AC0000000132` |
| `title`, `titleKana`, `abbrev` | Japanese title, kana reading, short title |
| `lawNum` | Official Japanese law number |
| `lawType`, `lawTypeJa` | e-Gov type (`Act`) and Japanese type (`法律`) |
| `era`, `eraYear`, `year`, `actNumber` | `Showa`, `25`, `1950`, `132` |
| `promulgationDate` | ISO-8601 date |
| `category` | e-Gov subject category in Japanese |
| `inForce`, `repealStatus`, `repealDate`, `currentRevisionStatus` | Legal status of the statute |
| `amendmentLawNum`, `amendmentLawTitle`, `amendmentPromulgateDate`, `amendmentEnforcementDate` | Latest amendment trail |
| `hasOfficialEnglishTranslation` | Whether an official English translation exists |
| `titleEn`, `lawNumEn`, `lastVersionEn`, `lastVersionJa` | Official English title / law number and the latest translated version |
| `jltId`, `jltUrl`, `jltTxtUrl`, `jltPriorVersionsCount` | Links to the Ministry of Justice translation |
| `matchedBy` | How the statute was joined to the translation index (`egovLawId` or `yearNum`) |
| `fullText`, `fullTextEn` | Article-level text, only with `includeFullText` |
| `scrapedAt` | ISO-8601 run timestamp |

***

### Pricing

Pay-per-event. You are charged only for rows that were actually written to the dataset.

| Event | Price | Charged for |
| --- | --- | --- |
| `legislation` | $0.0025 | A Japanese statute record (primary event) |
| `bilingual` | $0.0045 | A statute record that also carries the official English title and law number |
| `detail` | $0.003 | Additive: the row includes the full statutory text |
| `bulk-refresh` | $0.0005 | A statute in `refresh` mode (Japanese metadata only) |
| `apify-actor-start` | $0.00005 | One-off, when the run starts — **synthetic**, charged automatically by the platform |

Tier discounts (`legislation-bronze` … `legislation-diamond`, same for `bilingual`) are registered for paying plans. `apify-actor-start` is not a custom event: the Apify platform emits and prices it itself, so it cannot be registered or charged from Actor code.

The authoritative price table is the Actor's own [pricing tab](https://apify.com/epiconetic/japan-law-data/pricing). The repository's `PRICING.md` documents the tier ladder status, the charging guarantees and the measured margin behind these numbers.

***

### Design notes

- **Write first, charge second.** Rows are pushed to the dataset in batches, and the pay-per-event charge happens only after `pushData` succeeds. A failed push is never billed.
- **The English index is offline.** e-Gov is cheap and keyless; the Ministry of Justice site is slow and rate-limited. Metadata therefore comes from the packaged index, and only full English text triggers a live request (concurrency 3, 700–1000 ms spacing, a 90-second global pause on HTTP 403).
- **`remain_in_force` is ignored.** e-Gov reports it as `false` even for statutes currently in force. `inForce` is derived from the repeal status plus the revision status instead.
- **Filters the server ignores are applied locally.** e-Gov silently ignores `keyword` and `category`, so those filters run in the Actor.

***

### Legal note

The English titles and texts are the Ministry of Justice's official translations. The Ministry of Justice publishes them for reference; where the Japanese original and the English translation differ, the Japanese text prevails. Check the linked JLT page for the authoritative wording before relying on it in a filing.

***

### Project layout

```
japan-law-data/
├── .actor/            actor.json + dataset schema
├── src/
│   ├── main.js        pipeline: index → join → full text → push → charge
│   ├── lib/           charge, tier, kv (resume state), dedupe, http, log, jlt-index
│   ├── sources/       egov.js (e-Gov API), jlt.js (Ministry of Justice)
│   ├── schemas/       input + output platform schemas
│   └── data/          jlt-index.json (offline English translation index)
├── scripts/           one-off payloads (pricing) and probe scripts
├── tests/             vitest suite + fixtures
├── PRICING.md         pay-per-event pricing model
└── REPORT.md          build + verification report
```

### Local development

```bash
npm install
npm test
apify run --input-file ./tests/inputs/test-input-small.json
```

### Related Actors

- [Philippine Law Data](https://apify.com/epiconetic/philippines-law-data) — Lawphil
- [Indonesia Law Data](https://apify.com/epiconetic/indonesia-law-data) — peraturan.go.id
- [Malaysia Law Data](https://apify.com/epiconetic/malaysia-law-data) — lom.agc.gov.my
- [Singapore Law Data](https://apify.com/epiconetic/singapore-law-data) — sso.agc.gov.sg

# Actor input Schema

## `includeEnglish` (type: `boolean`):

Attach the official English title and law number of every statute that the Ministry of Justice has translated (2,261 of 9,577 statutes). The English metadata comes from an offline index shipped with the Actor, so it costs no extra requests. Records with an official translation are billed under the 'bilingual' event.

## `includeFullText` (type: `boolean`):

Also fetch the full article text of each law (Japanese from e-Gov, English from the Ministry of Justice translation when available) and attach it as 'fullText' / 'fullTextEn'. One statute can be 800 KB and 900+ articles, so this is off by default and billed under the 'detail' event.

## `includeRepealed` (type: `boolean`):

Include statutes that have been repealed, expired or lost their effect (571 of 9,577). When off (default) only statutes currently in force are returned, and the filter is applied server-side by e-Gov so it is cheaper and faster.

## `refresh` (type: `boolean`):

Cheap metadata-only re-index of the whole corpus, billed under the 'bulk-refresh' event. Full text and English translation are ignored in this mode. Useful for scheduled refresh jobs that only need the current law index.

## `search` (type: `string`):

Optional keyword matched against the Japanese title, law number, category and also against the official English title and law number. e-Gov ignores keyword filtering server-side, so this filter runs locally. Example: 'Civil Code', '所得税', 'Act No. 132 of 1950'.

## `lawTypes` (type: `array`):

Restrict to specific instrument types. e-Gov ignores the type filter server-side, so the Actor screens every record locally. A statute with a compound e-Gov type (e.g. 'Act,CabinetOrder') matches if any one of its types is listed. Leave empty for all types.

## `categories` (type: `array`):

Optional Japanese subject categories used by e-Gov, e.g. 民事 (civil), 労働 (labour), 国税 (national tax), 環境保全 (environmental conservation). Filtered locally. Leave empty for all categories.

## `eras` (type: `array`):

Optional filter by Japanese era. Filtered locally. Leave empty for all eras.

## `lawIds` (type: `array`):

Fetch specific statutes by their e-Gov law_id, e.g. '325AC0000000144' (Act No. 144 of 1950) or '322AC0000000164' (Constitution of Japan). Exact server-side lookup, no paging needed.

## `jltIds` (type: `array`):

Fetch specific statutes by their Japan Law Translation id, e.g. '24' (Public Assistance Act) or '5274' (Broadcasting Act). The Actor resolves the id through the official translation index and then fetches the matching e-Gov statute.

## `promulgatedFrom` (type: `string`):

Only include statutes promulgated on or after this date. Accepts YYYY or YYYY-MM-DD. Filtered locally.

## `promulgatedTo` (type: `string`):

Only include statutes promulgated on or before this date. Accepts YYYY or YYYY-MM-DD. Filtered locally.

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

Maximum number of statutes written to the dataset in this run. Use a higher value to pull the whole corpus (9,577 statutes = 96 pages).

## `maxPages` (type: `integer`):

Maximum number of e-Gov index pages to read in this run (100 statutes per page). 0 = unlimited. Use it together with 'resume' to walk the corpus over several runs.

## `resume` (type: `boolean`):

Continue where the previous run with the same settings stopped, instead of starting from the beginning. Progress is stored in a private key-value store.

## Actor input object example

```json
{
  "includeEnglish": true,
  "includeFullText": false,
  "includeRepealed": false,
  "refresh": false,
  "search": "",
  "lawTypes": [],
  "categories": [],
  "eras": [],
  "lawIds": [],
  "jltIds": [],
  "promulgatedFrom": "",
  "promulgatedTo": "",
  "maxItems": 100,
  "maxPages": 0,
  "resume": true
}
```

# Actor output Schema

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

All Japanese statute records produced by this run: e-Gov law id, Japanese title, law number, promulgation date, category, in-force status and — where the Ministry of Justice has published one — the official English title and law number.

## `summary` (type: `string`):

Per-run statistics, charging details and resume state for this run.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("epiconetic/japan-law-data").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("epiconetic/japan-law-data").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 '{}' |
apify call epiconetic/japan-law-data --silent --output-dataset

```

## MCP server setup

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

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/VTPOtkBMLzmg0842m/builds/qDth5ojkmsAKJJx0l/openapi.json
