Japan Laws & Regulations (e-Gov Law API) avatar

Japan Laws & Regulations (e-Gov Law API)

Pricing

from $2.00 / 1,000 results

Go to Apify Store
Japan Laws & Regulations (e-Gov Law API)

Japan Laws & Regulations (e-Gov Law API)

Search Japanese laws and regulations by title or keyword, extract articles or whole laws, and retrieve amendment histories from the official e-Gov Law API v2.

Pricing

from $2.00 / 1,000 results

Rating

0.0

(0)

Developer

Vespa ZZZ

Vespa ZZZ

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Features

Limited permissions

Share

Search Japanese laws and regulations, extract their text as structured JSON, and retrieve amendment histories from Japan's official e-Gov Law API v2. The API is public and requires no key.

Modes and output

ModeDataset recordsMain inputs
search (default)One row per law with law and revision metadataPartial lawTitle, lawType, categoryCd, promulgationDateFrom / To, asof, repealStatus
keywordOne row per law with a sentences array of matching positions and plain-text snippetskeyword, lawType, categoryCd, promulgationDateFrom / To, asof
fullTextOne row per article by default, or one row per law with outputFormat: "whole"laws, includeSupplementaryProvisions, outputFormat, includeRawXml
revisionsOne row per revision with amending law title and number, promulgation and enforcement dates, and statuslaws, amendmentDateFrom / To (effective dates)

Use dates in YYYY-MM-DD format. asof selects the latest applicable revision at the given date for search and keyword results. Keyword results include snippets from the pages fetched before the row limit is reached. The e-Gov API's limits can also leave a law's sentences array incomplete. Each snippet retains its API position for citation or retrieval.

In fullText and revisions, laws accepts e-Gov law IDs, official law numbers, and exact Japanese titles. Use a law ID or law number when several laws share a title or the title search has more than 10 pages of results.

Article rows contain lawId, lawTitle, lawNum, revisionId, lawUrl, path (ordered heading titles), articleNum, articleCaption, articleTitle, and text. Paragraph and item labels present in XML are included alongside their text. Set includeSupplementaryProvisions to include numbered supplementary articles, which have supplementary: true.

Whole-law rows include plain text from the main provisions and annexes. Set includeSupplementaryProvisions to include supplementary provisions, including paragraphs outside an article. Set includeRawXml to include the original XML as rawXml. This XML can include supplementary provisions regardless of the plain-text setting. Images and other attachments are available through the e-Gov source link.

maxResults caps dataset rows across the run (default 100, maximum 10,000). In fullText and revisions, increase maxResults for large laws with many articles or revisions. If the limit leaves records out, the Actor logs a warning and sets truncated to true in RUN_SUMMARY in the default key-value store. When the dataset reaches the limit, the Actor may check subsequent input laws to determine whether any records remain. Requests are sequential and spaced by requestIntervalMs (default 1,000 ms, minimum 500 ms). Temporary failures are retried up to three times with backoff.

Input examples

Search for laws with 個人情報 in the title.

{ "mode": "search", "lawTitle": "個人情報", "maxResults": 5 }

Find passages mentioning the Digital Agency.

{ "mode": "keyword", "keyword": "デジタル庁", "lawType": ["Act"], "maxResults": 10 }

Extract Companies Act articles with a higher maxResults because the law has hundreds of articles.

{ "mode": "fullText", "laws": ["平成十七年法律第八十六号"], "maxResults": 2000 }

List amendments enforced since April 2022 for the Act on the Protection of Personal Information. For a longer amendment history, increase maxResults above the default of 100.

{
"mode": "revisions",
"laws": ["平成十五年法律第五十七号"],
"amendmentDateFrom": "2022-04-01",
"maxResults": 500
}

Use cases

  • Legal tech — Index laws by ID and link search results to the official text.
  • Compliance monitoring — Compare revision IDs and track amendment enforcement dates for a list of laws.
  • Retrieval-augmented generation (RAG) — Index article text with its revision ID, article number, headings, and source URL.
  • AI agents — Look up laws by topic and retrieve provisions relevant to a question.

Data source and terms

The Actor uses the official data from e-Gov Law Search. The terms of use explain how to attribute and reuse the data. e-Gov Law Search, Law API v2, Terms of use

This Actor is unaffiliated with e-Gov or Japan's Digital Agency. Its output is for information and does not constitute legal advice.

Local development

From this Actor's directory, run npm install, npm test, and apify validate-schema. Tests use mocked requests and two fixtures captured from e-Gov Law API v2.


日本語の概要

e-Gov 法令 API v2 から、法令名検索、本文のキーワード検索、条文または全文の取得、改正履歴の取得ができます。条文ごとの出力では法令 ID、版 ID、見出し、条番号、本文、出典 URL を確認できます。附則を含めるには includeSupplementaryProvisions を有効にしてください。法的判断には e-Gov の原文をご確認ください。