Export analytics data
You can choose specific attributes to export or get a full export of all analytics attributes.
The endpoint returns a file download in your chosen format.
Signup to access all our API features
Get your 500 free credits and start enriching and searching companies.
No credit card required
The action ID to filter analytics.
An array of analytics attributes to export. Required if full is not true.
Possible values
The format of the exported file (defaults to json).
Possible values
Whether to export all analytics attributes.
Filter analytics to a specific list.
An array of conditions to filter the companies.
Make sure this parameter is stringified and encoded.
The number of results to return.
The sort order of the results.
Possible values
An array of analytics data points containing counts and percentages for each value
Additional metadata about the results.
import createClient from '@thecompaniesapi/sdk'
const tca = createClient({ apiToken: 'YOUR_API_TOKEN' })
const response = await tca.exportCompaniesAnalytics({
format: 'csv',
attributes: ['about.industries', 'about.totalEmployees'],
query: [
{
attribute: 'technologies.active',
operator: 'or',
sign: 'equals',
values: ['shopify']
}
]
})
const analytics = response.data.data // Aggregated values
const meta = response.data.meta // Meta information