{
  "openapi": "3.0.1",
  "info": {
    "title": "Estonia Company Registry: Revenue and Activity Search",
    "description": "Search Estonian register records by name, location or activity and review latest available annual-report revenue.",
    "version": "0.1",
    "x-build-id": "HAavi3cyWzBkkWa6m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrslm_data~estonia-company-registry/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrslm_data-estonia-company-registry",
        "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/mrslm_data~estonia-company-registry/runs": {
      "post": {
        "operationId": "runs-sync-mrslm_data-estonia-company-registry",
        "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/mrslm_data~estonia-company-registry/run-sync": {
      "post": {
        "operationId": "run-sync-mrslm_data-estonia-company-registry",
        "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": {
          "searchTerms": {
            "title": "Company names",
            "type": "array",
            "description": "Words or phrases the company name must contain (case and accents ignored), e.g. software, logistika, Bolt. One per line. Leave everything empty to run the example search (software, top 20 by revenue).",
            "items": {
              "type": "string"
            }
          },
          "regCodes": {
            "title": "Registry codes",
            "type": "array",
            "description": "Exact 8-digit Estonian registry codes (registrikood), e.g. 14532901. Always returned, whatever the other filters say.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "City, parish or county",
            "type": "array",
            "description": "Text that must appear in the registered address or its administrative unit, e.g. Tallinn, Tartu linn, Pärnu, Ida-Viru maakond, Kesklinna linnaosa.",
            "items": {
              "type": "string"
            }
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Default: all commercial forms (OÜ, AS, partnerships, cooperatives, branches, SE). Sole proprietors (FIE) are never returned.",
            "items": {
              "type": "string",
              "enum": [
                "OU",
                "AS",
                "UU",
                "TU",
                "TUH",
                "FIL",
                "SE",
                "EMHU",
                "SCE",
                "MTU",
                "SA",
                "KU",
                "AMU",
                "MPU",
                "ERA",
                "KOV",
                "RIIK",
                "AOJI"
              ],
              "enumTitles": [
                "Private limited company (OÜ)",
                "Public limited company (AS)",
                "Limited partnership (UÜ)",
                "General partnership (TÜ)",
                "Commercial association / cooperative (TÜH)",
                "Branch of a foreign company",
                "European company (SE)",
                "European economic interest grouping",
                "European cooperative society",
                "Non-profit association (MTÜ)",
                "Foundation (SA)",
                "Apartment association",
                "Trade union",
                "Land improvement association",
                "Political party",
                "Local government agency",
                "State agency or institution",
                "Legal person in public law"
              ]
            }
          },
          "includeNonProfits": {
            "title": "Include non-profits and public bodies",
            "type": "boolean",
            "description": "When no legal form is picked, also return non-profit associations, foundations, apartment associations, unions, parties and public bodies.",
            "default": false
          },
          "activeOnly": {
            "title": "Registered companies only",
            "type": "boolean",
            "description": "Skip companies in liquidation or bankruptcy. Deleted companies are not in the source file.",
            "default": true
          },
          "registeredWithinDays": {
            "title": "Registered within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only companies first entered in the register in the last N days. 0 = any date. Use 30 for a monthly new-company list.",
            "default": 0
          },
          "vatRegisteredOnly": {
            "title": "VAT-registered only",
            "type": "boolean",
            "description": "Only companies with an Estonian VAT number (KMKR).",
            "default": false
          },
          "includeFinancials": {
            "title": "Add latest annual report",
            "type": "boolean",
            "description": "Join the latest annual report: year, size class, audit flag, revenue and main activity (EMTAK / NACE). Adds about 15 seconds.",
            "default": true
          },
          "minRevenueEur": {
            "title": "Min revenue (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Revenue in the latest annual report. 0 = no minimum. Companies without a report are dropped when this is set.",
            "default": 0
          },
          "activityCodes": {
            "title": "Activity codes (EMTAK / NACE)",
            "type": "array",
            "description": "Code prefixes without dots, matched against the activities in the latest annual report, e.g. 62 (IT), 6210 (programming), 41 (construction), 5610 (restaurants).",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "newest",
              "oldest",
              "revenue",
              "name"
            ],
            "type": "string",
            "description": "Order of the results, applied before the limits.",
            "default": "newest"
          },
          "maxResultsPerSearch": {
            "title": "Max results per name",
            "minimum": 0,
            "type": "integer",
            "description": "Cap per company-name search term. 0 = no cap.",
            "default": 0
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Total cap. You pay per company saved. 0 = no cap.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}