{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan e-Stat Official Statistics (Official API)",
    "description": "Search and download Japan's official government statistics via the official e-Stat API v3.0: find statistical tables, then pull their values with every dimension resolved to English names. You supply your own e-Stat application ID. Unofficial; not affiliated with the Statistics Bureau of Japan.",
    "version": "0.1",
    "x-build-id": "Ogo8wpWbsLp7NdhQG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-estat-statistics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-estat-statistics",
        "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-estat-statistics/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-estat-statistics",
        "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-estat-statistics/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-estat-statistics",
        "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 e-Stat application ID (required)",
            "type": "string",
            "description": "REQUIRED. YOUR OWN e-Stat application ID (アプリケーションID — a 40-character hex string). This Actor does NOT bundle a shared key — the e-Stat terms of use (第3条第2項) forbid transferring an application ID to a third party, so every request runs under your own registration and e-Stat's access limits apply to you. Register for free: https://www.e-stat.go.jp/mypage/user/preregister → マイページ → API機能(アプリケーションID発行) → copy the appId."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search_tables",
              "get_data"
            ],
            "type": "string",
            "description": "`search_tables` (default) finds statistical tables (getStatsList) — set searchWord and/or statsCode. `get_data` downloads the values of one table (getStatsData) — set statsDataId. Aliases \"search\"/\"data\" are accepted; if you pass only a statsDataId the Actor switches to get_data for you. Example: \"search_tables\".",
            "default": "search_tables"
          },
          "searchWord": {
            "title": "Search keyword (search_tables)",
            "type": "string",
            "description": "search_tables mode: free-text search over statistical tables. Japanese matches best (e.g. \"人口\", \"世帯\", \"賃金\"); English works where e-Stat provides it. Supports AND / OR / NOT (e.g. \"人口 AND 世帯\"). At least one of searchWord or statsCode is required in search_tables mode."
          },
          "statsCode": {
            "title": "Government statistics code (search_tables)",
            "type": "string",
            "description": "search_tables mode (optional): 5-digit agency code or 8-digit government statistics code to restrict the table search, e.g. \"00200521\" (国勢調査 / Population Census), \"00200502\" (労働力調査). Find codes in the e-Stat statistics list."
          },
          "surveyYears": {
            "title": "Survey years (search_tables)",
            "type": "string",
            "description": "search_tables mode (optional): filter tables by survey period — yyyy (e.g. \"2020\"), yyyymm (e.g. \"202010\"), or yyyymm-yyyymm (e.g. \"201501-202012\")."
          },
          "statsDataId": {
            "title": "Statistical table ID (get_data)",
            "type": "string",
            "description": "get_data mode (REQUIRED there): the e-Stat statistical table ID (statsDataId, 10 digits, e.g. \"0003448233\") to download — take it from a search_tables run (the `statsDataId` field)."
          },
          "narrowingCond": {
            "title": "Narrowing conditions (get_data)",
            "type": "object",
            "description": "get_data mode (optional): filters as e-Stat classification codes. Allowed keys: cdArea, cdTime, cdTab, cdCat01, cdCat02, cdCat03 — each a comma-separated code list, e.g. {\"cdArea\":\"13000\",\"cdTime\":\"2020000000\"} (13000 = 東京都). Discover codes from the table's metadata."
          },
          "lang": {
            "title": "Language of names",
            "enum": [
              "E",
              "J"
            ],
            "type": "string",
            "description": "Language for statistic / dimension / category names. \"E\" (default) returns English where e-Stat provides it; \"J\" returns Japanese. Aliases \"en\"/\"ja\"/\"english\"/\"japanese\" are accepted.",
            "default": "E"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of records (tables or values) to output, 1-100000 (default 1000). e-Stat paginates up to 100,000 rows per request; runs page under this automatically.",
            "default": 1000
          },
          "maxApiRequests": {
            "title": "Max upstream requests per run",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Hard safety cap on API requests per run, 1-25 (default 10). Politeness (1 connection, >= 1.5 s spacing, exponential backoff on 429/5xx) is enforced in code; the e-Stat terms forbid short-burst bulk access.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Default is NO proxy (direct connection) — an official JSON 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}