Overview
The "API Hub" node enables users to access various APIs through a unified platform called API Hub. It allows making HTTP requests to different APIs by specifying the API ID, HTTP method, endpoint path, query parameters, headers, and request body. This node is useful for integrating external services without needing to build custom connectors for each API.
Common scenarios include:
- Fetching data from third-party APIs (e.g., weather forecasts, stock prices).
- Sending data or commands to external services.
- Combining multiple API calls in an automation workflow.
For example, you could use this node to call a weather forecast API by specifying its API ID, setting the HTTP method to GET, and providing the endpoint path /current with optional query parameters like location.
Properties
| Name | Meaning |
|---|---|
| API ID | The identifier of the API to call (e.g., weather-forecast). |
| HTTP Method | The HTTP method to use for the request. Options: GET, POST, PUT, DELETE, PATCH. |
| Endpoint Path | Optional path appended to the base API URL to specify the resource or action (e.g., /current). |
| Request Body | JSON object sent as the request body for POST, PUT, and PATCH methods. |
| Query Parameters | Key-value pairs added as URL query parameters to the request. |
| Custom Headers | Key-value pairs added as HTTP headers to the request. |
Output
The node outputs JSON data representing the response from the called API. Each item corresponds to one API response, structured as an array of JSON objects.
If the API returns binary data, it would typically be handled separately, but this node's code and properties focus on JSON payloads only.
Dependencies
- Requires an API key credential for authenticating with the API Hub platform.
- Depends on the API Hub service being accessible over the network.
- No additional environment variables are explicitly required beyond the API authentication.
Troubleshooting
- Unknown operation error: Occurs if an invalid operation name is provided. Ensure the operation is set to "Call API".
- Connection errors (ENOTFOUND, ECONNREFUSED): Indicate network issues or incorrect API Hub server address. Verify network connectivity and API Hub endpoint configuration.
- Authentication failed (401 status code): Check that the API key credential is correctly configured and valid.
- Not found errors (404 status code): The specified API ID or endpoint path does not exist. Confirm the API ID and endpoint path are correct.
- Rate limit exceeded (429 status code): Too many requests sent in a short time. Implement retry logic or reduce request frequency.
- If the node is set to continue on fail, error details will be included in the output JSON for each failed item.
Links and References
- API Hub Platform Documentation (replace with actual URL)
- n8n HTTP Request Node Documentation — for general concepts about HTTP requests in n8n workflows.