gettxout

Provides details an unspent transaction output back.

Example Request and Result for gettxout method

In this section, we provide an illustrative example of a request made to retrieve details contents using the gettxout method. Additionally, we present the resulting response containing information about an unspent transaction output.

Parameters

FieldTypeDescription

txid*

string

The transaction id

n*

numeric

Vout number

include_mempool

boolean

Whether to include the mempool. Note that an unspent output that is spent in the mempool won’t appear. Default = true.

The example in this section uses a non-existing project id.

Make sure you replace it with your Bitcoin mainnet or Bitcoin Testnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns details about an unspent transaction output.

POST https://bitcoin-mainnet.blastapi.io/<project-id>

Request Body

NameTypeDescription

jsonrpc*

string

1.0

id*

string

bwarelabs

method*

string

gettxout

params*

array<string>

["e8590b94d8d0eb48b34272a60e2b09001256fbdf52268364fe43937346392a39",1]

{
    "result": {
        "bestblock": "00000000000000000002d70641a6d46811ec48997819209fd531899cab250cb1",
        "confirmations": 0,
        "value": 0.03394598,
        "scriptPubKey": {
            "asm": "0 22b19b9ecdd3b371045f739bc6ec32ffc8a65d32",
            "desc": "addr(bc1qy2ceh8kd6wehzpzlwwdudmpjlly2vhfjd2mwdj)#sfktmpzq",
            "hex": "001422b19b9ecdd3b371045f739bc6ec32ffc8a65d32",
            "address": "bc1qy2ceh8kd6wehzpzlwwdudmpjlly2vhfjd2mwdj",
            "type": "witness_v0_keyhash"
        },
        "coinbase": false
    },
    "error": null,
    "id": "bwarelabs"
}

Curl Request example

curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "1.0",
    "id": "bwarelabs",
    "method": "gettxout",
    "params": [
        "e8590b94d8d0eb48b34272a60e2b09001256fbdf52268364fe43937346392a39",1]
}'

Last updated