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 transaction by hash

Code samples

GET /api/v1/btc/transactions/{hash}

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

Returns transaction details using getrawtransaction with verbose output. Note txid versus hash: for a segwit transaction they differ, because hash covers the witness data and txid does not. Always identify a transaction by txid. A transaction that is not in a block yet has no blockhash, confirmations, time or blocktime. confirmations is the number to watch when waiting for a payment to settle. An unknown txid comes back as 500, not 404. The handler does have a 404 Transaction not found branch, but it is only reached if the node returns an empty result; in practice getrawtransaction raises an RPC error for a txid it does not know, which is caught and reported as Could not connect to BTC node.. Handle both, and do not read a 500 here as proof that the node is down.

πŸ› οΈ Parameters

NameInTypeRequiredDescription
hashpathstringtrueBitcoin transaction hash (txid).

Example responses

200 Response

{
  "txid": "5fc111d07140a808ba08ac28f61fd436efbfe9d84f5437abe980b42c8d9f0a5e",
  "hash": "504b28c85fde56f73379a73d500998f771fd4a411d63e3f18238c420cca11a70",
  "version": 1,
  "size": 333,
  "vsize": 168,
  "weight": 672,
  "locktime": 0,
  "vin": [
    {
      "txid": "d83bf8b280830c25847f2d242f6319899c14f37e1ed12fa2e02719e4bd99e8bb",
      "vout": 0,
      "scriptSig": {
        "asm": "",
        "hex": ""
      },
      "txinwitness": [
        "",
        "304402200147f0749d7918773fdf4b60b8e50d3b48d7ce2b83d126d457b86065fd57d64d02201d2f5d9034f78f18ad9638e12037fb94826f4c2a5a0981d73e6eec19b067f5ff01",
        "3044022073fb78a4c016c2feb126d03402685c9a114eb7133d87e0be5341f2bb9c765150022022eb1cd2edec84cf6d9cf81e27c19acc49cbc42f754c408de3dd266aeb7a2d2c01",
        "5221022d11a706b118c9b8c02a036644b5e4f971d91268db9273c136e048f19754566a2102269391f740e2766743fbe6650630517fde05434a44ad720eed1fa8858eca0b7c52ae"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.012,
      "n": 0,
      "scriptPubKey": {
        "asm": "0 e93523416d7137dad7b63813ca2a72010bc94d3b",
        "desc": "addr(bc1qay6jxstdwyma44ak8qfu52njqy9ujnfm37hllg)#dxsdzh08",
        "hex": "0014e93523416d7137dad7b63813ca2a72010bc94d3b",
        "address": "bc1qay6jxstdwyma44ak8qfu52njqy9ujnfm37hllg",
        "type": "witness_v0_keyhash"
      }
    },
    {
      "value": 0.002,
      "n": 1,
      "scriptPubKey": {
        "asm": "0 6421fa8a3caa1d76f817d81ca214b7e250f2cd05",
        "desc": "addr(bc1qvssl4z3u4gwhd7qhmqw2y99hufg09ng9h5kmnd)#zllantcq",
        "hex": "00146421fa8a3caa1d76f817d81ca214b7e250f2cd05",
        "address": "bc1qvssl4z3u4gwhd7qhmqw2y99hufg09ng9h5kmnd",
        "type": "witness_v0_keyhash"
      }
    }
  ],
  "hex": "01000000000101bbe899bde41927e0a22fd11e7ef3149c8919632f242d7f84250c8380b2f83bd80000000000ffffffff02804f120000000000160014e93523416d7137dad7b63813ca2a72010bc94d3b400d030000000000160014…",
  "blockhash": "00000000000000000001595977e6000ce56129f5c9b4073e31ccc30b90b97da9",
  "confirmations": 136,
  "time": 1788244455,
  "blocktime": 1788244455
}

404 Response

{
  "error": "Transaction not found"
}

500 Response

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

πŸ” Responses

StatusMeaningDescriptionSchema
200OKBitcoin transactionInline
404Not FoundNode returned an empty result. Rarely seen β€” see the note above.Inline
500Internal Server ErrorNode unreachable, or the txid is unknown to the nodeInline

πŸ”„ Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
Β» 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 404

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
πŸ†Ž Block
Next
πŸ‘¨β€πŸ’Ό Account