<p>To clarify what's happening:</p>

<p><strong>getrawtransaction 0cd7d76e5...7ecb84755a</strong> - returns serialized, hex-encoded data for transaction txid. </p>

<p><strong>getrawtransaction 0cd7d76e5...7ecb84755a 1</strong> - verbose flag, which returns a JSON Object containing information about the transaction.</p>

CC BY-SA 4.0
2018-07-20T21:30:42.427Z
2018-07-20T21:30:42.427Z
sizzlecookie
<pre><code>getrawtransaction 0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d
￼
020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000ffffffff026d9bd14a000000001976a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac0000000000000000266a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e40120000000000000000000000000000000000000000000000000000000000000000000000000
</code></pre>

<p>and</p>

<pre><code>getrawtransaction 0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d 1

{
  "hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000ffffffff026d9bd14a000000001976a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac0000000000000000266a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e40120000000000000000000000000000000000000000000000000000000000000000000000000",
  "txid": "0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d",
  "hash": "1d6ec45dd2a63099fbb11adc08f76e2022d014572a0cedc7d6124918ad56ffa8",
  "size": 243,
  "vsize": 216,
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000",
      "txinwitness": [
        "0000000000000000000000000000000000000000000000000000000000000000"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 12.55250797,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 78ce48f88c94df3762da89dc8498205373a8ce6f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1C1mCxRukix1KfegAY5zQQJV7samAciZpv"
        ]
      }
    }, 
    {
      "value": 0.00000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_RETURN aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e4",
        "hex": "6a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e4",
        "type": "nulldata"
      }
    }
  ],
  "blockhash": "000000000000000000158c2c1ad9a1fcddf8a771fde6b6b4fcf7b443b310cc7b",
  "confirmations": 1,
  "time": 1532027659,
  "blocktime": 1532027659
}
</code></pre>

CC BY-SA 4.0
2018-07-19T19:27:45.287Z
2018-07-19T19:27:45.287Z
amaclin
<p>As an alternative to Amaclin’s answer:</p>

<p>Once you use <code>getrawtransaction</code>, you can copy the raw transaction hex string into a <code>decoderawtransaction</code>command to return the detailed transaction info. </p>

<p>ie:</p>

<p><code>bitcoin-cli decoderawtransaction [raw transaction hex string]</code></p>

CC BY-SA 4.0
2018-07-20T01:27:40.007Z
2018-07-20T01:27:40.007Z
chytrik
<p>I’m not sure how to get this data in a format I can use and consume? I was expecting some kind of JSON structure, hopefully there’s a way to get this info easily?</p>

<bitcoind>
bitcoind getrawtransaction returning numbers and letters
Johnnya12345
# bitcoind getrawtransaction returning numbers and letters

(Asked by: username_0 on 2018-07-19)

I’m not sure how to get this data in a format I can use and consume? I was expecting some kind of JSON structure, hopefully there’s a way to get this info easily?

**Tags:** bitcoind


---

## 3 answers

### Answer by username_1 on 2018-07-20. Score: 3 | Accepted answer

To clarify what's happening:

**getrawtransaction 0cd7d76e5...7ecb84755a** - returns serialized, hex-encoded data for transaction txid.

**getrawtransaction 0cd7d76e5...7ecb84755a 1** - verbose flag, which returns a JSON Object containing information about the transaction.


---

### Answer by username_2 on 2018-07-19. Score: 4

```
getrawtransaction 0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d
￼
020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000ffffffff026d9bd14a000000001976a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac0000000000000000266a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e40120000000000000000000000000000000000000000000000000000000000000000000000000

```

and

```
getrawtransaction 0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d 1

{
  "hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4b03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000ffffffff026d9bd14a000000001976a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac0000000000000000266a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e40120000000000000000000000000000000000000000000000000000000000000000000000000",
  "txid": "0cd7d76e5666a066ba7e7ecb84755a1c58bee6456de76b2516bb039589c9081d",
  "hash": "1d6ec45dd2a63099fbb11adc08f76e2022d014572a0cedc7d6124918ad56ffa8",
  "size": 243,
  "vsize": 216,
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "coinbase": "03c02008040ce3505b662f4254432e434f4d2ffabe6d6d8f19ce5133a77536eee1867e96d87b190c3f589b41e7fa55440de72880bdf54e010000000000000004a5f53ed70d000000000000",
      "txinwitness": [
        "0000000000000000000000000000000000000000000000000000000000000000"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 12.55250797,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 78ce48f88c94df3762da89dc8498205373a8ce6f OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a91478ce48f88c94df3762da89dc8498205373a8ce6f88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1C1mCxRukix1KfegAY5zQQJV7samAciZpv"
        ]
      }
    }, 
    {
      "value": 0.00000000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_RETURN aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e4",
        "hex": "6a24aa21a9edf6addde9f85e6eb9d990f21898e3dc174ce2f36fb831a9ba2d1205291ec8a1e4",
        "type": "nulldata"
      }
    }
  ],
  "blockhash": "000000000000000000158c2c1ad9a1fcddf8a771fde6b6b4fcf7b443b310cc7b",
  "confirmations": 1,
  "time": 1532027659,
  "blocktime": 1532027659
}

```


---

### Answer by username_3 on 2018-07-20. Score: 1

As an alternative to username_2’s answer:

Once you use `getrawtransaction`, you can copy the raw transaction hex string into a `decoderawtransaction`command to return the detailed transaction info.

ie:

`bitcoin-cli decoderawtransaction [raw transaction hex string]`


---

