Companies

Count companies for current filters

Returns how many companies match the same filter set as GET /companies, without returning rows. Use the same query parameters as list/search (except pagination: no limit, offset, or cursor). Filters combine with AND where applicable.

Response: a single integer count; total matching companies for the current filters.

get/companies/count

Request

  • Base URL: https://compabase.com/api/v1
  • URL: https://compabase.com/api/v1/companies/count
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Query parameters

qstring

Free-text search (company name and identifiers). Digits are treated as a possible KRS/NIP/REGON lookup. Whitespace is trimmed. Matching strategy: - identifier-like numeric input: identifier lookup path is used first. For 10-digit numeric values, exact match is attempted against KRS (registry_number) and NIP; an exact match is also attempted against REGON as stored in the index. For other numeric lengths, prefix matching is used for those identifier fields. - textual input: case-insensitive substring match on company name (ILIKE %q%). Numeric lookup has priority over text-name matching when q contains only digits. Example: q=0000028860 is treated as identifier lookup (not generic relevance search).

keywordsstring

Keyword filter with OR semantics. Pass a comma-separated list, or repeat the parameter. Each keyword must be at least 2 characters after trimming. Empty tokens are ignored. Duplicate tokens may appear and are not guaranteed to be deduplicated server-side. Mixing repeated params and CSV is supported (e.g. keywords=a,b&keywords=c).

pkdstring

PKD code (Polish business activity classification). Case-insensitive; trimmed and uppercased server-side. By default only the primary PKD (primary_only=true) is matched; set primary_only=false to match any code in all_pkd_codes.

primary_onlyboolean

Boolean filter syntax is accepted (true/false). Semantics: true (default) means pkd matches primary_pkd only. false means pkd can match any entry in all_pkd_codes.

currency'PLN' | 'USD' | 'EUR'

Display/filter currency context for financial threshold filters. Allowed values: PLN, USD, EUR (case-insensitive). Default is PLN. For revenue_min / revenue_max, the API applies thresholds against: - revenue_total when currency=PLN - revenue_total_usd when currency=USD - revenue_total_eur when currency=EUR

voivodeshipstring

Voivodeship / region filter. Compared to company_search.region case-insensitively (lowercased on the server). Use the same spelling as stored in data (e.g. Polish voivodeship names such as mazowieckie, śląskie). Common values include: dolnośląskie, małopolskie, mazowieckie, pomorskie, śląskie, wielkopolskie.

postal_codestring

Exact postal code match (trimmed). Format depends on source data (e.g. 00-001).

citystring

City substring filter (case-insensitive ILIKE %city%).

revenue_minnumber

Minimum total revenue (revenue_total). Currency depends on currency query param (PLN/USD/EUR). If currency is omitted, PLN is used. Values are in full currency units (not thousands), e.g. 1000000 = one million PLN. Evaluated against the latest indexed financial snapshot per company. Companies with null in the selected revenue column do not match this filter.

revenue_maxnumber

Maximum total revenue threshold in full units. Currency depends on currency query param (PLN/USD/EUR). If currency is omitted, PLN is used. If revenue_min > revenue_max, the API returns 400 with code INVALID_RANGE. Evaluated against the latest indexed financial snapshot per company. Companies with null in the selected revenue column do not match this filter.

revenue_operating_minnumber

Minimum operating revenue (net sales / operating revenue field from financials).

revenue_operating_maxnumber
profit_operating_minnumber
profit_operating_maxnumber
profit_net_minnumber
profit_net_maxnumber
income_tax_minnumber
income_tax_maxnumber
cost_wages_minnumber
cost_wages_maxnumber
cost_amortization_minnumber
cost_amortization_maxnumber
total_assets_minnumber
total_assets_maxnumber
ebitda_minnumber
ebitda_maxnumber
capital_minnumber

Minimum share capital (capital_total).

capital_maxnumber
estimated_value_minnumber

Minimum estimated company value (estimated_value), when present in search index.

estimated_value_maxnumber
registration_year_mininteger

Earliest registration year (registration_date filter): companies registered on or after YYYY-01-01.

registration_year_maxinteger

Latest registration year (registration_date on or before YYYY-12-31).

registration_date_minstring date

Earliest exact registration date (registration_date on or after this day, inclusive), format YYYY-MM-DD. Takes precedence over registration_year_min. For companies registered today, pass today's date as both registration_date_min and registration_date_max. Applies to KRS companies and to JDG (CEIDG) rows merged into browse results.

registration_date_maxstring date

Latest exact registration date (registration_date on or before this day, inclusive), format YYYY-MM-DD. Takes precedence over registration_year_max.

last_report_year_mininteger

Earliest financial report period (financial_period_to on or after YYYY-01-01). When combined with financial metric filters, both are evaluated against the same indexed reporting snapshot.

last_report_year_maxinteger

Latest financial report period (financial_period_to on or before YYYY-12-31). When combined with financial metric filters, both are evaluated against the same indexed reporting snapshot.

status_activeboolean

Boolean filter syntax is accepted (true/false). Semantics: true applies positive filter (only active companies). false is syntactically valid and treated as no filter.

legal_formstring

Legal form substring filter (case-insensitive ILIKE %legal_form%). Common values/phrases: spółka z ograniczoną odpowiedzialnością, spółka akcyjna, prosta spółka akcyjna, spółka komandytowa, jednoosobowa działalność gospodarcza.

has_emailboolean

Boolean filter syntax is accepted (true/false). Semantics: true applies positive filter (only companies with email). false is syntactically valid and treated as no filter.

has_websiteboolean

Boolean filter syntax is accepted (true/false). Semantics: true applies positive filter (only companies with website). false is syntactically valid and treated as no filter.

Response

Total number of companies matching the request filters.

countinteger required

Number of companies matching the filters.

Changes

No recorded changes to this operation across all 1 revision of this API.