Semux provides a rich set of RESTful APIs for interacting with the blockchain programmatically.
Note that You can also access the same set of APIs via the Console
Your local Semux API server can be enabled by changing following properties in your config/semux.properties
:
# Be sure to set up authentication first before enabling API
api.enabled = true
# Listening address and port
api.listenIp = 127.0.0.1
api.listenPort = 5171
# Basic authentication
api.username = YOUR_API_USERNAME
api.password = YOUR_API_PASSWORD
The base unit of Semux API is Nano SEM (10-9 SEM)
Once you've successfully started Semux API server, a Swagger UI page is available locally as an API explorer at: http://localhost:5171/
If you want to interact with the semux network without having a local client running, you can access many (but not all) of the API calls at some hosted APIs. This gives you a swagger client similar to a locally running one.
- Mainnet: https://api.semux.info/
Semux provides a Swagger API Spec in JSON since API version 2. You can either generate an API client by yourself using Swagger Codegen or use the following pre-generated clients: