Developing of API

Damien

New member
Hello guys, i need your help.
I'm trying to create an API. With help of this API i would like to get statistics for the last 24 hours of Bitcoin network and return something like that:
  • Amount of mined blocks
  • Amount of transactions
  • Hashrate

and so on...

Can you suggest me, how i can access this data without using others APIs?

Thanks

GL and have a good day, guys!
 

Diego

Member
If you want a quick and easy sollution, check out https://bitcore.io

If you want to do it yourself, you'll have to run a full node and either use the json-rpc interface and build a custom api on top of it, or build a block parser, extract the needed data and build an api on top of this data
 

Maxwell

Member
I'll explore and try.

GL
Why don't you want to use an external API?

There are a lot of great solutions out there, even for free. I would recommend chain.so, they have the best realtime socket setup, and you can subscribe to events like mew blocks, or new mempool txes.

Parsing blocks and txes yourself from the full node is a total pain in the ass, while it would be a great idea if you're looking to learn, it's a waste of time if you have some business end-goal from this..
 

Ivan

Member
I'll explore and try.

GL
Why don't you want to use an external API?

There are a lot of great solutions out there, even for free. I would recommend chain.so, they have the best realtime socket setup, and you can subscribe to events like mew blocks, or new mempool txes.

Parsing blocks and txes yourself from the full node is a total pain in the ass, while it would be a great idea if you're looking to learn, it's a waste of time if you have some business end-goal from this..
Sometimes, running a full node, is a cost overhead.
 

Kingston

Member
best would be to talk directly to bitcoind, throw the rpc interface, just send some json and parse it.

In that way you will not really need to rely to much on any third party(often they come and go).
You might want to have like 2 urls that you get the current block from for checking that your node is up to date.

Alot of blockexplorers work like this, and you will both learn more and offer a better service that you can scale, The down side is that you will have to allocate like 300/250 gb of diskspace for the bitcoins blockchain
 

Ashton

Member
Hi OP, I know you don't want to use external API's but you can rely on insight
They're open source so you can probably modify and redeploy according to your own needs. This is, of course, if you're sticking to commercial or personal uses and not something proprietary.
 
Top