An Introduction to the Radix API (beta)

The recommended way of communicating with the Radix network is through the JSON-RPC[1] API offered by archive nodes run by Radix or other node-runners. This API provides a structured, standardized way of sending requests from a client application to the network.

Archive nodes by default offer the JSON-RPC API endpoint on a public port at /rpc. Radix offers a load-balanced archive node endpoint on port 443 at https://betanet.radixdlt.com/rpc . Or you can run your own archive node; click here to learn how.

Making API Calls

The advantage of using RPC calls over a language-specific library is that it makes interacting with the Radix network language agnostic: you can use any tool, any framework or any language (you can even just send requests from the browser’s URL field if you’re masochistic enough), as long as it supports the HTTP protocol.

What you’ll need

A simple way to test the API is to use an HTTP client to send and receive messages. You can use app such as Postman or the client built into your IDE. Of course, you’re also going to need a Radix node address where you can send requests. You can use an archive node provided by Radix at https://betanet.radixdlt.com/rpc, or you can install and configure your own archive node to connect to the Radix network.

a basic information requestion sent to a Radix node
{
  "id": "1",
  "method": "radix.networkId",
  "params": {}
}
response from the networkId request
{
  "result": {
    "networkId": "421527554"
  },
  "jsonrpc": "2.0",
  "id": "1"
}

If the request was successful then you’ll receive result block in the response, otherwise the response will contain an error block detailing what went wrong:

{
  "id": "1",
  "jsonrpc": "2.0",
  "error": {
    "code": "-32601",
    "message": "Method not found"
  }
}

1. You can find a good introduction to the JSON-RPC specification on Wikipedia