### Example API Request URL Source: https://laws.e-gov.go.jp/api/2/redoc This is an example URL for the law file download API, demonstrating how to structure the request with file type and law identifier. ```http https://laws.e-gov.go.jp/api/2/law_file/{file_type}/{law_id_or_num_or_revision_id} ``` -------------------------------- ### XML Example for Law Sentence Source: https://laws.e-gov.go.jp/api/2/redoc This XML snippet represents a sentence within a law, including its number and writing mode. ```xml   この法律は、処分、行政指導及び届出に関する手続並びに命令等を定める手続に関し、・・・ ``` -------------------------------- ### JSON Light Example for Law Sentence Source: https://laws.e-gov.go.jp/api/2/redoc This JSON snippet provides a simplified representation of a law sentence, focusing on the text content. ```json {   "Sentence": [      "この法律は、処分、行政指導及び届出に関する手続並びに命令等を定める手続に関し、・・・"     ] } ``` -------------------------------- ### GET /laws Source: https://laws.e-gov.go.jp/api/2/redoc Retrieves a list of laws based on specified query parameters. Supports filtering, pagination, and sorting. ```APIDOC ## GET /laws ### Description Retrieves a list of laws based on specified query parameters. Supports filtering, pagination, and sorting. ### Method GET ### Endpoint https://laws.e-gov.go.jp/api/2/laws ### Parameters #### Query Parameters - **law_id** (string) - Optional - 法令ID(部分一致) - **law_num** (string) - Optional - 法令番号(部分一致) - **law_num_era** (string) - Optional - 法令番号の元号 (Enum: "Meiji" "Taisho" "Showa" "Heisei" "Reiwa") - **law_num_num** (string) - Optional - 法令番号の号数 - **law_num_type** (string) - Optional - 法令番号の法令種別 (Enum: "Constitution" "Act" "CabinetOrder" "ImperialOrder" "MinisterialOrdinance" "Rule" "Misc") - **law_num_year** (integer) - Optional - 法令番号の年 - **law_title** (string) - Optional - 法令名又は法令略称(部分一致) - **law_title_kana** (string) - Optional - 法令名読み(部分一致) - **law_type** (Array of strings) - Optional - 法令種別(複数指定可) (Items Enum: "Constitution" "Act" "CabinetOrder" "ImperialOrder" "MinisterialOrdinance" "Rule" "Misc") - **amendment_law_id** (string) - Optional - 改正法令の法令ID(部分一致)。指定した場合、`asof`パラメータは無視されます。 - **asof** (string) - Optional - 法令の時点。指定時点以前で最新の改正履歴を、各法令の `revision_info` に格納します。省略した場合、現時点で検索します。 - **category_cd** (Array of strings) - Optional - 事項別分類コード(複数指定可) - **mission** (Array of strings) - Optional - 新規制定又は被改正法令(`New`)・一部改正法令(`Partial`)を指定(複数指定可) - **omit_current_revision_info** (boolean) - Optional - `true`の場合、法令の時点(`asof`)に依存しない現在以前の最新の版の情報(`current_revision_info`)をレスポンスに含めない。既定値: `false` - **promulgation_date_from** (string) - Optional - 公布日(指定値を含む、それ以後) - **promulgation_date_to** (string) - Optional - 公布日(指定値を含む、それ以前) - **repeal_status** (Array of strings) - Optional - 廃止等の状態(複数指定可) (Enum: "None" "Repeal" "Expire" "Suspend" "LossOfEffectiveness") - **limit** (integer) - Optional - レスポンスの `laws` の取得件数の上限。既定値: `100` - **offset** (integer) - Optional - レスポンスデータの取得開始位置。既定値: `0` - **order** (string) - Optional - レスポンスの並び順を指定(複数指定可)。先頭に + を付けると昇順、- を付けると降順、符号がない場合は昇順。既定値: `law_info.law_id` - **response_format** (string) - Optional - レスポンス形式(`json` 又は `xml`)。指定なしの場合はAcceptヘッダから判断、判断できない場合は `json` とする。 ### Responses #### Success Response (200) - **laws** (Array) - List of laws matching the query. - **total_count** (integer) - Total number of laws found. #### Error Response (400) - **error** (object) - Details about the bad request. #### Error Response (500) - **error** (object) - Details about the internal server error. ### Request Example ```json { "law_id": "322CO0000000016", "law_num": "昭和二十二年政令第十六号", "law_num_era": "Showa", "law_num_num": "88", "law_num_type": "Act", "law_num_year": 60, "law_title": "国家行政組織法", "law_title_kana": "こっかぎょうせいそしきほう", "law_type": ["Act", "Rule"], "amendment_law_id": "429AC0000000054", "asof": "2023-07-01", "category_cd": ["001", "002"], "mission": ["New", "Partial"], "omit_current_revision_info": true, "promulgation_date_from": "2023-07-01", "promulgation_date_to": "2023-07-01", "repeal_status": ["Repeal", "Expire"], "limit": 50, "offset": 10, "order": "+law_info.law_id,-revision_info.amendment_promulgate_date", "response_format": "json" } ``` ### Response Example (Success) ```json { "laws": [ { "law_info": { "law_id": "322CO0000000016", "law_num": "昭和二十二年政令第十六号", "law_num_era": "Showa", "law_num_num": "16", "law_num_type": "CabinetOrder", "law_num_year": 22, "law_title": "行政組織に関する法", "law_title_kana": "ぎょうせいそしきにかんするほう", "law_type": "CabinetOrder", "promulgate_date": "1947-05-03", "effective_date": "1947-05-03", "amendment_flag": false }, "revision_info": { "amendment_promulgate_date": "1947-05-03", "amendment_effective_date": "1947-05-03", "amendment_law_id": null, "amendment_law_num": null, "amendment_law_title": null }, "current_revision_info": { "amendment_promulgate_date": "2023-06-16", "amendment_effective_date": "2023-07-01", "amendment_law_id": "429AC0000000054", "amendment_law_num": "令和五年政令第百九十八号", "amendment_law_title": "行政手続法の一部を改正する政令" } } ], "total_count": 100 } ``` ``` -------------------------------- ### JSON Detailed Example for Law Sentence Source: https://laws.e-gov.go.jp/api/2/redoc This JSON snippet shows a detailed representation of a law sentence, including attributes and child text content. ```json {   "tag": "Sentence",   "attr": {     "Num": "1",     "WritingMode": "vertical"   },   "children": [     "この法律は、処分、行政指導及び届出に関する手続並びに命令等を定める手続に関し、・・・"   ] } ``` -------------------------------- ### Laws API - Get Law File Source: https://laws.e-gov.go.jp/api/2/swagger-ui Retrieves a law document in a specified file type. ```APIDOC ## GET /law_file/{file_type}/{law_id_or_num_or_revision_id} ### Description Retrieves a law document in a specified file type. ### Method GET ### Endpoint /law_file/{file_type}/{law_id_or_num_or_revision_id} ### Parameters #### Path Parameters - **file_type** (string) - Required - The desired file type (e.g., 'json', 'xml'). - **law_id_or_num_or_revision_id** (string) - Required - The ID, number, or revision ID of the law. ### Response #### Success Response (200) - The response will be the content of the law file in the specified format. #### Response Example ```json { "law_id": "12345", "title": "Example Law", "content": "..." } ``` ``` -------------------------------- ### Laws API - Get Attachment Source: https://laws.e-gov.go.jp/api/2/swagger-ui Retrieves an attached file for a specific law revision. ```APIDOC ## GET /attachment/{law_revision_id} ### Description Retrieves an attached file for a specific law revision. ### Method GET ### Endpoint /attachment/{law_revision_id} ### Parameters #### Path Parameters - **law_revision_id** (string) - Required - The ID of the law revision for which to retrieve the attachment. ### Response #### Success Response (200) - **attached_file** (object) - Contains information about the attached file, such as its name and content (or a URL to the file). #### Response Example ```json { "file_name": "document.pdf", "file_url": "https://laws.e-gov.go.jp/api/2/attachments/12345" } ``` ``` -------------------------------- ### GET /law_file/{file_type}/{law_id_or_num_or_revision_id} Source: https://laws.e-gov.go.jp/api/2/redoc Retrieve the full text of a law by specifying its ID, number, or revision ID along with the desired file type. ```APIDOC ## 法令本文ファイル取得API ### Description 法令ID(`law_id`)、法令番号(`law_num`)、法令履歴ID(`law_revision_id`)のいずれかと、ファイル種別(`file_type`)を指定必須として、法令本文をダウンロードすることができます。 ### Method GET ### Endpoint /law_file/{file_type}/{law_id_or_num_or_revision_id} ### Parameters #### Path Parameters - **law_id_or_num_or_revision_id** (string) - Required - 法令ID、法令番号又は法令履歴ID(完全一致)。 例: `405AC0000000088`、`昭和二十二年政令第十六号`、`322CO0000000016_20240401_505CO0000000293` - **file_type** (string) - Required - Enum: "xml" "json" "html" "rtf" "docx" ファイル種別 コードの定義はSchemasの`file_type`を参照してください。 例: `xml` #### Query Parameters - **asof** (string) - Optional - 法令の時点。指定時点以前で最新の履歴に対応する法令本文ファイルを取得します。 `law_id_or_num_or_revision_id`に法令履歴IDを指定した場合は無視されます。 例: `2023-04-01` ### Responses #### Success Response (200) リクエスト処理、レスポンス処理が正しく行えた時 #### Error Response (400) Bad Request API クライアント側の問題によるエラー発生時 #### Error Response (500) Internal Server Error サーバ内処理でエラー発生時 ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "total_count": 447, "sentence_count": 100, "next_offset": 100, "items": [ { "law_info": { "law_type": "Rule", "law_id": "428M60020000006", "law_num": "平成二十八年個人情報保護委員会規則第六号", "law_num_era": "Heisei", "law_num_year": 28, "law_num_type": "Rule", "law_num_num": "006", "promulgation_date": "2016-12-15" }, "revision_info": { "law_revision_id": "428M60020000006_20240527_506M60020000003", "law_type": "Rule", "law_title": "行政手続における特定の個人を識別するための番号の利用等に関する法律第十九条第九号の規定により提供することができる利用特定個人情報の範囲の限定に関する規則", "law_title_kana": "ぎょうせいてつづきにおけるとくていのこじんをしきべつするためのばんごうのりようとうにかんするほうりつだいじゅうきゅうじょうだいきゅうごうのきていによりていきょうすることができるりようとくていこじんじょうほうのはんいのげんていにかんするきそく", "abbrev": null, "category": "行政手続", "updated": "2024-06-12T14:43:47+09:00", "amendment_promulgate_date": "2024-05-27", "amendment_enforcement_date": "2024-05-27", "amendment_enforcement_comment": null, "amendment_scheduled_enforcement_date": null, "amendment_law_id": "506M60020000003", "amendment_law_title": "行政手続における特定の個人を識別するための番号の利用等に関する法律等の一部を改正する法律の施行に伴う個人情報保護委員会関係規則の整備に関する規則", "amendment_law_title_kana": null, "amendment_law_num": "令和六年個人情報保護委員会規則第三号", "amendment_type": "3", "repeal_status": "None", "repeal_date": null, "remain_in_force": false, "mission": "New", "current_revision_status": "CurrentEnforced" }, "sentences": [ { "position": "amendsupplprovision", "text": "この規則は、デジタル庁設置法及びデジタル社会の形成を図るための関係法律の整備に関する法律の施行の日(令和三年九月一日)から施行する。" } ] } ] } ``` ``` -------------------------------- ### Laws API - Get Law List Source: https://laws.e-gov.go.jp/api/2/swagger-ui Retrieves a list of laws. This is the primary endpoint for accessing the catalog of Japanese legal documents. ```APIDOC ## GET /laws ### Description Retrieves a list of laws. ### Method GET ### Endpoint /laws ### Query Parameters - **response_format** (string) - Optional - Specifies the desired response format (e.g., JSON, XML). ### Response #### Success Response (200) - **laws_response** (object) - Contains a list of law objects, each with details like law ID, title, and revision information. #### Response Example ```json { "laws": [ { "law_id": "12345", "title": "Example Law", "revision_info": { "amendment_type": "1", "mission": "New" } } ] } ``` ``` -------------------------------- ### Laws API - Get Law Data Source: https://laws.e-gov.go.jp/api/2/swagger-ui Retrieves the detailed content of a specific law, identified by its ID, number, or revision ID. ```APIDOC ## GET /law_data/{law_id_or_num_or_revision_id} ### Description Retrieves the detailed content of a specific law. ### Method GET ### Endpoint /law_data/{law_id_or_num_or_revision_id} ### Parameters #### Path Parameters - **law_id_or_num_or_revision_id** (string) - Required - The ID, number, or revision ID of the law. ### Response #### Success Response (200) - **law_data_response** (object) - Contains the detailed data of the law, including its text and metadata. #### Response Example ```json { "law_id": "12345", "title": "Example Law", "content": "This is the full text of the example law.", "revision_info": { "amendment_type": "New", "mission": "New" } } ``` ``` -------------------------------- ### Laws API - Get Law Revisions Source: https://laws.e-gov.go.jp/api/2/swagger-ui Retrieves the revision history for a specific law, identified by its ID or number. ```APIDOC ## GET /law_revisions/{law_id_or_num} ### Description Retrieves the revision history for a specific law. ### Method GET ### Endpoint /law_revisions/{law_id_or_num} ### Parameters #### Path Parameters - **law_id_or_num** (string) - Required - The ID or number of the law for which to retrieve revisions. ### Response #### Success Response (200) - **law_revisions_response** (object) - Contains a list of revision objects for the specified law. #### Response Example ```json { "revisions": [ { "revision_id": "67890", "revision_date": "2023-01-01", "amendment_type": "Partial" } ] } ``` ``` -------------------------------- ### GET /websites/laws_e-gov_go_jp_api_2 Source: https://laws.e-gov.go.jp/api/2/redoc Retrieves the revision history for a specified law. You must provide either a law ID or a law number. The revisions are returned in descending order of their revision ID. ```APIDOC ## GET /websites/laws_e-gov_go_jp_api_2 ### Description Retrieves the revision history for a specified law. You must provide either a law ID or a law number. The revisions are returned in descending order of their revision ID. ### Method GET ### Endpoint /websites/laws_e-gov_go_jp_api_2 ### Parameters #### Query Parameters - **law_id** (string) - Optional - The unique identifier for the law. - **law_num** (string) - Optional - The official number of the law (e.g., "Showa 22 Cabinet Order No. 16"). ### Request Example ```json { "law_id": "322CO0000000016" } ``` ### Response #### Success Response (200) - **total_count** (integer) - The total number of revisions found. - **count** (integer) - The number of revisions returned in this response. - **laws** (array) - An array of law objects, each containing `law_info` and `revision_info`. - **law_info** (object) - Contains general information about the law. - **law_type** (string) - The type of the law (e.g., "CabinetOrder"). - **law_id** (string) - The unique identifier for the law. - **law_num** (string) - The official number of the law. - **law_num_era** (string) - The era of the law number (e.g., "Showa"). - **law_num_year** (integer) - The year of the law number. - **law_num_type** (string) - The type of the law number (e.g., "CabinetOrder"). - **law_num_num** (string) - The sequential number of the law. - **promulgation_date** (string) - The date the law was promulgated (YYYY-MM-DD). - **revision_info** (object) - Contains information about a specific revision of the law. - **law_revision_id** (string) - The unique identifier for this revision. - **law_type** (string) - The type of the law. - **law_title** (string) - The title of the law in this revision. - **law_title_kana** (string) - The title of the law in kana. - **abbrev** (string) - The abbreviated title of the law. - **category** (string) - The category the law belongs to. - **updated** (string) - The timestamp when this revision information was last updated. - **amendment_promulgate_date** (string) - The date the amendment was promulgated. - **amendment_enforcement_date** (string) - The date the amendment came into effect. - **amendment_enforcement_comment** (string) - Comments regarding the enforcement of the amendment. - **amendment_scheduled_enforcement_date** (string) - The scheduled enforcement date for future amendments. - **amendment_law_id** (string) - The ID of the law that enacted this amendment. - **amendment_law_title** (string) - The title of the law that enacted this amendment. - **amendment_law_title_kana** (string) - The kana title of the law that enacted this amendment. - **amendment_law_num** (string) - The number of the law that enacted this amendment. - **amendment_type** (string) - The type of amendment. - **repeal_status** (string) - The repeal status of the law (e.g., "None"). - **repeal_date** (string) - The date the law was repealed. - **remain_in_force** (boolean) - Indicates if the law remains in force. - **mission** (string) - The mission associated with this revision. - **current_revision_status** (string) - The current revision status (e.g., "CurrentEnforced"). #### Response Example ```json { "total_count": 1, "count": 1, "laws": [ { "law_info": { "law_type": "CabinetOrder", "law_id": "322CO0000000016", "law_num": "昭和二十二年政令第十六号", "law_num_era": "Showa", "law_num_year": 22, "law_num_type": "CabinetOrder", "law_num_num": "016", "promulgation_date": "1947-05-03" }, "revision_info": { "law_revision_id": "322CO0000000016_20240401_506CO0000000161", "law_type": "CabinetOrder", "law_title": "地方自治法施行令", "law_title_kana": "ちほうじちほうしこうれい", "abbrev": "地自法施行令", "category": "地方自治", "updated": "2024-04-19T13:42:44+09:00", "amendment_promulgate_date": "2024-03-30", "amendment_enforcement_date": "2024-04-01", "amendment_enforcement_comment": null, "amendment_scheduled_enforcement_date": null, "amendment_law_id": "506CO0000000161", "amendment_law_title": "児童福祉法等の一部を改正する法律の施行に伴う関係政令の整備等に関する政令", "amendment_law_title_kana": null, "amendment_law_num": "令和六年政令第百六十一号", "amendment_type": "3", "repeal_status": "None", "repeal_date": null, "remain_in_force": false, "mission": "New", "current_revision_status": "CurrentEnforced" } } ] } ``` #### Error Responses - **400** - Bad Request: Indicates an issue with the request parameters. - **500** - Internal Server Error: Indicates a server-side problem. ``` -------------------------------- ### GET /attachment/{law_revision_id} Source: https://laws.e-gov.go.jp/api/2/redoc Retrieves attached files for a given law revision ID. Supports fetching individual files (JPG, PDF) or all attachments as a ZIP archive. ```APIDOC ## 添付ファイル取得API ### Description Retrieves attached files for a given law revision ID. Supports fetching individual files (JPG, PDF) or all attachments as a ZIP archive. ### Method GET ### Endpoint /attachment/{law_revision_id} ### Parameters #### Path Parameters - **law_revision_id** (string) - Required - 法令履歴ID(完全一致) * Example JPG: `411AC0000000127_19990813_000000000000000` * Example PDF: `322M40000010094_20240601_506M60000010035` #### Query Parameters - **src** (string) - Optional - 法令XML中のFig要素のsrc属性 * Example JPG: `./pict/H11HO127-001.jpg` * Example PDF: `./pict/2FH00000007000.pdf` ### Responses #### Success Response (200) - **Binary Data** - Returns the requested file content (image, PDF, or ZIP archive). #### Error Response (400) - **Bad Request** - API client-side error. #### Error Response (500) - **Internal Server Error** - Server-side processing error. ### Request Example ``` GET https://laws.e-gov.go.jp/api/2/attachment/411AC0000000127_19990813_000000000000000?src=./pict/H11HO127-001.jpg ``` ### Response Example ``` (Binary data will be returned here) ``` ``` -------------------------------- ### Get Attached File API Endpoint Source: https://laws.e-gov.go.jp/api/2/redoc Retrieves attached files for a given law revision ID. The `src` parameter can be used to fetch specific files or all files as a zip archive. ```http get/attachment/{law_revision_id} https://laws.e-gov.go.jp/api/2/attachment/{law_revision_id} ``` -------------------------------- ### Get Law Text by ID Source: https://laws.e-gov.go.jp/api/2/redoc Retrieves the full text of a law by specifying its law ID, law number, or law revision ID. If law ID or law number is provided, the latest revision is returned. If a law revision ID is provided, the text for that specific revision is returned. ```APIDOC ## GET /law_data/{law_id_or_num_or_revision_id} ### Description Retrieves the full text of a law by specifying its law ID, law number, or law revision ID. If law ID or law number is provided, the latest revision is returned. If a law revision ID is provided, the text for that specific revision is returned. ### Method GET ### Endpoint /law_data/{law_id_or_num_or_revision_id} ### Parameters #### Path Parameters - **law_id_or_num_or_revision_id** (string) - Required - The law ID, law number, or law revision ID (exact match). Example: `411AC0000000127`, `平成十一年法律第百二十七号`, `411AC0000000127_19990813_000000000000000` #### Query Parameters - **law_full_text_format** (string or null) - Optional - Specifies the format of the law text (`json` or `xml`). If not specified, it defaults to the `response_format` or `json` if `response_format` cannot be determined. Example: `json` Default: null - **asof** (string) - Optional - The date of the law. Retrieves the law text corresponding to the latest revision as of the specified date. Ignored if a law revision ID is provided. Example: `2023-04-01` - **elm** (string) - Optional - Specifies the element (e.g., article, paragraph) to retrieve from the law text. If not specified, the full text is returned. Refer to Schemas for `elm` for details on specification. Example: `MainProvision-Paragraph[1]` - **json_format** (string or null) - Optional - Specifies the format of `law_full_text` in JSON responses. `full` returns a detailed JSON structure (JSON detailed version), while `light` returns a simplified structure optimized for parsing (JSON simple version). Only valid when `response_format` is JSON. Example: `light` Default: `full` - **omit_amendment_suppl_provision** (boolean) - Optional - If `true`, excludes supplementary provisions of amended laws from the `law_full_text` in the response. Example: `true` Default: `false` - **include_attached_file_content** (boolean) - Optional - If `true`, returns the `image_data` within `attached_files_info` in the response. Example: `true` Default: `false` - **response_format** (string or null) - Optional - Specifies the response format (`json` or `xml`). If not specified, it is determined by the Accept header, defaulting to `json` if it cannot be determined. Example: `json` Default: null ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **attached_files_info** (object) - Contains data related to attached files. - **law_info** (object) - Contains data not dependent on revision history, such as law number and promulgation date. - **revision_info** (object) - Contains data dependent on revision history, such as the amended law title and amendment promulgation date. If `asof` is specified, it contains the latest revision history as of that date. - **law_full_text** (string) - Contains the full text of the law. Can be filtered by element using the `elm` parameter. #### Response Example ```json { "example": "response body" } ``` #### Error Responses - **400** Bad Request: Error due to API client issues. - **500** Internal Server Error: Error during server-side processing. ``` -------------------------------- ### Binary Data Response Sample Source: https://laws.e-gov.go.jp/api/2/redoc This indicates that the API will return binary data, such as images or PDF files, when a specific attachment is requested. ```text (ここにバイナリデータが返却されます) ``` -------------------------------- ### XML Bulk Download Source: https://laws.e-gov.go.jp/api/2/redoc Provides URLs for downloading all legal data, legal data by category, and the latest updated legal data in XML format. ```APIDOC ## XML Bulk Download ### Description Download legal data in bulk in XML format. ### Endpoints #### All Legal Data ``` https://laws.e-gov.go.jp/bulkdownload?file_section=1&only_xml_flag=true ``` #### Legal Data by Category ``` https://laws.e-gov.go.jp/bulkdownload?file_section=2&category_cd={category_cd}&only_xml_flag=true ``` * **Note**: `{category_cd}` should reference the `category_cd` from Schemas. Remove leading zeros from the 2nd and 3rd digits (e.g., use `1` for Constitution instead of `001`). #### Latest Updated Legal Data ``` https://laws.e-gov.go.jp/bulkdownload?file_section=3&update_date={YYYYMMDD}&only_xml_flag=true ``` * **Note**: `{YYYYMMDD}` specifies the date in 'YearMonthDay' format (e.g., `20240101` for January 1, 2024). The retrieval range for updated legal data is the past three months. ``` -------------------------------- ### API Endpoint for Law File Download Source: https://laws.e-gov.go.jp/api/2/redoc This endpoint allows downloading law text files. You must provide a law identifier (law_id, law_num, or law_revision_id) and the file type. An optional 'asof' parameter can filter by date. ```http get/law_file/{file_type}/{law_id_or_num_or_revision_id} ``` -------------------------------- ### Search Laws by Keyword Source: https://laws.e-gov.go.jp/api/2/redoc This endpoint allows you to search for legal documents based on keywords. You can specify various parameters to refine your search, such as law number, promulgation date, and category. The response includes details about the law and its revisions, as well as the text of relevant articles. ```APIDOC ## GET /keyword ### Description Searches for legal documents based on keywords and various filtering criteria. ### Method GET ### Endpoint https://laws.e-gov.go.jp/api/2/keyword ### Parameters #### Query Parameters - **keyword** (string) - Required - Keyword to search for within the legal text. Supports wildcard, AND, OR, and NOT searches. - **law_num** (string) - Optional - Law number (partial match). - **law_num_era** (string) - Optional - Era of the law number. Enum: "Meiji", "Taisho", "Showa", "Heisei", "Reiwa". - **law_num_num** (string) - Optional - Serial number of the law. - **law_num_type** (string) - Optional - Type of law number. Enum: "Constitution", "Act", "CabinetOrder", "ImperialOrder", "MinisterialOrdinance", "Rule", "Misc". - **law_num_year** (integer) - Optional - Year of the law number. - **law_type** (Array of strings) - Optional - Type(s) of law. Items Enum: "Constitution", "Act", "CabinetOrder", "ImperialOrder", "MinisterialOrdinance", "Rule", "Misc". - **asof** (string) - Optional - Date to specify the version of the law. If omitted, the current version is used. - **category_cd** (Array of strings) - Optional - Category code(s) for the law. Items Enum: "001" through "050". - **promulgation_date_from** (string) - Optional - Start date for promulgation. - **promulgation_date_to** (string) - Optional - End date for promulgation. - **limit** (integer) - Optional - Maximum sum of `position` counts for `sentences` in the response. Default: 100, Max: 1000. - **offset** (integer) - Optional - Starting position for retrieving response data. Default: 0. - **order** (string) - Optional - Specifies the order of the response. Can specify multiple fields with +/- for ascending/descending. Default: `law_info.law_id`. - **response_format** (string) - Optional - Response format. Enum: "json", "xml". Defaults to JSON if not specified or if Accept header is ambiguous. - **sentences_limit** (integer) - Optional - Limits the number of `sentences` displayed. If this exceeds `limit`, `limit` takes precedence. - **sentence_text_size** (integer) - Optional - Display character count for `text` within `sentences`. Default: 100. - **highlight_tag** (string) - Optional - HTML tag name to enclose the matched keywords. Default: `span`. ### Responses #### Success Response (200) - **law_info** (object) - Contains data independent of revision history, such as law number and promulgation date. - **revision_info** (object) - Contains data dependent on revision history, such as the revised law title and amendment promulgation date. If `asof` is specified, the latest revision history as of that date is included. - **sentences** (object) - Contains the structure (e.g., `position`) and content (e.g., `text`) of legal articles matching the `keyword`. #### Error Responses - **400** Bad Request: Error due to issues on the API client side. - **500** Internal Server Error: Error during server-side processing. ``` -------------------------------- ### JSON Response Sample for Law Data Source: https://laws.e-gov.go.jp/api/2/redoc This JSON structure represents a successful response containing information about a law, including attached files, revision details, and the full text. ```json { "attached_files_info": { "image_data": "", "attached_files": [ { "law_revision_id": "411AC0000000127_19990813_000000000000000", "src": "./pict/H11HO127-001.jpg", "updated": "2024-11-23T01:05:36+09:00" }, { "law_revision_id": "411AC0000000127_19990813_000000000000000", "src": "./pict/H11HO127-002.jpg", "updated": "2024-11-23T01:05:36+09:00" } ] }, "law_info": { "law_type": "Act", "law_id": "411AC0000000127", "law_num": "平成十一年法律第百二十七号", "law_num_era": "Heisei", "law_num_year": "11", "law_num_type": "Act", "law_num_num": "127", "promulgation_date": "1999-08-13" }, "revision_info": { "law_revision_id": "411AC0000000127_19990813_000000000000000", "law_type": "Act", "law_title": "国旗及び国歌に関する法律", "law_title_kana": "こっきおよびこっかにかんするほうりつ", "abbrev": "国旗国歌法,日の丸君が代法,国旗・国歌法", "category": "文化", "updated": "2024-07-21T13:56:59+09:00", "amendment_promulgate_date": "1999-08-13", "amendment_enforcement_date": "1999-08-13", "amendment_enforcement_comment": null, "amendment_scheduled_enforcement_date": null, "amendment_law_id": null, "amendment_law_title": null, "amendment_law_title_kana": "", "amendment_law_num": null, "amendment_type": "1", "repeal_status": "None", "repeal_date": null, "remain_in_force": false, "mission": "New", "current_revision_status": "CurrentEnforced" }, "law_full_text": { "tag": "Law", "attr": { "Era": "Heisei", "Lang": "ja", "LawType": "Act", "Num": "127", "Year": "11", "PromulgateMonth": "08", "PromulgateDay": "13" }, "children": [ { "tag": "LawNum", "attr": "", "children": [ "平成十一年法律第百二十七号" ] }, { "tag": "LawBody", "attr": "", "children": [ { "tag": "LawTitle", "attr": { "Kana": "こっきおよびこっかにかんするほうりつ", "Abbrev": "国旗国歌法,日の丸君が代法,国旗・国歌法", "AbbrevKana": "こ,ひ,こ" }, "children": [ "国旗及び国歌に関する法律" ] }, { "tag": "MainProvision", "attr": "", "children": [ { "tag": "Article", "attr": { "Delete": "false", "Hide": "false", "Num": "1" }, "children": [ { "tag": "ArticleCaption", "attr": "", "children": [ "(国旗)" ] }, { "tag": "ArticleTitle", "attr": "", "children": [ "第一条" ] }, { "tag": "Paragraph", "attr": { "Hide": "false", "Num": "1", "OldStyle": "false" } } ] } ] } ] } ] } } ```