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

# search_companies

`POST /tools/search_companies`

## Request

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

Search and filter Polish KRS companies (spółki). Compabase also holds the full CEIDG/JDG register;
this tool does not browse JDG — those without a public contact email are hidden because of RODO.
Default `fields=summary` returns compact rows
(name, NIP, KRS, location, PKD, latest financials, email/phone/website).
`fields=contacts_only` is a CRM list. `fields=full` returns every company_search column
and may exceed MCP client size limits.

Use for rankings, sector filters, city/county/region browsing, name search, or NIP/KRS lookup.
For lookup by name/KRS/NIP, omit `year`. Use `year` only for sector/ranking browse.
Sparse results in JDG-dominated PKDs include a `hint` (full CEIDG is in the database; listing is RODO-gated).
Do not call `export_companies` just to get a handful of emails or phones.

**Example prompts:** “Find IT companies (PKD 62) in Warsaw with revenue over 5 million PLN.”
· “Top 20 companies by EBITDA in wielkopolskie that are still active.”

## Request body

- SearchCompaniesArgs
  - `name` string: Company name fragment (case-insensitive). Legal-form suffixes ignored.
  - `krs` string: KRS (10 digits, zero-padded).
  - `nip` string: NIP (10 digits, no dashes).
  - `city` string: City; KRS uses uppercase (e.g. WARSZAWA).
  - `county` string: County / powiat (lowercase).
  - `region` string: Voivodeship (lowercase), e.g. mazowieckie.
  - `postal_code` string: Postal code prefix, e.g. 00-9.
  - `pkd` string: Primary PKD prefix, e.g. 62 or 46.90.Z.
  - `all_pkd` string: Match any PKD in the activity list (not only primary).
  - `legal_form` string: Legal form fragment, e.g. spółka z o.o.
  - `currency` 'pln' | 'usd' | 'eur': Currency for monetary filters. Default pln.
  - `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: true = active only, false = closed only. Omit for all.
  - `has_email` boolean: true = only companies with email on record. Matching rows include contacts.email.
  - `has_website` boolean: true = only companies with website on record. Matching rows include contacts.website.
  - `sort_by` 'revenue_total' | 'profit_net' | 'total_assets' | 'profit_operating' | 'ebitda' | 'capital_total' | 'estimated_value': Sort field (default revenue_total).
  - `sort_dir` 'asc' | 'desc': Sort direction (default desc).
  - `year` integer: Latest financial period calendar year. For sector browse only; omit for identity lookup.
  - `limit` integer: Max results (default 10, max 50).
  - `fields` 'contacts_only' | 'summary' | 'full': Response size. Default summary (name, NIP, KRS, location, PKD, latest financials, email/phone/website). contacts_only is a CRM list. full returns every company_search column and may exceed MCP client limits.

## Response `200`

Tool result (JSON text content from MCP)

- object

---

[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)
