{
  "openapi": "3.0.1",
  "info": {
    "title": "Finland Company Registry (PRH YTJ)",
    "version": "0.1",
    "x-build-id": "plVUDeoltlRUoGJrw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/goobertje~finland-company-registry/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-goobertje-finland-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/goobertje~finland-company-registry/runs": {
      "post": {
        "operationId": "runs-sync-goobertje-finland-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/goobertje~finland-company-registry/run-sync": {
      "post": {
        "operationId": "run-sync-goobertje-finland-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": {
          "businessIds": {
            "title": "Business IDs (lookup)",
            "type": "array",
            "description": "Look up these companies by business ID: 7 digits, a hyphen and a check digit, for example 0112038-9. Spaces are ignored and the Finnish check digit is verified. Up to 2000. Cannot be combined with any search filter: when you fill in this field, clear the other fields first. An invalid ID gives a free 'invalid_business_id' row, an unknown one a free 'not_found' row. Example: [\"0112038-9\", \"3661661-6\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "name": {
            "title": "Name contains",
            "type": "string",
            "description": "Search companies by name, as the API matches it. Only letters, digits, spaces, hyphens, apostrophes, ampersands and dots are used (other characters become spaces). Not a business ID: use 'Business IDs' for that. Example: \"Fiskars\"."
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Keep companies registered in this municipality, by name, for example Oulu, Helsinki or Espoo. Prefilled with Oulu so a first run returns data: clear it before using 'Business IDs'. Example: \"Oulu\"."
          },
          "postCode": {
            "title": "Postal code",
            "type": "string",
            "description": "Keep companies with this 5-digit Finnish postal code, for example 90100. One code per run. Example: \"90100\"."
          },
          "companyForm": {
            "title": "Company form",
            "type": "string",
            "description": "Keep companies with this company form code, as used by the YTJ API: 16 (osakeyhtiö / limited company), 17 (julkinen osakeyhtiö / public limited company), 14 (yksityinen elinkeinonharjoittaja / sole trader), and so on. One code per run. Example: \"16\"."
          },
          "mainBusinessLine": {
            "title": "Main business line (TOL / NACE)",
            "type": "string",
            "description": "Keep companies with this main business line code: 2 to 5 digits, for example 62200 (computer consultancy), 70100 (head offices) or 62100 (computer programming). One code per run. Example: \"62200\"."
          },
          "registrationDateFrom": {
            "title": "Registered since",
            "type": "string",
            "description": "Keep companies whose registration date in the trade register is on or after this date, format YYYY-MM-DD. Empty means any. Example: \"2026-01-01\"."
          },
          "registrationDateTo": {
            "title": "Registered until",
            "type": "string",
            "description": "Keep companies whose registration date is on or before this date, format YYYY-MM-DD. Must not be earlier than 'Registered since'. Empty means any. Example: \"2026-11-30\"."
          },
          "includeEnded": {
            "title": "Include ended companies",
            "type": "boolean",
            "description": "Include companies that have an end date (they have ceased and are no longer active). Applies to searches and to explicit business ID lookups. Default: false, so only active companies are delivered.",
            "default": false
          },
          "language": {
            "title": "Language of names and descriptions",
            "enum": [
              "en",
              "fi",
              "sv"
            ],
            "type": "string",
            "description": "Language used for company form, business line and city descriptions. Falls back to Finnish, then to any language the record has. Company names are returned as registered. Default: en.",
            "default": "en"
          },
          "maxItems": {
            "title": "Maximum companies",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many companies are delivered (and charged). 1 to 100000. Default: 100. One search reads at most 100 result pages (about 10,000 companies); split larger lists by location, postal code or registration date.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}