1

I am trying to make a python script for a research project that needs to get all the transactions that happened between point A and B in time, but I can't find any API, website or library where I can get the data from.

So, where can I get this data from?

If there isn't any website/API/Library that would allow me to get the info from time A to B, my second option is to just get all the transactions and get just the ones from point A to B my self, but I also don't know where to get all transactions, any clues?

Thanks.

3 Answers 3

1

Questions looking for service provider availability/reviews are off-topic on this site, but luckily you can simply run a bitcoin full node to obtain and validate this information for yourself! Even better, since you are validating the information yourself, there is no risk of being fed incorrect information from some third party API.

To accomplish this, you'll need to install and run some bitcoin full-node software, such as bitcoin-core. When you first run that software, it will begin to download and validate the network history, which will take some time (how long will depend on your hardware, it can worth looking up how to optimize this. In most cases, you could expect it to take anywhere between a few hours and a few days).

Once your node is sync'd with the network, you can write some scripts that will make calls to bitcoin-cli, and index the outputs according to your needs.

2
  • Note that you'll need to run Bitcoin Core with -txindex to be able to query all transactions, rather than just ones related to your own wallet. Jan 14, 2022 at 22:44
  • I don't think this question is a request for service recommendation. This question is "How can I get said data?", a question that I would consider to be asking for a service recommendation would be "What is the best service to do X?". It's subtle, but the main difference is that the former is trying to solve a legit problem, while the latter is asking us to compare services for them.
    – Murch
    Jan 16, 2022 at 19:41
1

You can use my script for parsing the blockchain raw database. It's here https://github.com/ragestack/blockchain-parser available to download.

If you know approximately the starting block with TXs you need or the starting time, it will help you to set the limits for searching transactions, you can filter them from the output results.

1

https://mempool.space/docs/api/rest

The mempool.space api should suit your needs...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.