{
  "openapi": "3.0.1",
  "info": {
    "title": "CEPiK Vehicle Registrations API – Poland Official Stats",
    "description": "CEPiK vehicle registration statistics for Poland from the official open data API: monthly counts by make, model, fuel, powertrain (EV, hybrid), origin, year and region. Aggregates only, no VINs or owners. Export CSV, JSON or Excel.",
    "version": "0.1",
    "x-build-id": "1IO5UqIFZoXcMk8aU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enterprising_hamster~polish-vehicle-registrations-cepik/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enterprising_hamster-polish-vehicle-registrations-cepik",
        "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/enterprising_hamster~polish-vehicle-registrations-cepik/runs": {
      "post": {
        "operationId": "runs-sync-enterprising_hamster-polish-vehicle-registrations-cepik",
        "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/enterprising_hamster~polish-vehicle-registrations-cepik/run-sync": {
      "post": {
        "operationId": "run-sync-enterprising_hamster-polish-vehicle-registrations-cepik",
        "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": {
          "monthFrom": {
            "title": "From month",
            "pattern": "^(\\d{4}-(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "First month, YYYY-MM (e.g. 2026-01). Leave both months empty for the last complete month. With only From, the range runs to the current month (marked partialPeriod)."
          },
          "monthTo": {
            "title": "To month",
            "pattern": "^(\\d{4}-(0[1-9]|1[0-2]))?$",
            "type": "string",
            "description": "Last month, YYYY-MM. Months are reported newest first. At most 60 months per run."
          },
          "areaLevel": {
            "title": "Area level",
            "enum": [
              "POLAND",
              "VOIVODESHIP"
            ],
            "type": "string",
            "description": "Report one total for Poland (or for the selected voivodeships together) or one block of rows per voivodeship.",
            "default": "POLAND"
          },
          "voivodeships": {
            "title": "Voivodeships (regions)",
            "type": "array",
            "description": "Default: 14 MAZOWIECKIE. Clear the field (empty list) for all of Poland (all 16 voivodeships plus records with no voivodeship, code XX); all of Poland reads 17 voivodeships and takes several minutes when CEPiK is busy.",
            "items": {
              "type": "string",
              "enum": [
                "02",
                "04",
                "06",
                "08",
                "10",
                "12",
                "14",
                "16",
                "18",
                "20",
                "22",
                "24",
                "26",
                "28",
                "30",
                "32",
                "XX"
              ],
              "enumTitles": [
                "02 DOLNOŚLĄSKIE",
                "04 KUJAWSKO-POMORSKIE",
                "06 LUBELSKIE",
                "08 LUBUSKIE",
                "10 ŁÓDZKIE",
                "12 MAŁOPOLSKIE",
                "14 MAZOWIECKIE",
                "16 OPOLSKIE",
                "18 PODKARPACKIE",
                "20 PODLASKIE",
                "22 POMORSKIE",
                "24 ŚLĄSKIE",
                "26 ŚWIĘTOKRZYSKIE",
                "28 WARMIŃSKO-MAZURSKIE",
                "30 WIELKOPOLSKIE",
                "32 ZACHODNIOPOMORSKIE",
                "XX NIEOKREŚLONE"
              ]
            },
            "default": [
              "14"
            ]
          },
          "groupBy": {
            "title": "Group by",
            "type": "array",
            "description": "Columns to count by. Empty = one total per month and area (fastest: counts come straight from the API without reading records).",
            "items": {
              "type": "string",
              "enum": [
                "brand",
                "model",
                "fuelType",
                "alternativeFuel",
                "powertrain",
                "vehicleType",
                "origin",
                "condition",
                "productionYear",
                "county"
              ],
              "enumTitles": [
                "Make (marka)",
                "Model",
                "Primary fuel",
                "Alternative fuel (hybrids show ENERGIA ELEKTRYCZNA)",
                "Powertrain: ELECTRIC, HYBRID, PETROL, DIESEL, GAS, HYDROGEN, OTHER",
                "Vehicle type",
                "Origin (new/used, bought in Poland/imported)",
                "NEW / USED / OTHER",
                "Production year",
                "County (powiat), needs area level Voivodeship"
              ]
            },
            "default": [
              "brand",
              "model"
            ]
          },
          "vehicleType": {
            "title": "Vehicle type",
            "enum": [
              "ANY",
              "PASSENGER_CAR",
              "TRUCK",
              "MOTORCYCLE",
              "MOPED",
              "BUS",
              "ROAD_TRACTOR",
              "AGRICULTURAL_TRACTOR",
              "SPECIAL_VEHICLE",
              "LIGHT_TRAILER",
              "TRAILER",
              "SEMI_TRAILER",
              "AGRICULTURAL_TRAILER"
            ],
            "type": "string",
            "description": "Count only this vehicle type (exact CEPiK value).",
            "default": "PASSENGER_CAR"
          },
          "fuelType": {
            "title": "Primary fuel",
            "enum": [
              "ANY",
              "PETROL",
              "DIESEL",
              "ELECTRIC",
              "LPG",
              "CNG",
              "LNG",
              "HYDROGEN",
              "BIODIESEL",
              "ETHANOL",
              "PETROL_OIL_MIX",
              "OTHER",
              "NOT_APPLICABLE"
            ],
            "type": "string",
            "description": "Count only this primary fuel. Hybrids are registered with petrol or diesel as primary fuel; use groupBy powertrain to see them.",
            "default": "ELECTRIC"
          },
          "origin": {
            "title": "Origin",
            "enum": [
              "ANY",
              "NEW_BOUGHT_IN_POLAND",
              "NEW_IMPORTED",
              "USED_BOUGHT_IN_POLAND",
              "USED_IMPORTED",
              "RE_REGISTRATION",
              "REGISTRATION_OFFICE_CHANGE",
              "RECOVERED_AFTER_THEFT",
              "ENTRUSTED_BY_FOREIGN_ENTITY",
              "BOUGHT_FROM_STATE_SERVICES",
              "FORFEITED_TO_STATE"
            ],
            "type": "string",
            "description": "Count only vehicles of this origin, e.g. new cars bought in Poland or used imports.",
            "default": "ANY"
          },
          "brand": {
            "title": "Make",
            "type": "string",
            "description": "Optional exact make as registered, e.g. TOYOTA (case does not matter)."
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "Optional exact model as registered, e.g. MODEL Y."
          },
          "dateBasis": {
            "title": "Date basis",
            "enum": [
              "FIRST_REGISTRATION_IN_POLAND",
              "LAST_REGISTRATION"
            ],
            "type": "string",
            "description": "Which registration date puts a vehicle in a month.",
            "default": "FIRST_REGISTRATION_IN_POLAND"
          },
          "onlyCurrentlyRegistered": {
            "title": "Only vehicles still registered",
            "type": "boolean",
            "description": "CEPiK's default: count only vehicles that are registered today. Turn off to include vehicles deregistered since.",
            "default": true
          },
          "topN": {
            "title": "Top N rows per month and area",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Keep only the N largest groups per month and area. 0 = all groups.",
            "default": 0
          },
          "minRegistrations": {
            "title": "Minimum registrations per row",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Skip groups smaller than this.",
            "default": 1
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap of dataset rows (each row is one charged event).",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new or changed rows",
            "type": "boolean",
            "description": "Skip rows already delivered by an earlier run with the same state key and the same count. Useful for schedules.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the remembered set of delivered rows (letters, digits, - and _)."
          },
          "cacheTtlHours": {
            "title": "Cache lifetime (hours)",
            "minimum": 0,
            "maximum": 720,
            "type": "integer",
            "description": "Reuse breakdowns that needed more than 1,000 records and were read by an earlier run of yours within this many hours. 0 = always ask CEPiK.",
            "default": 24
          },
          "maxRequestsPerSecond": {
            "title": "Max requests per second",
            "minimum": 0.2,
            "maximum": 3,
            "type": "number",
            "description": "Politeness limit towards api.cepik.gov.pl. Requests are always sent one at a time.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}