The @apiverve/node-red-apiverve package adds one apiverve node to
Node-RED. It calls any API in the catalog: pick the API in the node,
send its parameters in msg.payload, and the result comes back as msg.payload.
@apiverve/node-red-apiverve in the Flow Library
Installing
From the editor. Menu → Manage palette → Install, search for
@apiverve/node-red-apiverve and install. The node appears in the network section.
npm. From your Node-RED user directory (usually ~/.node-red), then restart Node-RED:
npm install @apiverve/node-red-apiverveDocker. The official image keeps its user directory in /data, so install there:
docker exec -it mynodered npm install --prefix /data @apiverve/node-red-apiverve
docker restart mynoderedRequires Node-RED 3.0 or later and Node.js 18 or later.
Setting the key
Open the node, add an Account and paste your API key. Node-RED stores it as a credential, so it is not included when you export or share a flow.
Leave the key empty to read it from the APIVERVE_API_KEY environment variable instead, which
suits Docker and other hosted setups. See security for where credentials should
live.
The shortest working flow
An inject node, the apiverve node set to Email Validator, and a debug node. Set the inject payload to a string:
support@myspace.comA plain value fills the API's only required parameter, so this calls
/v1/emailvalidator?email=support@myspace.com. The debug panel shows the data object from
the response. The same flow ships with the package: Menu → Import → Examples →
@apiverve/node-red-apiverve → validate-an-email.
Sending parameters
For anything with more than one parameter, send an object. A function node in front of the apiverve node works well:
msg.payload = { ip: msg.req.ip }; // e.g. from an http in node
return msg;Parameters merge in this order, later ones winning:
- The Parameters field in the node (JSON), for values that never change.
msg.payload.msg.params, for adding a value without replacing the payload.
The editor lists each API's parameters under the picker, and each API's reference page has the full set, for example Email Validator.
Choosing the API at runtime
Set msg.api to an API id to override the node's choice. One node can then serve several
lookups:
msg.api = 'iplookup';
msg.payload = { ip: '8.8.8.8' };
return msg;Output
| Property | |
|---|---|
msg.payload | The API's data object. Set Output to Full response to get status, error and data |
msg.statusCode | The HTTP status |
msg.apiverve | { api, remainingCredits }, the credits left on your plan |
The node's status line shows the API and your remaining credits after each call.
Errors and credits
Each message is one API request and uses that API's credits. A failed call goes to a catch
node with msg.statusCode set, and the status line turns red:
401: the key is missing, invalid or expired.403: the key is valid but not allowed to make this call (key scoping or an IP allow-list).429: rate-limited, or out of credits for the month.
The key is sent only to api.apiverve.com, and redirects are refused.