An Ergo node provides a REST API accessible via HTTP. The full API specification (in OpenAPI format) is available here. When running the node, a user interface for Swagger is available at
You use this UI to make API calls for advanced operations that are not available in the panel such as;
- Creating non-standard transactions with registers and context variables.
- Creating transactions that issue tokens.
- Creating transactions that use certain boxes as inputs.
Accessing the API#
Once the node is running, the API can be accessed at
To have a look at the methods without setting up your own node, check out one of the public nodes like [126.96.36.199:9053/swagger#]
To access protected API routes, you must provide your secret phrase in the request headers
[api_key, Content-Type]. Alternatively, you can Authorize via the web interface in your browser by clicking the
Authorize button in swagger and entering your secret phrase there.
Note that most methods in the API are protected and you would need to use your secret (that you configured earlier) to access these methods. The following images show the process of setting this secret in the Swagger UI.
Navigate to the top of the page and click the
Enter your secret in the form that pops-up as shown in the figure below.
After the password is entered and you have clicked
"Authorize", you'll see the popup below:
Now navigate to
127.0.0.1:9053/swagger#/wallet/walletAddresses in the same tab where you entered the password and click
"Try it out".
You should see the same list of addresses as you saw earlier from the panel.
Please note that Swagger will accept any password in the UI, but will fail to execute commands if the password provided is incorrect. If you are certain the password you're using is correct, this issue can occur during database corruption. First, attempt to restart and see if the node can fix itself. Otherwise, a resync will be required.
/wallet/restoreto create a wallet (and a secret mnemonic) and restore wallet from mnemonic
/wallet/unlockto unlock the wallet (it is unlocked after init but locked after restart)
/wallet/lockto lock the wallet
/wallet/payment/sendto send a simple payment
/wallet/statusto get wallet status
/wallet/deriveNextKeyto derive a new key according to EIP-3 (BIP 44 implementation for Ergo)
/wallet/balancesto get wallet balance (for all the addresses)
/wallet/transactionsto get wallet transactions (for all the addresses)
Example: Deriving Addresses#
click Try it out