The Companies API LogoThe Companies API Logo
APIUse casesCompanies
LoginLogin
Get started
Authentication
Errors
Rate limits
Webhooks
Datapoints
Companies
Enrich from domain
Enrich from email
Enrich from social network
Count companies
Search companies
Search by name
Search by prompt
Search similar
Ask company
Fetch context
Find email patterns
Fetch analytics
Export analytics
Industries
Search industries
Find similar industries
Lists
Fetch lists
Create list
Fetch companies
Toggle companies
Locations
Search cities
Search counties
Search countries
Search states
Search continents
Actions
Request action
Fetch actions
Teams
Fetch team
Technologies
Search technologies
Utilities
API health
OpenAPI spec
Get started
Authentication
Errors
Rate limits
Webhooks
Datapoints
Companies
Enrich from domain
Enrich from email
Enrich from social network
Count companies
Search companies
Search by name
Search by prompt
Search similar
Ask company
Fetch context
Find email patterns
Fetch analytics
Export analytics
Industries
Search industries
Find similar industries
Lists
Fetch lists
Create list
Fetch companies
Toggle companies
Locations
Search cities
Search counties
Search countries
Search states
Search continents
Actions
Request action
Fetch actions
Teams
Fetch team
Technologies
Search technologies
Utilities
API health
OpenAPI spec

Count companies matching your query

Count the number of companies matching your query in our database.
GET
https://api.thecompaniesapi.com/v2/companies/count
Free
POST
https://api.thecompaniesapi.com/v2/companies/count
Free

Send us a query and we'll return the number of companies that match it.

Useful to know how many companies are in a specific industry, country, or size range.

No credits are charged for this endpoint.

Signup to access all our API features

Get your 500 free credits and start enriching and searching companies.

No credit card required

Query parameters
querystring (required)

An array of conditions the companies must match.

Make sure this parameter is stringified and encoded.

GET
https://api.thecompaniesapi.com/v2/companies/count?query=%5B%7B%22attribute%22%3A%22about.industries%22%2C%22operator%22%3A%22or%22%2C%22sign%22%3A%22equals%22%2C%22values%22%3A%5B%22retail%22%2C%22internet%22%2C%22services%22%5D%7D%2C%7B%22attribute%22%3A%22locations.headquarters.country.code%22%2C%22operator%22%3A%22or%22%2C%22sign%22%3A%22equals%22%2C%22values%22%3A%5B%22us%22%2C%22fr%22%2C%22gb%22%5D%7D%5D&token=XXXXXX
The endpoint that defines your search criteria.
searchstring (optional)

An additional search query applied to the company name or domain.

/companies/count?search=amazon

searchFieldsarray (optional)

Define the fields to search.

/companies/count?searchFields[]=domain&searchFields[]=name

Possible values

about.name
domain.domain
Response schema
countnumber

The number of companies matching the conditions.

Code examples
Select your favorite language:
C#

Go

Java

JavaScript
SDK

PHP

Python

Ruby

Rust

import createClient from '@thecompaniesapi/sdk'

const tca = createClient({ apiToken: 'YOUR_API_TOKEN' })

const response = await tca.countCompanies({
  query: [
    {
      attribute: 'about.industries',
      operator: 'or',
      sign: 'equals',
      values: ['computer-software']
    }
  ]
})

const count = response.data // Number of companies that match the query

Enrich a company from a social network url (LinkedIn, Instagram, etc.)

Transform any social network URL into a comprehensive company profile with over 80 data points.

Search companies

Search and filter through millions of companies with more than 50 segmentation criteria.

A glowing background image to highlight the titleA glowing background image to highlight the title
© 2025 The Companies API
  • Updates
  • Terms
  • Privacy
  • FAQ
  • Status

Fast-growing SaaS companies with remote teams