{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Statistics Scraper (e-Stat)",
    "description": "Extract official Japanese government statistics from e-Stat, Japan's national statistics portal. Search 6,000+ datasets covering population, GDP, trade, employment, agriculture, health, education, and more. Download data with English labels and automatic dimension code resolution.",
    "version": "1.0",
    "x-build-id": "HCPQvYjJZRHLXkOzL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rationalistic_counsel~estat-japan-statistics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rationalistic_counsel-estat-japan-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/rationalistic_counsel~estat-japan-statistics/runs": {
      "post": {
        "operationId": "runs-sync-rationalistic_counsel-estat-japan-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/rationalistic_counsel~estat-japan-statistics/run-sync": {
      "post": {
        "operationId": "run-sync-rationalistic_counsel-estat-japan-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": "e-Stat Application ID",
            "type": "string",
            "description": "Your e-Stat Application ID (appId). This is free — register at <a href='https://www.e-stat.go.jp/' target='_blank'>e-stat.go.jp</a> and issue an Application ID from your My Page. No usage fees."
          },
          "searchMode": {
            "title": "Search Mode",
            "enum": [
              "searchDatasets",
              "getStatsData",
              "getMetaInfo"
            ],
            "type": "string",
            "description": "Choose what to do: search for datasets, download data from a specific dataset, or explore a dataset's dimensions and codes.",
            "default": "searchDatasets"
          },
          "searchWord": {
            "title": "Search Keyword",
            "type": "string",
            "description": "Keyword to search for datasets. Examples: 'population', 'GDP', 'employment', 'trade', 'agriculture'. Required for Search Datasets mode. Ignored in Get Data and Get Metadata modes."
          },
          "statsDataId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "e-Stat dataset ID (e.g., '0003445099'). Find this using Search Datasets mode first. Required for Get Data and Get Metadata modes."
          },
          "language": {
            "title": "Language",
            "enum": [
              "E",
              "J"
            ],
            "type": "string",
            "description": "Output language. English has good coverage for major datasets. Japanese returns all datasets.",
            "default": "E"
          },
          "surveyYears": {
            "title": "Survey Year Filter",
            "type": "string",
            "description": "Filter datasets by survey year (Search Datasets mode only). Format: YYYY for a single year, YYYY-YYYY for a range, or YYYY- for all years from a start year."
          },
          "statsField": {
            "title": "Statistics Field",
            "type": "string",
            "description": "Statistics field code (Search Datasets mode only). Examples: '02' = Population/Households, '03' = Labor/Wages, '07' = Business/Enterprise, '10' = Transport/Communication, '11' = Commerce/Trade."
          },
          "statsCode": {
            "title": "Statistics Code",
            "type": "string",
            "description": "Government statistics code (Search Datasets mode only). Identifies the specific survey or statistical program, e.g., '00200521' for Population Census."
          },
          "cdTab": {
            "title": "Tab Code Filter",
            "type": "string",
            "description": "Tab code to filter data (Get Data mode only). Selects which statistical table to retrieve. Use Get Metadata mode to find available tab codes."
          },
          "cdArea": {
            "title": "Area Code Filter",
            "type": "string",
            "description": "Area code to filter data (Get Data mode only). Use '00000' for national total, '13000' for Tokyo, etc."
          },
          "cdCat01": {
            "title": "Category 01 Filter",
            "type": "string",
            "description": "First category dimension filter (Get Data mode only). Use Get Metadata mode first to find available codes."
          },
          "cdCat02": {
            "title": "Category 02 Filter",
            "type": "string",
            "description": "Second category dimension filter (Get Data mode only). Use Get Metadata mode first to find available codes."
          },
          "cdTime": {
            "title": "Time Period Filter",
            "type": "string",
            "description": "Time period code filter (Get Data mode only). Use Get Metadata mode first to find available time codes."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of results to return. Large datasets may have millions of rows — use filters to narrow results.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}