{
  "openapi": "3.0.1",
  "info": {
    "title": "Polish Premises Prospector - REGON jednostki lokalne",
    "description": "Build prospect lists at the physical-site level from the Polish REGON registry. One row per premise (jednostka lokalna) with industry (PKD), address, company age, and ownership, filterable by region (TERYT).",
    "version": "1.0",
    "x-build-id": "65s5rfESdd531jWhZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/regdata~polish-premises-prospector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-regdata-polish-premises-prospector",
        "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/regdata~polish-premises-prospector/runs": {
      "post": {
        "operationId": "runs-sync-regdata-polish-premises-prospector",
        "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/regdata~polish-premises-prospector/run-sync": {
      "post": {
        "operationId": "run-sync-regdata-polish-premises-prospector",
        "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": {
          "seedIdentifiers": {
            "title": "Seed identifiers (NIP / REGON / KRS)",
            "type": "array",
            "description": "List of company identifiers to expand. Auto-detected by shape: 9 or 14 digits = REGON, 10 digits = NIP (override with Seed identifier type). The BIR registry has no geographic search, so you seed the companies to examine here (or via Seed dataset).",
            "items": {
              "type": "string"
            }
          },
          "seedDatasetId": {
            "title": "Seed dataset ID",
            "type": "string",
            "description": "Optional Apify dataset ID to read identifiers from (fields: nip / regon / regon14 / krs). Use this to chain in a regional REGON web search or a KRS export as the discovery source."
          },
          "seedIdType": {
            "title": "Seed identifier type",
            "enum": [
              "auto",
              "nip",
              "regon",
              "krs"
            ],
            "type": "string",
            "description": "How to interpret 10-digit identifiers (NIP and KRS are both 10 digits).",
            "default": "auto"
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Filter premises to these regions. Use presets (warszawa, lodz, kutno) or objects like {\"woj\":\"10\",\"powiat\":\"03\"} (TERYT symbols). Empty = all of Poland.",
            "items": {
              "type": "string"
            }
          },
          "siteTypes": {
            "title": "Site types",
            "type": "array",
            "description": "Filter premises by industry preset: factory, warehouse, clinic, school, coliving. Empty = all industries. (Large offices are not cleanly identifiable by PKD - leave empty or use PKD codes.)",
            "items": {
              "type": "string"
            }
          },
          "pkdCodes": {
            "title": "PKD codes (advanced)",
            "type": "array",
            "description": "Explicit PKD code prefixes to match (e.g. \"86\", \"8610\", \"5210B\"). Combined with Site types.",
            "items": {
              "type": "string"
            }
          },
          "fetchSitePkd": {
            "title": "Fetch per-site PKD",
            "type": "boolean",
            "description": "Fetch each premise's own PKD activity (one extra API call per premise). When off, premises inherit the parent company's main PKD.",
            "default": true
          },
          "includeHeadcount": {
            "title": "Include headcount enrichment",
            "type": "boolean",
            "description": "Attach a per-site headcount signal. Each row is labelled with headcountBasis: 'reported-proxy' (LinkedIn employees-by-city, a real sourced count) or 'modeled-estimate' (building footprint ÷ density for industrial sites - computed, ±50-100%). No source publishes a verified per-site count; see README.",
            "default": false
          },
          "headcountMethod": {
            "title": "Headcount method",
            "enum": [
              "auto",
              "linkedin",
              "footprint",
              "none"
            ],
            "type": "string",
            "description": "auto = LinkedIn city-count for office/clinic/school sites and a building-footprint estimate for industrial sites (factory/warehouse/DC). Force a single method if desired.",
            "default": "auto"
          },
          "linkedinActorId": {
            "title": "LinkedIn employees actor ID",
            "type": "string",
            "description": "Apify actor used for LinkedIn employees-by-city counts.",
            "default": "harvestapi/linkedin-company-employees"
          },
          "linkedinResolverActorId": {
            "title": "LinkedIn company resolver actor ID",
            "type": "string",
            "description": "Actor that resolves a company name to its canonical LinkedIn page (URL + company-wide employee count). The match is validated (website domain / name overlap) and rejected if low-confidence, so wrong matches become 'unknown' rather than false counts. Leave default.",
            "default": "harvestapi/linkedin-company"
          },
          "linkedinDomainResolverActorId": {
            "title": "LinkedIn domain resolver actor ID",
            "type": "string",
            "description": "Fallback resolver: maps a company's website domain (from REGON) to its LinkedIn page when name resolution fails - fixes companies whose brand differs from their legal name (e.g. pkobp.pl -> /company/pko-bp). Pay-per-success. Leave default; clear to disable.",
            "default": "s-r/free-linkedin-company-finder---linkedin-address-from-any-site"
          },
          "linkedinMode": {
            "title": "LinkedIn scrape mode",
            "enum": [
              "short",
              "full"
            ],
            "type": "string",
            "description": "Profile detail level (cost): short is cheapest and enough for a headcount count.",
            "default": "short"
          },
          "linkedinMaxItems": {
            "title": "LinkedIn max profiles per company-city",
            "minimum": 1,
            "type": "integer",
            "description": "Profiles actually scraped per company+city. The headcount COUNT is read from the run log ('Found N profiles total'), so 1 is enough and cheapest (~$0.02/company-city). Raise only if you also want the profile list.",
            "default": 1
          },
          "maxEnrich": {
            "title": "Max enrichment calls (shared budget)",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on paid LinkedIn calls per run (~$0.02/company-city; 0 = unlimited). The footprint estimator uses free OSM APIs and is NOT counted against this budget. Bounds cost.",
            "default": 0
          },
          "footprintUserAgent": {
            "title": "Footprint contact User-Agent",
            "type": "string",
            "description": "Contact User-Agent sent to the free OSM Nominatim/Overpass APIs used by the building-footprint headcount estimator. Their usage policy requires a descriptive identifier with a contact. Leave default unless you want your own contact string.",
            "default": "polish-premises-prospector/1.0 (Apify actor; contact via Apify Store)"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum premise rows to output (0 = unlimited).",
            "default": 0
          },
          "minIntervalMs": {
            "title": "Min interval between requests (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Politeness delay between REGON requests. Keep >= 300ms to avoid the public site's conditional rate limit.",
            "default": 350
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}