Skip to content

RPC API

The NOUS node exposes a JSON-RPC API for interacting with the blockchain.

Default: http://localhost:8332/rpc Public: http://rpc.nouschain.org/api

{
"method": "methodname",
"params": [...],
"id": 1
}

Returns the current block height.

Terminal window
curl -X POST http://rpc.nouschain.org/api \
-H "Content-Type: application/json" \
-d '{"method":"getblockcount","params":[],"id":1}'

Response:

{"result": 4800, "id": 1}

Returns the block hash at the given height.

Params: [height]

{"method": "getblockhash", "params": [100], "id": 1}

Returns block data for a given hash.

Params: [hash]

Returns transaction data for a given txid.

Params: [txid]

Returns balance for an address.

Params: [address]

Response:

{
"result": {
"balance": 100000000,
"immature": 500000000
}
}
  • balance: Spendable balance in base units (1 NOUS = 100,000,000)
  • immature: Coinbase rewards waiting for 100 confirmations

Returns unspent transaction outputs for an address.

Params: [address]

Response:

{
"result": [
{
"txid": "abc123...",
"index": 0,
"value": 100000000,
"height": 4500,
"is_coinbase": false
}
]
}

Broadcasts a signed raw transaction.

Params: [hex_encoded_tx]

Response:

{"result": "txid_hash_here"}

Returns a mining work template.

Params: [address, extra_nonce]

Returns the block header template, 3-SAT formula, difficulty bits, and height.

Submits a solved block.

Params: [hex_encoded_block]

Returns connected peer information.

Returns current mining difficulty and network stats.