> For the complete documentation index, see [llms.txt](/llms.txt).

# `gettxout`

Returns details about an unspent transaction output. This method uses [80 credits](/get-started/pricing/) from your daily balance.

Returns `null` when the output is spent or doesn't exist.

## Parameters[​](#parameters "Direct link to Parameters")

- `txid`: (string) _[required]_ - Transaction ID.
- `n`: (integer) _[required]_ - Output index.
- `include_mempool`: (boolean) _[optional]_ - `true` to treat outputs spent in the mempool as spent, and to include unconfirmed outputs. The default is `true`.

## Returns[​](#returns "Direct link to Returns")

`result`: (object or null) - The unspent output, or `null`.

- `bestblock`: (string) - Hash of the chain tip.
- `confirmations`: (integer) - Number of confirmations. `0` for unconfirmed outputs.
- `value`: (number) - Amount, in BTC.
- `scriptPubKey`: (object) - Locking script, with `asm`, `desc`, `hex`, `type`, and, when available, `address` fields. See [getrawtransaction](/reference/bitcoin/json-rpc-methods/getrawtransaction/) for the field descriptions.
- `coinbase`: (boolean) - `true` when the output belongs to a coinbase transaction.

### Request[​](#request "Direct link to Request")

- curl

```
curl https://bitcoin-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "gettxout", "params": ["0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098", 0]}'

```

### Response[​](#response "Direct link to Response")

- JSON

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bestblock": "00000000000000000000d5e7a6f1b2c39484a5b6c7d8e9f0a1b2c3d4e5f60718",
    "confirmations": 971402,
    "value": 50.00000000,
    "scriptPubKey": {
      "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
      "desc": "pk(0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee)#qnv32gt7",
      "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
      "type": "pubkey"
    },
    "coinbase": true
  }
}

```
