{
  "openapi": "3.0.1",
  "info": {
    "title": "Latvia Company Taxes & Employees (VID)",
    "description": "Taxes paid, payroll taxes and average employees for every Latvian company, from official VID open data (CC0). Filter by NACE, municipality, size. Sole traders excluded for GDPR.",
    "version": "0.1",
    "x-build-id": "kNEyHNbDJ92ojVzxO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ayuki~latvia-company-taxes-employees-vid/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ayuki-latvia-company-taxes-employees-vid",
        "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/ayuki~latvia-company-taxes-employees-vid/runs": {
      "post": {
        "operationId": "runs-sync-ayuki-latvia-company-taxes-employees-vid",
        "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/ayuki~latvia-company-taxes-employees-vid/run-sync": {
      "post": {
        "operationId": "run-sync-ayuki-latvia-company-taxes-employees-vid",
        "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": {
          "dataset": {
            "title": "Dataset / Datu kopa",
            "enum": [
              "annual",
              "quarterly"
            ],
            "type": "string",
            "description": "Annual: available tax years with taxes, average employees, legal form, NACE and municipality. Quarterly: the latest published quarterly CSV, also including VAT paid/refunded. Available periods depend on VID; no fixed year is selected by default.",
            "default": "annual"
          },
          "maxItems": {
            "title": "Maximum output records",
            "minimum": 0,
            "type": "integer",
            "description": "Default: 100 company-period records for a quick preview. Stops after this many matching rows in source order; this is not a ranking or a limit on unique companies. Set 0 explicitly for all matching records. The complete CSV is downloaded even for a small limit.",
            "default": 100
          },
          "taxYear": {
            "title": "Tax year",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional year filter for either dataset, e.g. 2024. Leave empty to include all years available in the selected CSV. A year not present in the source returns no records."
          },
          "quarter": {
            "title": "Quarter (quarterly dataset only)",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Optional quarterly filter: 1, 2, 3 or 4. Ignored for annual data. Leave empty to use the published quarterly data; an unavailable quarter returns no records."
          },
          "registrationNumbers": {
            "title": "Company registration numbers / Reģistrācijas numuri",
            "type": "array",
            "description": "Optional list of Latvian company registration numbers, supplied as strings to preserve leading zeros. Any listed number may match. Leave empty for all companies. Example: [\"40003004589\", \"40003016728\"].",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Name contains",
            "type": "string",
            "description": "Optional case-insensitive substring of the company name, e.g. Helmes. Leave empty for no name filter. Combined with all other filters."
          },
          "naceCodes": {
            "title": "NACE activity code prefixes / Nozares",
            "type": "array",
            "description": "Optional list of main-activity NACE prefixes. Any prefix may match, e.g. [\"62\"] for IT or [\"4941\"] for road freight. Dots are removed before matching. Quarterly NACE comes from the latest available annual record; missing NACE cannot match this filter.",
            "items": {
              "type": "string"
            }
          },
          "municipality": {
            "title": "Municipality (ATVK code or name)",
            "type": "string",
            "description": "Optional ATVK code (e.g. 010096) or exact source name (e.g. Ziemeļu rajons), matched case-insensitively. Riga is split into districts; Rīga or 010000 does not select all Riga districts. Leading zeros in codes are tolerated. Leave empty for all regions."
          },
          "minEmployees": {
            "title": "Minimum average employees",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum average employees in the selected period, e.g. 10. Leave empty for no headcount filter. Zero is treated as the employee count when the source value is missing."
          },
          "minTaxesPaid": {
            "title": "Minimum total taxes paid (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum total VID-administered taxes in EUR, e.g. 100000. Source values in thousand EUR are converted before filtering. Leave empty to keep all amounts, including negative net totals. Setting 0 excludes negative totals."
          },
          "includeSoleTraders": {
            "title": "Include sole traders (Individuālais komersants)",
            "type": "boolean",
            "description": "⚠️ GDPR: sole traders are natural persons. Their names and tax amounts are personal data. Enable only with a lawful basis (e.g. a documented legitimate interest) and a specific purpose. You become a controller of that data. Default: excluded.",
            "default": false
          },
          "enrichQuarterlyWithAnnual": {
            "title": "Enrich quarterly rows with annual data",
            "type": "boolean",
            "description": "Default: true. Adds legal form, NACE and municipality from the latest annual record for each company, which may describe a different period. The annual CSV is also loaded when sole traders are excluded (the default), or when a NACE/municipality filter is used, even if this toggle is false. Turning it off alone does not avoid that download.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}