---
title: "count_companies"
method: POST
path: "/tools/count_companies"
tags: ["Tools"]
---

# count_companies

`POST /tools/count_companies`

## Request

- Base URL: `https://compabase.com/api/mcp`
- URL: `https://compabase.com/api/mcp/tools/count_companies`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Count KRS companies matching the same filter family as `search_companies` (without sort/limit).
Does not count JDG in this tool (full CEIDG is in Compabase; listing is RODO-gated). Returns a single number; there is no company list.
Sparse or zero counts in JDG-dominated PKDs include a `hint`.

**Example prompts:** “How many active companies in mazowieckie have primary PKD starting with 62?”
· “Count companies with revenue between 1 and 10 million PLN in Kraków.”

## Request body

- CountCompaniesArgs
  - `name` string
  - `krs` string
  - `nip` string
  - `city` string
  - `county` string: County / powiat (lowercase).
  - `region` string
  - `pkd` string
  - `all_pkd` string
  - `legal_form` string
  - `revenue_min` number
  - `revenue_max` number
  - `profit_min` number
  - `profit_max` number
  - `profit_operating_min` number
  - `profit_operating_max` number
  - `total_assets_min` number
  - `total_assets_max` number
  - `ebitda_min` number
  - `ebitda_max` number
  - `capital_min` number
  - `capital_max` number
  - `estimated_value_min` number
  - `estimated_value_max` number
  - `is_active` boolean
  - `has_email` boolean
  - `has_website` boolean
  - `year` integer

## Response `200`

Count result

- object
  - `count` integer

---

[API](https://skmtc.dev/compabase/apis/compabase-mcp.md) · [All operations](https://skmtc.dev/compabase/apis/compabase-mcp/llms.txt) · [OpenAPI document](https://skmtc.dev/compabase/apis/compabase-mcp/revisions/43169ccbb0f7?raw)
