Skip to main content

Ronin JSON-RPC API reference


This section contains a collection of the Ronin JSON-RPC API methods, which you can use to interact with Ronin nodes programmatically.

Here are some of the features provided by the API:

  • Querying blocks, transactions, balances
  • Querying smart contracts
  • Sending transactions, estimating gas


This API requires an API key for authentication. To retrieve your API key, go to Developer Console > your app > Information > KEY. For more information, see Get your API key.


You need additional permission to use the following RPC services:

  • Ronin Archive Node
  • Ronin WebSockets

To request permission, go to Developer Console > your app > App Permission > Ronin Archive Node > Request Access. Same steps apply for WebSockets. For more information, see Connect to an archive node and Connect over WebSocket.

Use with Web3.js and ethers.js

const options = {
headers: [
{ name: 'x-api-key', value: 'xxxxxx' },

const web3Provider = new Web3.providers.HttpProvider('', options);
const web3 = new Web3(web3Provider);

console.log('Latest block number:', await web3.eth.getBlockNumber());
const connection = {
url: '',
headers: {
'x-api-key': 'xxxxx'

const provider = new ethers.providers.JsonRpcProvider(connection);

console.log('Latest block number:', await provider.getBlockNumber());

Another way is to add your API key in the request header:

const apiKey = 'YOUR_API_KEY';
const web3Provider = new Web3.providers.HttpProvider('' + apiKey);
const apiKey = 'YOUR_API_KEY';
const provider = new ethers.providers.JsonRpcProvider('' + apiKey);
curl --location --request POST '' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [
"id": 1

Status codes

The following table includes common error codes and their meaning.

-32700Parse errorInvalid JSON
-32600Invalid requestJSON is not a valid request object
-32601Method not foundMethod does not exist
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC error

Error object format

All errors returned by the Ronin JSON-RPC API return an object with this structure:

"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "too many arguments, want at most 0"

See also

Was this helpful?
Happy React is loading...