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 allows users to search for cities using The Companies API. It is useful when you need to find geographic locations matching specific criteria, such as city names or filters related to city data. Typical use cases include enriching datasets with location information, filtering companies or contacts by city, or integrating geographic data into workflows.
For example, you might use this node to:
- Search for cities containing a certain keyword.
- Retrieve paginated lists of cities sorted by the number of companies located there.
- Apply filters to narrow down city results based on custom criteria.
Properties
| Name | Meaning |
|---|---|
| Search | A string query to search for cities by name or keyword. |
| Page | The page number of the paginated results to retrieve (default is 1). |
| Size | The number of results per page (default is 25). |
| Sort key | The field by which to sort the results. Currently supports: counts.companies |
| Sort order | The order of sorting: ascending (asc) or descending (desc). |
| Filters | Additional filter criteria as a string to refine the search results. |
Output
The node outputs JSON data containing the search results from the API. The main output field is:
json: An object or array representing the list of cities matching the search criteria. Each city entry typically includes details such as city name, counts of companies, and other metadata provided by the API.
There is no indication that this node outputs binary data.
Dependencies
- Requires an API token credential for authenticating with The Companies API.
- Uses the official SDK of The Companies API (
@thecompaniesapi/sdk). - The node expects the API token to be configured in n8n credentials under a generic "API key" or token authentication method.
Troubleshooting
- Unknown operation error: If the operation parameter is incorrect or unsupported, the node throws an error indicating "Unknown operation". Ensure the operation is set to
searchCities. - SDK method not found: If the SDK does not have the expected method, it will throw an error. This usually means the SDK version is outdated or incompatible.
- Empty or invalid parameters: If required parameters are missing or empty strings, the node uses default values where applicable. Make sure to provide valid input values.
- API authentication errors: If the API token is invalid or missing, the node will fail to authenticate. Verify the API token credential configuration.
- Continue on Fail: If enabled, the node will return error messages in the output JSON instead of stopping execution.
Links and References
- The Companies API Documentation (general reference for API endpoints)
- n8n Documentation - Creating Custom Nodes
- The Companies API SDK on npm