<p>The documentation is incorrect. <code>confirmations</code>, <code>time</code> and <code>blocktime</code> are not fields in the output of the rest API. You aren't doing anything wrong; those fields don't exist.</p>

CC BY-SA 4.0
2019-05-22T08:53:07.743Z
Thanks a lot Andrew. I thought so, but I had to ask. If I may have one more question, do you know about a way to get transaction confirmation via REST API? Most probably there is no way, but anyway ..
Jakub
CC BY-SA 4.0
2019-05-22T15:34:42.913Z
You can look up the blockhash with the rest API and it will tell you the number of confirmations for that block. The transaction will then also have the same number of confirmations. .. The rest API should probably be changed to match `getrawtransaction`.
Ava Chow
CC BY-SA 4.0
2019-05-22T04:10:57.003Z
2019-05-22T04:10:57.003Z
Ava Chow
<p>i am having a trouble with bitcoind REST API endpoint for retrieving transaction info. According to the <a href="https://bitcoin.org/en/developer-reference#get-tx" rel="nofollow noreferrer">documentation</a> it should return <code>confirmations</code> among the retrieved data. But my bitcoind do not have this present in the response. I have <code>rest=1</code> and <code>txindex=1</code> so everything probably should be ok.</p>

<p>I have picked a random txid to demonstrate the response </p>

<p>This is what i got from the REST API tx endpoint ( with truncated <code>vin</code>/<code>vout</code> ):</p>

<pre><code>{
    "hash": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e", 
    "vout": [ ... ], 
    "weight": 896, 
    "hex": "0100000001e96d13340057a99320702b9482a93114fb7ed0d27345242dd61a6ba967fe70a5010000006b483045022100833c21acd4e87aec7f794804606ef1699db2a5cc420f80af500243a43970cb8a0220617b9f55e2c6383f3093a4683af9fcdaad668b66e942553a6928b07e241141120121035deb8e150be5ccbfcca2a978d9bc3e2990afb61d08b49ce0494f39b10173c828ffffffff02dc9b68000000000017a91418b3b7d346e3f32cc4b3e0617fdf61e23d5ea2cc87cc8e6f1a000000001976a9140ae8e97489b9412f3f2ca6a63882f762174b368788ac00000000", 
    "blockhash": "0000000000000000000d5cfef192ed15ed37881cd5f0930d5613ac92a6b1b6e6", 
    "vin": [ ... ], 
    "txid": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e", 
    "version": 1, 
    "locktime": 0, 
    "vsize": 224, 
    "size": 224
}
</code></pre>

<p>And this is what i got from the <code>bitcoin-cli getrawtransaction 669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e 1</code> ( with truncated <code>vin</code>/<code>vout</code> ):</p>

<pre><code>{
  "txid": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e",
  "hash": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e",
  "version": 1,
  "size": 224,
  "vsize": 224,
  "weight": 896,
  "locktime": 0,
  "vin": [ ... ],
  "vout": [ ... ],
  "hex": "0100000001e96d13340057a99320702b9482a93114fb7ed0d27345242dd61a6ba967fe70a5010000006b483045022100833c21acd4e87aec7f794804606ef1699db2a5cc420f80af500243a43970cb8a0220617b9f55e2c6383f3093a4683af9fcdaad668b66e942553a6928b07e241141120121035deb8e150be5ccbfcca2a978d9bc3e2990afb61d08b49ce0494f39b10173c828ffffffff02dc9b68000000000017a91418b3b7d346e3f32cc4b3e0617fdf61e23d5ea2cc87cc8e6f1a000000001976a9140ae8e97489b9412f3f2ca6a63882f762174b368788ac00000000",
  "blockhash": "0000000000000000000d5cfef192ed15ed37881cd5f0930d5613ac92a6b1b6e6",
  "confirmations": 5,
  "time": 1558449750,
  "blocktime": 1558449750
}
</code></pre>

<p>Is there something i am doing wrong that I do not get the <code>confirmations</code> from the REST API endpoint as said in docs?</p>

<p>Bitcoind version v0.17.0.0</p>

<bitcoind><api><transaction-id>
bitcoind rest api tx endpoint
Jakub
# bitcoind rest api tx endpoint

(Asked by: username_0 on 2019-05-21)

i am having a trouble with bitcoind REST API endpoint for retrieving transaction info. According to the [documentation](https://bitcoin.org/en/developer-reference#get-tx) it should return `confirmations` among the retrieved data. But my bitcoind do not have this present in the response. I have `rest=1` and `txindex=1` so everything probably should be ok.

I have picked a random txid to demonstrate the response

This is what i got from the REST API tx endpoint ( with truncated `vin`/`vout` ):

```
{
    "hash": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e", 
    "vout": [ ... ], 
    "weight": 896, 
    "hex": "0100000001e96d13340057a99320702b9482a93114fb7ed0d27345242dd61a6ba967fe70a5010000006b483045022100833c21acd4e87aec7f794804606ef1699db2a5cc420f80af500243a43970cb8a0220617b9f55e2c6383f3093a4683af9fcdaad668b66e942553a6928b07e241141120121035deb8e150be5ccbfcca2a978d9bc3e2990afb61d08b49ce0494f39b10173c828ffffffff02dc9b68000000000017a91418b3b7d346e3f32cc4b3e0617fdf61e23d5ea2cc87cc8e6f1a000000001976a9140ae8e97489b9412f3f2ca6a63882f762174b368788ac00000000", 
    "blockhash": "0000000000000000000d5cfef192ed15ed37881cd5f0930d5613ac92a6b1b6e6", 
    "vin": [ ... ], 
    "txid": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e", 
    "version": 1, 
    "locktime": 0, 
    "vsize": 224, 
    "size": 224
}

```

And this is what i got from the `bitcoin-cli getrawtransaction 669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e 1` ( with truncated `vin`/`vout` ):

```
{
  "txid": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e",
  "hash": "669a1302ee3ccb482cc545f56cca9112a2d24a7959f1da18f87603640ff9288e",
  "version": 1,
  "size": 224,
  "vsize": 224,
  "weight": 896,
  "locktime": 0,
  "vin": [ ... ],
  "vout": [ ... ],
  "hex": "0100000001e96d13340057a99320702b9482a93114fb7ed0d27345242dd61a6ba967fe70a5010000006b483045022100833c21acd4e87aec7f794804606ef1699db2a5cc420f80af500243a43970cb8a0220617b9f55e2c6383f3093a4683af9fcdaad668b66e942553a6928b07e241141120121035deb8e150be5ccbfcca2a978d9bc3e2990afb61d08b49ce0494f39b10173c828ffffffff02dc9b68000000000017a91418b3b7d346e3f32cc4b3e0617fdf61e23d5ea2cc87cc8e6f1a000000001976a9140ae8e97489b9412f3f2ca6a63882f762174b368788ac00000000",
  "blockhash": "0000000000000000000d5cfef192ed15ed37881cd5f0930d5613ac92a6b1b6e6",
  "confirmations": 5,
  "time": 1558449750,
  "blocktime": 1558449750
}

```

Is there something i am doing wrong that I do not get the `confirmations` from the REST API endpoint as said in docs?

Bitcoind version v0.17.0.0

**Tags:** bitcoind, api, transaction-id


---

## 1 answers

### Answer by username_1 on 2019-05-22. Score: 0 | Accepted answer

The documentation is incorrect. `confirmations`, `time` and `blocktime` are not fields in the output of the rest API. You aren't doing anything wrong; those fields don't exist.

> **Comments:**
> **username_0**: Thanks a lot Andrew. I thought so, but I had to ask. If I may have one more question, do you know about a way to get transaction confirmation via REST API? Most probably there is no way, but anyway ..  
> **username_1**: You can look up the blockhash with the rest API and it will tell you the number of confirmations for that block. The transaction will then also have the same number of confirmations. .. The rest API should probably be changed to match `getrawtransaction`.  

---

