"Then I can somehow delve into the account and pick the transaction at
certain block."
Mining rewards aren't transactions, so you can't query them in the usual way. As per this previous answer:
There are no inputs and outputs in Ethereum, just state changes and
balances. Therefore, mining rewards don't have a transaction hash
since they are not a transaction.
You'll either need to calculate the reward yourself, or use somebody else's API.
Calculating the reward yourself
The algorithm for calculating the reward - as stated on the Mining wiki page - is as follows:
The successful PoW miner of the winning block receives:
- A static block reward for the 'winning' block, consisting of exactly 5.0 Ether
- All of the gas expended within the block, that is, all the gas consumed by the execution of all the transactions in the block
submitted by the winning miner is compensated for by the senders. The
gascost incurred is credited to the miner's account as part of the
consensus protocoll. Over time, it's expected these will dwarf the
static block reward.
- An extra reward for including Uncles as part of the block, in the form of an extra 1/32 per Uncle included
The data required for the second and third parts can be queried from the block using:
web3.eth.getBlock(<block>).gasUsed
web3.eth.getBlock(<block>).uncles (Note: The reward per uncle is /32 of the static reward, i.e. 5 / 32.)
Using someone else's API
Etherscan is one of the block explorers that includes details of the reward for a given block (see here for an example). Details of their APIs can be found either on their site, or, for Python bindings, on this GitHub page. (I haven't checked that these return the reward details, so YMMV.)
EDIT :
The static reward is now 3.0 Ether
web3.eth.getBlock(<block>).gasUsedorweb3.eth.getBlock(<block>).cumulativeGasUsed? – AdrianClv Aug 18 '16 at 14:11.gasUsed. Have a look at the return values foreth_getBlockByHash- you'll see that.gasUsedis the total for that block..cumulativeGasUsedis when you use one of the transaction APIs (not block-level APIs) and you want the total for the block in which the transaction resides. – Richard Horrocks Aug 18 '16 at 14:20I was mixing the
getBlock()function withgetTransactionReceipt()for some reason.And for the reward from uncles, then it would be enough to do
numberOfUncles*5/32? Reading the wiki page, it also says:"Uncles included in a block formed by the successful PoW miner receive 7/8 of the static block reward = 4.375 ether A maximum of 2 uncles allowed per block."
– AdrianClv Aug 18 '16 at 14:52