Website
Dashboard
Website
Dashboard
  • πŸ‘‰ Welcome
  • 🧐 How to set up an account
  • πŸ“ˆ Monitoring and analytics
  • πŸ” Introducing coins vs tokens
  • πŸ‘¨β€πŸ’Ό The meaning of owning crypto
  • πŸ’° Wallets
  • πŸ“œ Supported Blockchains
  • GITHUB
    • 🐘 SDK PHP
    • πŸ“ SDK Python
    • πŸ‘¨β€πŸ’» SDK GOLANG
    • ✳️ SDK NODE JS
    • ✳️ PHP Wallet
  • API REFERENCE
    • πŸ”‘ Authentication & base URL
    • Bitcoin
      • πŸ” Info
        • 🧐 Check BTC node health
        • πŸ“œ Get latest Bitcoin block
      • πŸ†Ž Block
        • πŸ“ˆ Get Bitcoin block by height
        • πŸ‘¨β€πŸ’» Get Bitcoin block by hash
        • πŸ“‘ Get transaction count in block by height
        • πŸ“‘ Get transaction count in block by hash
      • πŸ’° Transactions
        • πŸ‘¨β€πŸ’» Get Bitcoin transaction by hash
        • πŸ“ Send pre-signed raw Bitcoin transaction
      • πŸ‘¨β€πŸ’Ό Account
        • πŸ’° List BTC addresses managed by node wallet
        • πŸ†Ž Get BTC received amount for address
      • πŸ” Watch-only addresses
        • πŸ” Register an account zpub
        • πŸ“œ List registered extended public keys
        • πŸ†Ž Issue the next BTC address
        • πŸ“‘ History of issued BTC addresses
        • ❌ Delete a registered zpub
      • πŸ” JSON-RPC
        • πŸ” JSON-RPC
    • Ethereum
      • πŸ” Info
        • 🧐 Check ETH node health
        • πŸ“œ Get latest Ethereum block
      • πŸ†Ž Block
        • πŸ“ˆ Get Ethereum block by height
        • πŸ‘¨β€πŸ’» Get Ethereum block by hash
        • πŸ“‘ Get transaction count in block by height
        • πŸ“‘ Get transaction count in block by hash
      • πŸ’° Transactions
        • πŸ‘¨β€πŸ’» Get Ethereum transaction by hash
        • πŸ‘¨β€πŸ’» Get Ethereum transaction receipt by hash
        • πŸ“ Send pre-signed raw Ethereum transaction
      • πŸ‘¨β€πŸ’Ό Account
        • πŸ” List ETH accounts managed by node
        • πŸ†Ž Get ETH balance for address
        • πŸ†Ž Get transaction count (nonce) for address
        • πŸ‘‰ Estimate gas for transaction
        • πŸ“‘ Read-only contract call (eth_call)
        • πŸ‘¨β€πŸ’Ό Send transaction from node-managed account
      • πŸ” Watch-only addresses
        • πŸ” Register an account xpub
        • πŸ“œ List registered extended public keys
        • πŸ†Ž Issue the next ETH address
        • πŸ“‘ History of issued ETH addresses
        • ❌ Delete a registered xpub
      • πŸ” JSON-RPC
        • πŸ” JSON-RPC
    • Tron
      • πŸ” Info
        • πŸ“‘ Get TRX node info
        • 🧐 Check Tron node health
        • πŸͺ™ List supported TRC20 tokens
      • πŸ†Ž Block
        • πŸ“œ Get latest Tron block
        • πŸ“œ Get latest N blocks
        • 🟠 Get block by number
        • πŸ‘¨β€πŸ’» Get block by hash
      • πŸ’° Transactions
        • πŸ‘¨β€πŸ’» Get transaction by hash
        • πŸ†Ž Get all transactions for an address
        • πŸ“ Create an unsigned transaction
        • πŸ“‘ Broadcast a signed transaction
      • πŸ‘¨β€πŸ’Ό Account
        • πŸ†Ž Validate a Tron address
        • πŸ” Get account information
        • πŸ’° Get account balance
        • πŸ’° Get all asset balances
        • πŸ’΅ Get a single TRC20 balance
        • ⚠️ Create a new Tron address (deprecated)
        • ⚠️ Generate a private key from a mnemonic (deprecated)
        • ⚠️ Send TRX from one address to another (deprecated)
        • ⚠️ Send USDT (TRC20) from one address to another (deprecated)
      • πŸ“Š Schemas
      • πŸ” JSON-RPC
    • Webhooks
      • ✳️ Management
        • πŸ‘¨β€πŸ“œ List webhooks
        • 🧐 Create webhook
        • πŸ‘‰ Get webhook
        • πŸ‘¨β€πŸ” Update webhook
        • ❌ Delete webhook
        • πŸ”‘ Rotate signing secret
      • πŸ“¨ Receiving notifications

πŸ“ˆ Get Bitcoin block by height

Code samples

GET /api/v1/btc/block/{blockNumber}

curl 'https://settla.net/api/v1/btc/block/965000' \
  -H 'X-API-Key: $SETTLA_API_KEY' \
  -H 'Accept: application/json'

Returns a specific block by its height using getblockhash followed by getblock with verbosity 2. As with /block/last, the full transaction list comes with it β€” expect megabytes. "Not found" is reported as 500. The handler collapses every node- level failure into the same Could not connect to BTC node. message, so a height above the tip is indistinguishable from an actual outage. Check the tip via GET /api/v1/btc/health before treating a 500 here as an incident. Only a negative height is caught early and answered 400.

πŸ› οΈ Parameters

NameInTypeRequiredDescription
blockNumberpathinteger(int64)trueBlock height in the best chain (non-negative integer).

Example responses

200 Response

{
  "hash": "00000000000000000001595977e6000ce56129f5c9b4073e31ccc30b90b97da9",
  "confirmations": 136,
  "height": 965000,
  "version": 537018368,
  "versionHex": "20024000",
  "merkleroot": "9e18369e2535ca62ec5731188be8a537fa3751f3ba832aa5c3c74bca6f48f79d",
  "time": 1788244455,
  "mediantime": 1788243415,
  "nonce": 2991619710,
  "bits": "17023cc1",
  "target": "000000000000000000023cc10000000000000000000000000000000000000000",
  "difficulty": 125807076547197.5,
  "chainwork": "000000000000000000000000000000000000000143ea54c80d80b7599543d17f",
  "nTx": 216,
  "previousblockhash": "0000000000000000000060ec48e65af7e6a5c521ed026b6053b3f59841a4deeb",
  "nextblockhash": "000000000000000000015aaf7bd406c54e2f09b97941e8ed7fc41a48a26f52a1",
  "strippedsize": 56071,
  "size": 105590,
  "weight": 273803,
  "tx": [
    "… 216 full transaction objects, omitted here β€” see the transaction schema below"
  ]
}

400 Response

{
  "error": "Block number must be non-negative"
}

500 Response

{
  "error": "Could not connect to BTC node."
}

πŸ” Responses

StatusMeaningDescriptionSchema
200OKBitcoin blockInline
400Bad RequestInvalid block number (negative)Inline
500Internal Server ErrorCould not connect to BTC nodeInline

πŸ”„ Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
Β» hashstringfalsenoneHash of the block.
Β» confirmationsinteger(int64)falsenoneDepth below the node's current tip. -1 if the block was reorged out.
Β» heightinteger(int64)falsenoneBlock height.
Β» versionintegerfalsenoneBlock version.
Β» versionHexstringfalsenonenone
Β» merklerootstringfalsenoneMerkle root of the block's transactions.
Β» timeinteger(int64)falsenoneBlock time in seconds since the Unix epoch β€” unlike Tron, which uses milliseconds. Set by the miner and only loosely monotonic; use mediantime if you need a value that never goes backwards.
Β» mediantimeinteger(int64)falsenoneMedian time of the preceding 11 blocks. Monotonically increasing.
Β» nonceinteger(int64)falsenonenone
Β» bitsstringfalsenoneCompact encoding of the target.
Β» targetstringfalsenoneFull 256-bit target as hex. Added in Bitcoin Core v28 β€” absent on older nodes, so treat it as optional.
Β» difficultynumber(double)falsenoneDifficulty as a JSON float. Already past 2^53 in absolute terms is not a problem here, but the fractional part (…197.5) means naive integer parsing will fail.
Β» chainworkstringfalsenonenone
Β» nTxinteger(int64)falsenoneNumber of transactions in the block, coinbase included. Same value the /transactions/count endpoints return.
Β» strippedsizeinteger(int64)falsenoneBlock size in bytes excluding witness data.
Β» sizeinteger(int64)falsenoneBlock size in bytes including witness data.
Β» weightinteger(int64)falsenonenone
» previousblockhashstring¦nullfalsenoneAbsent on the genesis block.
» nextblockhashstring¦nullfalsenoneAbsent while this block is the tip. Its appearance is what tells you a block has been built on top.
Β» tx[object]falsenoneFull transaction objects β€” verbosity is fixed at 2, so you never get a bare array of txids here. Element 0 is always the coinbase, recognisable by its single vin carrying coinbase instead of txid/vout.
»» txidstringfalsenoneTransaction ID β€” the hash without witness data. This is the identifier to use everywhere: in explorers, in GET /transactions/{hash}, as the value returned by send-raw.
»» hashstringfalsenoneWitness hash (wtxid). Differs from txid for any segwit transaction β€” do not use it as a lookup key, getrawtransaction will not find it.
»» versionintegerfalsenonenone
»» sizeintegerfalsenoneSerialised size in bytes, witness included.
»» vsizeintegerfalsenoneVirtual size β€” this is what fee rates (sat/vB) are computed against.
»» weightintegerfalsenonenone
»» locktimeintegerfalsenonenone
»» blockhashstring¦nullfalsenoneAbsent while the transaction is unconfirmed.
»» confirmationsinteger(int64)¦nullfalsenoneAbsent while unconfirmed. Grows with every new block, so two calls a few minutes apart return different values for the same transaction.
»» timeinteger(int64)¦nullfalsenoneSame value as blocktime for a confirmed transaction. Seconds.
»» blocktimeinteger(int64)¦nullfalsenonenone
»» hexstringfalsenoneFull raw transaction. Feed it to decoderawtransaction through the JSON-RPC proxy if you want to re-parse it yourself.
»» vin[object]falsenonenone
»»» txidstring¦nullfalsenonePrevious transaction being spent. Absent on a coinbase input.
»»» voutinteger¦nullfalsenoneIndex of the output being spent in txid. Absent on a coinbase input.
»»» coinbasestringΒ¦nullfalsenoneArbitrary miner data β€” height, pool tag, extranonce. Present only on the coinbase input.
»»» scriptSigobjectΒ¦nullfalsenoneEmpty for segwit inputs β€” see the note above.
»»»» asmstringfalsenonenone
»»»» hexstringfalsenonenone
»»» txinwitness[string]falsenoneWitness stack, hex-encoded. Present only on segwit inputs. The last item of a P2WSH stack is the redeem script; the example transaction is a 2-of-2 multisig, hence the leading empty item (Bitcoin's OP_CHECKMULTISIG off-by-one) followed by two signatures and the script.
»»» sequenceinteger(int64)falsenone4294967295 (0xffffffff) means locktime and RBF are both disabled for this input. Any value below 0xfffffffe opts the transaction into replace-by-fee.
»» vout[object]falsenonenone
»»» valuenumber(double)falsenoneAmount in BTC, as a JSON number β€” not satoshis, not a string. This is the single most common integration bug on this API: 0.012 cannot be represented exactly in IEEE-754, and small outputs come back in exponential notation (a real dust output in block 965000 serialises as 5.46e-06). Parse it with a decimal type, or multiply by 1e8 and round to get satoshis β€” never compare two values with == and never accumulate them as floats.
»»» nintegerfalsenoneOutput index within the transaction.
»»» scriptPubKeyobjectfalsenoneThe locking script. Bitcoin Core v30 β€” which this node runs β€” removed reqSigs and addresses. Integrations written against older docs that read scriptPubKey.addresses[0] will silently see undefined here; read the singular address instead.
»»»» asmstringfalsenoneHuman-readable disassembly of the script.
»»»» descstringfalsenoneOutput descriptor with its checksum.
»»»» hexstringfalsenonenone
»»»» addressstringfalsenoneDestination address. Absent for outputs that have no address form β€” nulldata (OP_RETURN) and non-standard scripts. Always check that the field exists before reading it.
»»»» typestringfalsenoneScript type: pubkeyhash, scripthash, witness_v0_keyhash, witness_v0_scripthash, witness_v1_taproot, nulldata, nonstandard.

Status Code 400

NameTypeRequiredRestrictionsDescription
Β» errorstringfalsenoneHuman-readable reason.

Status Code 500

NameTypeRequiredRestrictionsDescription
Β» errorstringfalsenoneHuman-readable reason.
To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth
Prev
πŸ” Info
Next
πŸ’° Transactions