{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Corporate Numbers — NTA 法人番号 (Official API)",
    "description": "Look up Japan's registered corporations via the official National Tax Agency 法人番号 Web-API: by corporate number, by name, or by change period. Returns number, name, address, postcode, type and registry dates (English-keyed). Bring your own free NTA application ID. No personal data. Unofficial.",
    "version": "0.1",
    "x-build-id": "V2gwA9OgvnxQYLCNe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-corporate-numbers/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-corporate-numbers",
        "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-corporate-numbers/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-corporate-numbers",
        "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-corporate-numbers/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-corporate-numbers",
        "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",
        "required": [
          "appId"
        ],
        "properties": {
          "appId": {
            "title": "Your NTA application ID (required)",
            "type": "string",
            "description": "REQUIRED. YOUR OWN National Tax Agency 法人番号 Web-API application ID (13-digit). This Actor does NOT bundle a shared key — every request runs under your own ID, sent in the `id` query parameter, and the Web-API terms forbid lending/disclosing it to a third party (第9条(1)⑤). The ID is stored as a secret and redacted from all logs. Register (free) and receive an application ID by e-mail/post: https://www.houjin-bangou.nta.go.jp/webapi/ → Web-API機能の利用申請."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "by_number",
              "by_name",
              "by_period"
            ],
            "type": "string",
            "description": "`by_number` (default) looks up corporations by 13-digit corporate number (GET /4/num) — set corporateNumber. `by_name` searches by 商号/name (GET /4/name) — set name. `by_period` fetches corporations newly assigned/changed/closed within a date window (GET /4/diff) — set dateFrom and dateTo. Aliases \"number\"/\"name\"/\"period\" are accepted; if you pass only a name or only dates the Actor switches mode for you. Example: \"by_number\".",
            "default": "by_number"
          },
          "corporateNumber": {
            "title": "Corporate number(s) (by_number)",
            "type": "array",
            "description": "by_number mode (REQUIRED there): one or more 13-digit Japanese corporate numbers (法人番号), e.g. [\"5111101000006\"]. A comma-separated string is also accepted; hyphens/full-width digits are tolerated. Fetched in batches of up to 10 per request.",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "title": "Company name / keyword (by_name)",
            "type": "string",
            "description": "by_name mode (REQUIRED there): trade name / 商号又は名称 to search for, Japanese matches best, e.g. \"トヨタ自動車\"."
          },
          "nameMatch": {
            "title": "Name match mode (by_name)",
            "enum": [
              "prefix",
              "partial"
            ],
            "type": "string",
            "description": "by_name mode: how the name matches — \"prefix\" (前方一致, default) or \"partial\" (部分一致). Japanese labels are accepted.",
            "default": "prefix"
          },
          "prefecture": {
            "title": "Prefecture (by_name / by_period)",
            "enum": [
              "Hokkaido",
              "Aomori",
              "Iwate",
              "Miyagi",
              "Akita",
              "Yamagata",
              "Fukushima",
              "Ibaraki",
              "Tochigi",
              "Gunma",
              "Saitama",
              "Chiba",
              "Tokyo",
              "Kanagawa",
              "Niigata",
              "Toyama",
              "Ishikawa",
              "Fukui",
              "Yamanashi",
              "Nagano",
              "Gifu",
              "Shizuoka",
              "Aichi",
              "Mie",
              "Shiga",
              "Kyoto",
              "Osaka",
              "Hyogo",
              "Nara",
              "Wakayama",
              "Tottori",
              "Shimane",
              "Okayama",
              "Hiroshima",
              "Yamaguchi",
              "Tokushima",
              "Kagawa",
              "Ehime",
              "Kochi",
              "Fukuoka",
              "Saga",
              "Nagasaki",
              "Kumamoto",
              "Oita",
              "Miyazaki",
              "Kagoshima",
              "Okinawa"
            ],
            "type": "string",
            "description": "by_name / by_period modes (optional): restrict by prefecture — pick one of the 47 prefectures by English name, e.g. \"Tokyo\", \"Aichi\" (via the API the Japanese name \"東京都\", the JIS code \"13\" or romanisations such as \"osaka-fu\" also work). Maps to the API `address` filter."
          },
          "corporateType": {
            "title": "Corporate type code (by_name / by_period)",
            "type": "string",
            "description": "by_name / by_period modes (optional): restrict by 法人種別 3-digit code (API `kind`), e.g. \"301\" (株式会社), \"302\" (有限会社), \"305\" (合同会社), \"401\" (外国会社等)."
          },
          "dateFrom": {
            "title": "Change window start (by_period)",
            "type": "string",
            "description": "by_period mode (REQUIRED there): start date of the change window, YYYY-MM-DD, e.g. \"2026-08-01\" (2026/08/01 and 20260801 are tolerated). API `from`."
          },
          "dateTo": {
            "title": "Change window end (by_period)",
            "type": "string",
            "description": "by_period mode (REQUIRED there): end date of the change window, YYYY-MM-DD, e.g. \"2026-08-31\". At most 50 days after dateFrom (NTA hard limit). API `to`."
          },
          "includeHistory": {
            "title": "Include change history (by_number)",
            "type": "boolean",
            "description": "by_number: also return the corporation's change-history rows (history=1). Default: latest only. \"true\"/\"false\" strings are tolerated.",
            "default": false
          },
          "includeHistoryName": {
            "title": "Include past information (by_name)",
            "type": "boolean",
            "description": "by_name: include past/superseded information in the search (change=1). Default: current only.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Maximum number of corporation records to output, 1-500000 (default 1000). Name/period results are division-paged automatically. PPE charges per record.",
            "default": 1000
          },
          "maxApiRequests": {
            "title": "Max upstream requests per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Hard safety cap on API requests per run, 1-100 (default 30). Politeness (1 connection, >= 1.2 s spacing, exponential backoff on 429/5xx) is enforced in code; the Web-API terms forbid 短時間における大量アクセス.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Default is NO proxy (direct connection) — an official 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}