# Japan Law Change Feed — e-Gov Diffs (`jp-public-data/jp-law-changes-query`) Actor

Daily 05:30 JST verified Japanese law-change data. Queries are free and return no stored data when the last successful official-source check is over 30 hours old.

- **URL**: https://apify.com/jp-public-data/jp-law-changes-query.md
- **Developed by:** [株式会社MaSANO Vida](https://apify.com/jp-public-data) (community)
- **Categories:** Business, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.03 / verified query with results

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 Change Feed — e-Gov Diffs

Verified, machine-readable amendment events for Japanese laws and regulations, built from the official e-Gov Laws APIs. The Actor is designed for AI agents and data workflows that need a compact answer to: what changed, when was it published, when does it take effect, and which provisions changed?

日本の法令改正を、公式のe-Gov法令APIから取得して機械可読化するデータ商品です。公表日・公布日・施行日を区別し、取得できた場合は条項単位の変更前後を返します。法律相談や法的判断の代替ではありません。必ず原典も確認してください。

### What the output means / データの意味

Each result is a verified law-change event. `event_type` is one of `law_update`, `repeal`, `new_enactment`, `partial_amendment`, or `future_enforcement`. Important fields include:

- `law_id`, `revision_id`, Japanese law and amendment names;
- `source_published_at`, `promulgated_at`, and one or more `effective_dates`;
- `changed_provisions`, with `before_ja`, `after_ja`, and hashes when an official body comparison was available;
- `source.url`, retrieval time, last verification time, license, and attribution;
- `verification.status`, which is always `verified` in saleable query results.

公表日と施行日は同じとは限りません。複数の施行日がある場合は配列で返します。原文比較を取得できないイベントでは、変更法令名等の構造化情報を返し、取得できなかった差分を推測しません。

### Verification and freshness / 検証と鮮度

The first successful collection is a baseline. It produces no sale events. Stable event IDs prevent duplicates on later collections. Records that the official API marks as still under ministry review (`AuthFlg=1`, 所管課確認中) are written only to a private review dataset and are never added to the customer manifest. In the 30-event validation sample, 27 records were verified and three were isolated for this reason.

The official source is checked daily at **05:30 JST** by a separate private updater. A successful check updates the verification timestamp even when there are zero new differences. Public queries read the last complete verified snapshot bundled into the Actor build; they do not call e-Gov or read publisher-owned Apify storage. Before charging, every query checks the last successful official-source check. If it is more than **30 hours old**, the Actor returns `source_unavailable`, `charged: false`, an empty `items` array, and explicit freshness metadata instead of selling old data. Failed or skipped updater runs—including runs not started because account credit is unavailable—cannot advance this timestamp.

### Input example

```json
{
  "dateFrom": "2026-10-01",
  "dateTo": "2026-10-31",
  "eventTypes": ["law_update"],
  "region": ["JP"],
  "query": "金融商品取引法",
  "limit": 10
}
```

The run dataset contains one response envelope with `status`, `last_successful_check_at`, `data_period`, `freshness` (state, age, 30-hour maximum, and sale permission), `data_fresh_as_of`, `snapshot` (version, creation time, item count, byte size, and SHA-256 integrity), `items`, `sources_checked`, and `warnings`. A representative output is included in `samples/law-query-output.json` in the source package.

### AI and API use

Run the Actor in Apify Console, through the Actor REST API, official API clients, or Apify MCP integrations. An agent passes the same JSON input and reads the default dataset URL exposed by the output schema. The Actor uses limited permissions and does not use Standby mode.

AI agents can pay through an Apify account, an Apify AGI prepaid token purchased over x402 or MPP, or—after Apify confirms eligibility—Skyfire per-request payment. Agentic payment protocols are operated by Apify and may change. A buyer should always set a maximum charge for each run.

### Pricing / 料金

- Primary event: `verified-query`
- Price: **US$0.03 once per successful run that returns at least one verified item**
- Maximum items: 20 per query
- Platform usage: included in the event price
- Free responses: `no_matches`, `degraded`, `source_unavailable`, failed runs, and owner update runs
- No synthetic start or dataset-item charge is used, so a zero-result response does not trigger a product charge.

Publication is blocked until the publisher deletes both `apify-actor-start` and `apify-default-dataset-item` in Apify Console, saves and reopens the settings, and verifies that `verified-query` is the only chargeable event. Automatic synthetic charges cannot be prevented or reversed by Actor code. Removing the start event also means the publisher bears the first five seconds of compute.

At US$0.03, one query is approximately ¥4.50 at an illustrative ¥150/US$. Exchange rates and any buyer-side wallet/network costs are outside the Actor price. The dataset field `charged` states whether this run triggered the custom event.

### Source, rights, and attribution / 出典・利用条件

- Official source: [e-Gov Laws](https://laws.e-gov.go.jp/)
- Source terms: [e-Gov法令検索 利用規約](https://laws.e-gov.go.jp/terms)
- License: Public Data License 1.0
- Required attribution included in every event: `出典：e-Gov法令検索（本サービスが加工）`

Commercial reuse is permitted under the source terms, subject to attribution and an indication that this service modified or processed the source data. Do not imply that the Digital Agency or the Government of Japan created, endorsed, or guarantees this processed product. The official Japanese source controls if this output differs from the original.

The output is provided as processed informational data, without warranties of completeness, timeliness, merchantability, fitness for a particular purpose, or legal effect. It is not legal advice. Users remain responsible for checking the official source before making legal, compliance, procurement, or financial decisions.

Publisher / 販売者: **株式会社MaSANO Vida (MaSANO Vida Co., Ltd.)**

Support questions should include the Actor run ID and event ID, but must not include confidential or personal data.

# Actor input Schema

## `dateFrom` (type: `string`):

Inclusive ISO date (YYYY-MM-DD).

## `dateTo` (type: `string`):

Inclusive ISO date (YYYY-MM-DD).

## `eventTypes` (type: `array`):

Optional law event types.

## `region` (type: `array`):

Optional ISO-style region filters. Japanese national law events use JP.

## `query` (type: `string`):

Keyword matched against verified structured fields.

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

Maximum number of verified events returned.

## Actor input object example

```json
{
  "dateFrom": "2026-10-01",
  "dateTo": "2026-10-31",
  "eventTypes": [
    "law_update",
    "repeal",
    "new_enactment",
    "partial_amendment",
    "future_enforcement"
  ],
  "region": [
    "JP"
  ],
  "query": "金融商品取引法",
  "limit": 20
}
```

# Actor output Schema

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

No description

# 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("jp-public-data/jp-law-changes-query").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("jp-public-data/jp-law-changes-query").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 jp-public-data/jp-law-changes-query --silent --output-dataset

```

## MCP server setup

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

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/240WFjyreeeuTORRN/builds/Z3Bwhc7aLR2F3BxTp/openapi.json
