REST API
The Cloud Service REST API provides simple HTTP endpoints for querying blockchain data without authentication for read-only operations.
Base URL
http://localhost:16180/rest/Endpoints
Chain Info
GET /rest/chaininfo
Returns blockchain information.
curl http://localhost:16180/rest/chaininfoResponse:
{
"chain": "main",
"blocks": 524288,
"headers": 524288,
"bestblockhash": "0000...",
"difficulty": 12345678.90,
"verificationprogress": 0.999999
}Block Details
GET /rest/block/<hash>
Returns block details given block hash.
curl http://localhost:16180/rest/block/0000000000000000000.jsonResponse:
{
"hash": "0000...",
"confirmations": 100,
"height": 524288,
"version": 536870912,
"merkleroot": "abc...",
"time": 1234567890,
"nonce": 123456789,
"bits": "1a0fffff",
"difficulty": 12345678.90,
"tx": ["txid1", "txid2", ...],
"previousblockhash": "prev...",
"nextblockhash": "next..."
}Transaction Details
GET /rest/tx/<txid>
Returns transaction details.
curl http://localhost:16180/rest/tx/txid.jsonResponse:
{
"txid": "txid",
"hash": "hash",
"version": 2,
"size": 250,
"vsize": 250,
"weight": 1000,
"locktime": 0,
"vin": [
{
"txid": "input_txid",
"vout": 0,
"scriptSig": {
"asm": "...",
"hex": "..."
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 10.5,
"n": 0,
"scriptPubKey": {
"asm": "...",
"hex": "...",
"address": "csc1q...",
"type": "witness_v0_keyhash"
}
}
],
"blockhash": "blockhash",
"confirmations": 10,
"time": 1234567890,
"blocktime": 1234567890
}Address Information
GET /rest/address/<address>
Returns address information and balance.
curl http://localhost:16180/rest/address/csc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlhResponse:
{
"address": "csc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"balance": 1234.56,
"totalReceived": 5000.00,
"totalSent": 3765.44,
"unconfirmedBalance": 0,
"txApperances": 150,
"unconfirmedTxApperances": 0,
"transactions": ["txid1", "txid2", ...]
}Mempool Information
GET /rest/mempool/info
Returns mempool statistics.
curl http://localhost:16180/rest/mempool/infoResponse:
{
"size": 1500,
"bytes": 2500000,
"usage": 10000000,
"maxmempool": 300000000,
"mempoolminfee": 0.00001000,
"minrelaytxfee": 0.00001000
}GET /rest/mempool/contents
Returns all transactions in mempool.
curl http://localhost:16180/rest/mempool/contents.jsonUTXO Set Information
GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>
Returns unspent transaction outputs.
curl http://localhost:16180/rest/getutxos/checkmempool/txid-0.jsonBlock Header
GET /rest/headers/<count>/<hash>
Returns block headers.
curl http://localhost:16180/rest/headers/5/0000000000000000000.jsonResponse Formats
All endpoints support multiple response formats:
| Format | Extension | Content-Type |
|---|---|---|
| JSON | .json | application/json |
| Binary | .bin | application/octet-stream |
| Hex | .hex | text/plain |
Example: Binary Response
curl http://localhost:16180/rest/block/0000000000000000000.binRate Limiting
| Endpoint | Limit |
|---|---|
/rest/chaininfo | 200 req/min |
/rest/block/* | 200 req/min |
/rest/tx/* | 200 req/min |
/rest/address/* | 100 req/min |
/rest/mempool/* | 100 req/min |
Error Responses
404 Not Found
{
"error": "Block not found"
}500 Internal Server Error
{
"error": "Internal server error"
}429 Too Many Requests
{
"error": "Rate limit exceeded"
}CORS Support
For browser-based applications, enable CORS in cs.conf:
# Allow cross-origin requests
rpccorsdomain=https://yourdomain.comNext Steps
- WebSockets — Real-time notifications
- RPC Commands — Complete RPC reference
- API Overview — Back to overview