{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan e-Gov Law Search (Law API v2)",
    "description": "Unofficial client for the official e-Gov Law API v2 (Digital Agency Japan, no key). List Japanese laws by type, keyword-search law text, or download a law's full text as structured 編/章/条/項 articles. 政府標準利用規約 2.0.",
    "version": "0.1",
    "x-build-id": "e4IFsMBjkUcYEbHAd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-laws-egov/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-laws-egov",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jpopendata~japan-laws-egov/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-laws-egov",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jpopendata~japan-laws-egov/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-laws-egov",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "list",
              "search",
              "get_law"
            ],
            "type": "string",
            "description": "`search` (default) runs a full-text keyword search (e-Gov keyword) and returns matching laws with the matched snippets — set keyword. `list` returns a 法令一覧 (law index) filtered by law type — set lawType. `get_law` downloads one law's full text and returns its 編/章/節/条/項 articles as structured JSON — set lawId or lawNum. Case-insensitive; if you pass only a lawId the Actor switches to get_law for you. Example: \"search\".",
            "default": "search"
          },
          "keyword": {
            "title": "Search keyword (search)",
            "type": "string",
            "description": "search mode (REQUIRED there): free-text query over law bodies (e-Gov `keyword`), Japanese, e.g. \"個人情報保護\", \"労働時間\", \"電子署名\". Ignored in list / get_law modes."
          },
          "lawType": {
            "title": "Law type (list / search)",
            "enum": [
              "Constitution",
              "Act",
              "CabinetOrder",
              "ImperialOrder",
              "MinisterialOrdinance",
              "Rule",
              "Misc"
            ],
            "type": "string",
            "description": "list mode (REQUIRED there) / search mode (optional filter): the law type. Constitution=憲法, Act=法律 (most statutes), CabinetOrder=政令, ImperialOrder=勅令, MinisterialOrdinance=府省令, Rule=規則, Misc=その他. Japanese names (\"法律\") are accepted too. Example: \"Act\"."
          },
          "lawId": {
            "title": "Law ID (get_law)",
            "type": "string",
            "description": "get_law mode (REQUIRED there unless lawNum is given): the e-Gov law id, e.g. \"415AC0000000057\" (個人情報保護法) — take it from a search/list run (the `lawId` field). A law_revision_id also works."
          },
          "lawNum": {
            "title": "Law number (get_law)",
            "type": "string",
            "description": "get_law mode (alternative to lawId): the 法令番号 in the official Japanese form, e.g. \"平成十五年法律第五十七号\" (kanji numerals, exactly as e-Gov prints it)."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum records to output, 1-100000 — laws (list/search) or articles (get_law). PPE charges per record. Example: 1000.",
            "default": 1000
          },
          "maxApiRequests": {
            "title": "Max upstream requests per run",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Hard safety cap on upstream requests per run, 1-25 (list/search page 1000 per request; get_law is one request). Politeness (1 connection, >= 1.2 s spacing, exponential backoff on 429/5xx) is enforced in code. Example: 10.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Default is NO proxy (direct connection) — a public government API rarely needs one. The Actor backs off exponentially on 429/5xx and fails visibly on a persistent block; it never attempts rate-limit evasion.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}