<p>There is not quite the method you are looking for, but you can use the <code>getblock</code> call which takes the block hash (not height, you can get the hash of a specific height using <code>getblockhash</code> method). That will give you the block, and you would then need to write a script to iterate through the transactions in the block and find ones which have an OP_RETURN output.</p>

CC BY-SA 3.0
2017-10-06T10:25:03.790Z
2017-10-06T10:25:03.790Z
meshcollider
<p>Is there a way to extract old OP_RETURN transactions from the commandline with bitcoin-cli or something? 
Something in the way of getAllOpRetFromBlock(345345) ...</p>

<bitcoind><bitcoin-cli><op-return><command-line-options>
Get OP_RETURN from bitcoin-cli
d00d
# Get OP_RETURN from bitcoin-cli

(Asked by: username_0 on 2017-10-06)

Is there a way to extract old OP\_RETURN transactions from the commandline with bitcoin-cli or something?
Something in the way of getAllOpRetFromBlock(345345) ...

**Tags:** bitcoind, bitcoin-cli, op-return, command-line-options


---

## 1 answers

### Answer by username_1 on 2017-10-06. Score: 3 | Accepted answer

There is not quite the method you are looking for, but you can use the `getblock` call which takes the block hash (not height, you can get the hash of a specific height using `getblockhash` method). That will give you the block, and you would then need to write a script to iterate through the transactions in the block and find ones which have an OP\_RETURN output.


---

