API Endpoints
RPC Endpoint
http://localhost:8332WebSocket Endpoint
ws://localhost:8332Common Methods
getblockcount
Get the current block height
curl -X POST http://localhost:8332 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'
Response: {"jsonrpc":"2.0","result":123456,"id":1}getbalance
Get account balance
curl -X POST http://localhost:8332 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getbalance","params":["slvr1..."],"id":1}'
Response: {"jsonrpc":"2.0","result":"1.5","id":1}sendtransaction
Send a transaction
curl -X POST http://localhost:8332 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"sendtransaction",
"params":["0x..."],
"id":1
}'Error Codes
| Code | Message | Description |
|---|---|---|
| -32700 | Parse error | Invalid JSON was received |
| -32600 | Invalid Request | The JSON sent is not a valid Request object |
| -32601 | Method not found | The method does not exist |
| -32602 | Invalid params | Invalid method parameter(s) |
| -32603 | Internal error | Internal JSON-RPC error |
Need more help?