# gettxout

Returns details about an unspent transaction output.

### Argument #1 - txid

**Type:** string, required

The transaction id

### Argument #2 - n

**Type:** numeric, required

vout number

### Argument #3 - include\_mempool

**Type:** boolean, optional, default=true

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

**Result**

```
{                             (json object)
  "bestblock" : "hex",        (string) The hash of the block at the tip of the chain
  "confirmations" : n,        (numeric) The number of confirmations
  "value" : n,                (numeric) The transaction value in BTC
  "scriptPubKey" : {          (json object)
    "asm" : "hex",            (string)
    "hex" : "hex",            (string)
    "reqSigs" : n,            (numeric) Number of required signatures
    "type" : "hex",           (string) The type, eg pubkeyhash
    "addresses" : [           (json array) array of bitcoin addresses
      "str",                  (string) bitcoin address
      ...
    ]
  },
  "coinbase" : true|false     (boolean) Coinbase or not
}
```

**Request**

{% tabs %}
{% tab title="Curl" %}

```bash
curl --location --request POST 'https://btc.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "gettxout",
    "params": [
        "5081840bfdc0751e48ecf3995179ceb5fc7f10e8bcdc69ff11a96b61da2e7d2f",
        1
    ]
}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://btc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "gettxout",
    "params": [
        "5081840bfdc0751e48ecf3995179ceb5fc7f10e8bcdc69ff11a96b61da2e7d2f",
        1
    ]
}
```

{% endtab %}
{% endtabs %}

**Response**

```json
{
    "bestblock": "0000000000000000000559adec1f56ee949c2e20abef7150bb29dd7d2cf0260a",
    "confirmations": 0,
    "value": 1.91332048,
    "scriptPubKey": {
        "asm": "OP_HASH160 39790a15e75a2f6ccbd8becaee975b819da6b636 OP_EQUAL",
        "hex": "a91439790a15e75a2f6ccbd8becaee975b819da6b63687",
        "address": "36vuSSdrx8zBXrGYPCifixtLbbxK615fCR",
        "type": "scripthash"
    },
    "coinbase": false
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.watchdata.io/blockchain-apis/bitcoin-api/blockchain-rpcs/gettxout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
