Actions41
- Companies Actions
- Search companies
- Search companies (POST)
- Enrich company
- Search companies by name
- Search companies by prompt
- Search similar companies
- Count companies
- Count companies (POST)
- Enrich company by email
- Enrich company by social
- Get email patterns
- Ask company
- Get company context
- Fetch companies analytics
- Export companies analytics
- Lists Actions
- Locations Actions
- Business data Actions
- Actions Actions
- Prompts Actions
- Utilities Actions
Overview
This node operation, Fetch companies in list, allows users to retrieve company data from a specified list on The Companies API platform. It supports complex querying using multiple conditions (rules) to filter companies based on various attributes such as industry, location, revenue, technologies used, and more. This is useful for segmenting companies according to specific criteria, enabling targeted marketing, sales prospecting, or market research.
Practical examples:
- Fetch all companies in a list that belong to the "Technology" industry with more than 100 employees.
- Retrieve companies headquartered in a specific country or state.
- Get companies sorted by their relevance score or monthly visitors.
- Use simplified output to get a concise dataset for quick analysis.
Properties
| Name | Meaning |
|---|---|
| Query | A collection of rules defining conditions for filtering companies. Each rule includes an attribute (e.g., business type, industries, domain), an operator (And/Or), a sign (Equals, Greater, etc.), and one or more values. |
| Simplified | Boolean flag to return a simplified version of the company data. |
| Page | Number indicating which page of results to fetch (pagination). Default is 1. |
| Size | Number of companies to return per page. Default is 25. |
| Sort key | Attribute by which to sort the results, e.g., business type, revenue, meta score, etc. Default is meta.score. |
| Sort order | Order of sorting: ascending (asc) or descending (desc). Default is desc. |
| Sort fields | Additional fields to sort by, provided as an array of strings. |
| List ID | Numeric identifier of the list from which to fetch companies. |
| Action ID | Numeric identifier of an action related to the list (optional). |
Query Rules Attributes Options (partial list)
- About > business type
- About > industries
- About > name
- Analytics > monthly visitors
- Domain > domain
- Finances > revenue
- Locations > headquarters > country > code
- Meta > score
- Socials > linkedin > ID
- Technologies > active
- Urls
Operators for rules
- And
- Or
Signs for rules
- Equals
- Exact equals
- Greater
- Lower
- Not equals
Output
The node outputs JSON data containing the list of companies matching the query criteria. The structure typically includes detailed company information such as business attributes, analytics, locations, finances, socials, and technologies depending on the query and whether the simplified option is enabled.
If the simplified property is set to true, the output will contain a reduced set of company data focusing on essential fields.
No binary data output is indicated for this operation.
Dependencies
- Requires an API token credential for authenticating requests to The Companies API.
- Uses the official SDK client from
@thecompaniesapi/sdk. - The node depends on the OpenAPI specification internally to map parameters and operations.
Troubleshooting
- Unknown operation error: If the operation parameter is incorrect or unsupported, the node throws an error stating "Unknown operation". Ensure the operation is set exactly to
fetchCompaniesInList. - SDK method not found: If the SDK does not have the expected method, it throws an error like "SDK method ... not found". This may indicate a version mismatch or misconfiguration.
- Invalid query rules: Improperly formatted query rules or missing required fields (attribute, operator, sign, values) can cause the API to reject the request or return empty results.
- Pagination issues: Requesting pages beyond available data returns empty arrays; verify page and size parameters.
- Authentication errors: Missing or invalid API token will result in authentication failures.
To resolve these:
- Double-check operation and resource names.
- Validate query rules carefully.
- Confirm API token validity and permissions.
- Adjust pagination parameters within valid ranges.
Links and References
- The Companies API Documentation (general reference for API capabilities)
- The Companies API SDK on npm (for SDK usage details)
- n8n documentation on creating custom nodes (for understanding node development concepts)