Skip to main content
Each example on this page is one Company Headcount API request, shown in cURL, the four official SDKs, and the CLI. Every version sends the same request.

Before you start

Create an API key at app.companyenrich.com/access-keys. The SDK examples assume a client created like this, with the key in the COMPANYENRICH_API_KEY environment variable:
In the cURL examples, replace YOUR_API_TOKEN with your key.

Get current headcount by department

Look up a company by domain. The response has the observed employee count, the estimated size range, and a headcount for each department. This costs 1 credit.
To look up by CompanyEnrich ID in place of the domain, send id in cURL and JavaScript, company_id in Python and Ruby, and companyId in PHP. The CLI accepts either a domain or an ID as its argument.

Read the last 12 months of history

The same response includes history: the months in the last year where headcount changed, newest first.
Each point has the date of the first day of its month, an observedEmployeeCount, and a departmentHeadcount.

Go back further than 12 months

When older history exists, the response includes nextCursor. Send it as cursor to get the preceding 12 months. Each earlier page costs 1 credit.
A cursor expires 30 minutes after the first page. In the CLI, --years 2 fetches two pages for you.

Get headcount with the company profile

The workforce expansion adds the same headcount data to a company record, so you get the profile and the headcount in one request. This enrichment costs 2 credits: 1 for the company and 1 for the expansion.
The expansion also works on company search, batch enrichment, and bulk enrichment, at 1 extra credit per company.

Find companies that are growing

The workforceGrowth filter on company search matches headcount change over a period. This search finds SaaS companies in the United States whose headcount grew at least 20% in the last year.
period is m6, y1, or y2, for 6 months, 1 year, or 2 years. A ratio of 0.2 means 20%. The search costs 1 credit per company, with no extra charge for the filter.

Find companies that are shrinking

A negative growth ratio means headcount fell. This search finds companies with 201 to 1,000 employees whose headcount dropped 10% or more in the last 6 months.

Find companies by department size

The workforceSize filter matches headcount ranges, overall or for one department. This search finds companies in Germany with at least 50 people in engineering.
Add more entries to workforceSize to set several ranges at once. Department names in the workforce filters use underscores, such as engineering_technical.

Company Headcount API

Response fields, history paging, pricing, and limits.

Company Search API filters

The headcount and growth filters in full.

Company Enrichment API examples

Enrich companies with expansions, in batches or in bulk.

Credits

What each lookup and expansion costs.