# JSON RPC API

Link <https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API>

## **JSON RPC API**

### &#x20;   **JavaScript API:**

&#x20;   To talk to an KardiaChain node from inside a JavaScript application use the [Kardia Javascript SDK](https://github.com/kardiachain/kardia-js-sdk) library, which gives a convenient interface for the RPC methods.<br>

### &#x20;    **JSON-RPC Endpoint:**

| Client  | URL                                                       |
| ------- | --------------------------------------------------------- |
| Local   | [http://0.0.0.0:8545](http://0.0.0.0:8545/)               |
| Mainnet | [https://rpc.kardiachain.io](https://rpc.kardiachain.io/) |

### &#x20;  **Ratelimit:**

&#x20;    JSON-RPC  rate limits after exceeding duration request limit. These rate limits are in place to ensure the reliability.

&#x20;     If you are rate limited, your JSONRPC responses will have HTTP Status code `429`&#x20;

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32005,
    "message": "request rate exceeded limit",
    "data": {
      "view_more": "https://docs.kardiachain.io/docs/for-developers/rpc/json-rpc-api#ratelimit",
      "allowed_limit": "15000 requests per 10 minutes",
      "block_time": "60 minutes"
    }
  }
}
```

### &#x20;  **Go:**&#x20;

&#x20;   Start KardiaChain network [\[README\]](https://github.com/kardiachain/go-kardiamain/tree/master/README.md). Change the default port (8545) and listing address (0.0.0.0) with: <br>

### &#x20;  &#x20;

### &#x20;   **JSON-RPC Support:**

&#x20;   Currently, the Go client of Kardia node supports JSON-RPC 2.0 via HTTP.

&#x20;   Additional protocols such as IPC will be supported in the future.<br>

###

### &#x20;   **Curl Examples Explain:**

&#x20;   The curl options below might return a response where the node complains about the content type.     This is because the --data option sets the content type to application/x-www-form-urlencoded . If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the call.

The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. 0.0.0.0:8545

###

### &#x20;   **JSON-RPC Methods and Reference:**

**Click on each method below. It will redirect to a github link which will provide the reference code.**

[node\_nodeInfo](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#node_nodeInfo)

[node\_peers](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#node_peers)

[node\_datadir ](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#node_peers)

[kai\_blockNumber ](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_blockNumber)

[kai\_getBlockByHash](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getBlockByHash)

[kai\_getBlockHeaderByHash](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getBlockHeaderByHash)

[kai\_getBlockByNumber](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getBlockByNumber)

[kai\_getBlockHeaderByNumber](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getBlockHeaderByNumber)

[kai\_getBlockHeaderByHash](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getBlockHeaderByHash)

[kai\_kardiaCall](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_kardiaCall)

[kai\_newFilter](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_newFilter)

[kai\_newBlockFilter](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_newBlockFilter)

[kai\_uninstallFilter](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_uninstallFilter)

[kai\_getFilterChanges](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getFilterChanges)

[kai\_getFilterLogs](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getFilterLogs)

[k](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getLogs)[ai\_getLogs](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getLogs)

[kai\_validator](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_validator)

[kai\_validators](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_validators)

[kai\_gasPrice](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_gasPrice)

[kai\_getCommit](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getCommit)

[kai\_getValidatorSet](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getValidatorSet)

[kai\_getProof](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#kai_getProof)

[tx\_sendRawTransaction](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#tx_sendRawTransaction)

[tx\_pendingTransactions](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#tx_pendingTransactions)

&#x20;[tx\_getTransaction](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#tx_getTransaction)

[tx\_getTransactionReceipt](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#tx_getTransactionReceipt)

[account\_balance](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#account_balance)

[account\_nonce](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#account_nonce)

[account\_nonceAtHeight](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#account_nonceAtHeight)

[account\_getCode](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#account_getCode)

[account\_getStorageAt](https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API#account_getStorageAt)<br>
