Fetch analytics data for a query or your lists
You can explore various attributes including business type, industry, employee count, and more.
This endpoint also enables data export in multiple formats.
Signup to access all our API features
Get your 500 free credits and start enriching and searching companies.
No credit card required
The analytics attribute to aggregate data for. This determines which field will be used to group and analyze the companies.
Possible values
An array of conditions to filter the companies.
Make sure this parameter is stringified and encoded.
Filter analytics to specific lists.
The maximum number of companies to include in the analysis (between 1 and 10,000). The default value is 100.
Possible values
The sort order of the results.
Possible values
Array of aggregated metrics (counts and percentages) for each value of the specified attribute.
Additional metadata about the results.
import createClient from '@thecompaniesapi/sdk'
const tca = createClient({ apiToken: 'YOUR_API_TOKEN' })
const response = await tca.fetchCompaniesAnalytics({
attribute: 'about.businessType',
query: [
{
attribute: 'locations.headquarters.country.code',
operator: 'or',
sign: 'equals',
values: ['us', 'gb', 'fr']
}
]
})
const analytics = response.data.data // Aggregated values
const meta = response.data.meta // Meta information