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 states (geographic subdivisions) using The Companies API. It is useful when you need to retrieve information about states based on a search query, with options to paginate and sort the results. Typical use cases include enriching location data in customer databases, filtering companies or contacts by state, or integrating geographic data into workflows.
For example, you might use this node to find all states matching a partial name or keyword, then use that data downstream to filter company records or generate reports segmented by state.
Properties
| Name | Meaning |
|---|---|
| Search | A string query to search states by name or keyword. |
| Page | The page number of results to retrieve (pagination). Defaults to 1. |
| Size | Number of results per page. Defaults to 25. |
| Sort key | The field to sort results by. Options: "Counts > companies" (sort by number of companies). |
| Sort order | The order to sort results. Options: "Asc" (ascending), "Desc" (descending). Defaults to "Desc". |
Output
The node outputs JSON data containing the search results from the API. The main output is an array of state objects with their details as returned by the API. Each item corresponds to one input item processed.
No binary data output is produced by this node.
Dependencies
- Requires an API token credential for authenticating with The Companies API.
- Uses the official SDK of The Companies API to perform requests.
- No additional environment variables are needed beyond the API token.
Troubleshooting
- Unknown operation error: If the operation parameter is incorrect or unsupported, the node will throw an error indicating "Unknown operation". Ensure the operation is set exactly to "searchStates".
- SDK method not found: If the SDK does not have the expected method, it throws an error. This usually indicates a version mismatch or misconfiguration.
- Empty or invalid parameters: Parameters like
search,page, orsizethat are empty or zero may be replaced by default values internally. Make sure to provide valid inputs. - API authentication errors: If the API token is missing or invalid, 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 on failure.
Links and References
- The Companies API Documentation
- The Companies API SDK GitHub Repository
- n8n Documentation on Creating Custom Nodes