{
  "openapi": "3.0.1",
  "info": {
    "title": "Kolada: Sweden Municipalities KPIs and Municipal Statistics",
    "description": "Returns key figures (KPIs) for Sweden's 290 municipalities and 21 regions from Kolada (RKA): population, tax rates, schools, elderly care, costs and 5 000+ more, one row per area, year and gender. Search KPIs by keyword or id. Supports onlyNew for scheduled runs.",
    "version": "0.1",
    "x-build-id": "pBAboy39GRv9zWXju"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nightwave-owner~kolada-municipal-kpis/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nightwave-owner-kolada-municipal-kpis",
        "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/nightwave-owner~kolada-municipal-kpis/runs": {
      "post": {
        "operationId": "runs-sync-nightwave-owner-kolada-municipal-kpis",
        "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/nightwave-owner~kolada-municipal-kpis/run-sync": {
      "post": {
        "operationId": "run-sync-nightwave-owner-kolada-municipal-kpis",
        "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": {
          "kpiIds": {
            "title": "KPI ids",
            "type": "array",
            "description": "Kolada KPI ids, for example N01951 (population), N00901 (municipal tax rate) or N20014 (net cost of elderly care per inhabitant). Leave empty and use kpiSearch to find KPIs by keyword. With neither, population (N01951) is used.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "kpiSearch": {
            "title": "Search KPI titles",
            "type": "string",
            "description": "A word in the Swedish KPI title, for example \"skattesats\" (tax rate), \"skola\" (school), \"äldreomsorg\" (elderly care) or \"arbetslöshet\" (unemployment). The best matches are used (see maxKpis) and the run log lists the others with their ids. Ignored when kpiIds is set.",
            "default": ""
          },
          "maxKpis": {
            "title": "Max KPIs from search",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many of the best matching KPIs to use when searching with kpiSearch, for example 3. 1 to 25, defaults to 3.",
            "default": 3
          },
          "municipalities": {
            "title": "Municipalities or regions",
            "type": "array",
            "description": "Names or Kolada ids, for example \"Lund\", \"Göteborg\", \"Region Skåne\", \"1281\" or \"Sverige\" (the whole country, id 0000). Empty means every area of the chosen municipalityType.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "municipalityType": {
            "title": "Area type",
            "enum": [
              "municipality",
              "region",
              "all"
            ],
            "type": "string",
            "description": "Which areas to return when municipalities is empty: municipality (the 290 kommuner), region (the 21 regions and the whole country) or all. Also decides whether \"Stockholm\" means the municipality or the region.",
            "default": "municipality"
          },
          "years": {
            "title": "Years",
            "type": "array",
            "description": "Years to fetch, for example [\"2023\", \"2024\", \"2025\"]. Empty means the latest year with data for each KPI.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "gender": {
            "title": "Gender",
            "enum": [
              "total",
              "female",
              "male",
              "all"
            ],
            "type": "string",
            "description": "For KPIs split by gender: total (default), female, male or all three. KPIs without a split always return the total.",
            "default": "total"
          },
          "onlyNew": {
            "title": "Only values not delivered before",
            "type": "boolean",
            "description": "For scheduled runs: return and charge only values that earlier runs with the same input have not returned, including values Kolada has revised, for example true for a monthly schedule. The first run returns everything in the selection. Defaults to false.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of values (rows), for example 50. Each row is one billable event. 1 to 100 000, defaults to 50.",
            "default": 50
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}