{
  "openapi": "3.0.1",
  "info": {
    "title": "Poland Company Registry — KRS/REGON Official API",
    "description": "Look up Polish companies by KRS number via the official Ministry of Justice KRS API — free, no key. Returns legal name, form, status, address, PKD activity codes, board/representation. Optional REGON (GUS) enrichment resolves NIP/REGON with your own free GUS key.",
    "version": "0.1",
    "x-build-id": "t8nBWj8dPoHt2TTet"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bovi~poland-company-registry/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bovi-poland-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/bovi~poland-company-registry/runs": {
      "post": {
        "operationId": "runs-sync-bovi-poland-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/bovi~poland-company-registry/run-sync": {
      "post": {
        "operationId": "run-sync-bovi-poland-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": {
          "krsNumbers": {
            "title": "KRS numbers (direct lookup — free, no key)",
            "type": "array",
            "description": "Krajowy Rejestr Sądowy registration numbers, 10 digits (e.g. '0000023302' for KGHM Polska Miedź). No API key needed — the KRS API is open. Returns one full company record per number, including legal form, status, address, PKD activity codes, and board/representation.",
            "items": {
              "type": "string"
            }
          },
          "registryType": {
            "title": "KRS register",
            "enum": [
              "P",
              "S",
              "auto"
            ],
            "type": "string",
            "description": "Which KRS sub-register to search. 'P' = Rejestr Przedsiębiorców (companies — the default, correct choice for almost all business lookups). 'S' = Rejestr Stowarzyszeń (associations/foundations/NGOs). 'auto' tries P first, then falls back to S — costs one extra API call per miss, use only if you're not sure which register a number belongs to.",
            "default": "P"
          },
          "fullExtract": {
            "title": "Fetch full extract (with history)",
            "type": "boolean",
            "description": "When true, fetches OdpisPelny (full extract, includes the complete historical change log) instead of OdpisAktualny (current-state extract, default). Full extracts are larger and rarely needed — leave off unless you specifically need past board members, past addresses, or past PKD codes.",
            "default": false
          },
          "regonApiKey": {
            "title": "REGON API key (optional — for NIP/REGON lookups)",
            "type": "string",
            "description": "Free key from GUS (Polish Central Statistical Office), required ONLY if you use nipNumbers or regonNumbers below. Unlike the KRS API, this is NOT instant self-serve — you email regon_bir@stat.gov.pl with your details and IP address; GUS issues the key manually (see README 'Getting your REGON API key'). Leave blank if you only need krsNumbers lookups."
          },
          "nipNumbers": {
            "title": "NIP numbers (tax IDs, via REGON)",
            "type": "array",
            "description": "Polish tax identification numbers (NIP, 10 digits) to resolve via the REGON API. Requires regonApiKey. The KRS API itself has no NIP search — this is the only free official path from 'I have a NIP' to company data.",
            "items": {
              "type": "string"
            }
          },
          "regonNumbers": {
            "title": "REGON numbers (statistical IDs)",
            "type": "array",
            "description": "REGON statistical register numbers (9 or 14 digits) to look up directly via the REGON API. Requires regonApiKey.",
            "items": {
              "type": "string"
            }
          },
          "useRegonTestEnv": {
            "title": "Use REGON sandbox (test key demo only)",
            "type": "boolean",
            "description": "For evaluation only. Routes REGON calls to GUS's public test sandbox (works with the well-known test key without any signup) instead of production. The sandbox database is a frozen, address-anonymized snapshot from 2014 — fine for verifying the integration works, not useful for real lookups. Leave off for real runs.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}