Author

Topic: Open API to request Bitcoin blockchain data? (Read 6285 times)

newbie
Activity: 6
Merit: 0
برای دریافت اطلاعات میتوانید از وبسرویس زیر استفاده کنید.
You can use the following Web site to receive the information.

                
//Get information account (single)
$json_info = json_decode(file_get_contents("https://blockchain.info/rawaddr/$address"),TRUE);

//Get information account (multi)
$json_info = json_decode(file_get_contents("https://blockchain.info/multiaddr?active=$address"),TRUE);


//example
https://blockchain.info/rawaddr/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

https://blockchain.info/multiaddr?active=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa|1K294dYK83kokPGEqWz9ciCHHqFD1smjVD
hero member
Activity: 882
Merit: 533
Well, the best of all solutions is to run your own node, in pruned mode, and query it using your own API in order to be secure.
Use bitcoinjs-lib to generate addresses and transactions, and pass them to bitcoind.
-...-

From security viewpoint, that is true. However, integrating an API is still the easier solution.

If you do not develop a critical system, using the already-suggested blockchain(dot)info API should be legit enough. It is fairly easy too.

I have a tutorial in my previous threads where I explain how to use these APIs with POST/GET requests and Ruby. That works with blockchain(dot)info too.

Or using PHP as @cloverme suggested:

Blockchain.info is the easiest, but anything free has its limits. So some API calls may be limited on number of times per day, etc. Also, there's downtime to contend with that you're not always notified about. My earlier projects used free API's but later I moved to my own nodes.

Code:
function getBalance($address) {
    return file_get_contents('https://blockchain.info/en/q/addressbalance/'. $address);
}
$balance_address =  getBalance('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');

Thank you for contributing to the community!  Smiley

no problem, however, i have been advised many times not to use file_get_contents, because of security issues. An example with curl may look too complex, maybe npm is the right sollution as they have made an api wrapper. Blocktrail is the most advised for this, as they are linked to some big miners, so your TXs have a better chance to be processed.
hero member
Activity: 1204
Merit: 531
Metaverse 👾 Cyberweapons
Well, the best of all solutions is to run your own node, in pruned mode, and query it using your own API in order to be secure.
Use bitcoinjs-lib to generate addresses and transactions, and pass them to bitcoind.
-...-

From security viewpoint, that is true. However, integrating an API is still the easier solution.

If you do not develop a critical system, using the already-suggested blockchain(dot)info API should be legit enough. It is fairly easy too.

I have a tutorial in my previous threads where I explain how to use these APIs with POST/GET requests and Ruby. That works with blockchain(dot)info too.

Or using PHP as @cloverme suggested:

Blockchain.info is the easiest, but anything free has its limits. So some API calls may be limited on number of times per day, etc. Also, there's downtime to contend with that you're not always notified about. My earlier projects used free API's but later I moved to my own nodes.

Code:
function getBalance($address) {
    return file_get_contents('https://blockchain.info/en/q/addressbalance/'. $address);
}
$balance_address =  getBalance('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');

Thank you for contributing to the community!  Smiley
hero member
Activity: 882
Merit: 533
Well, the best of all solutions is to run your own node, in pruned mode, and query it using your own API in order to be secure.
Use bitcoinjs-lib to generate addresses and transactions, and pass them to bitcoind.
Use your api to query bitcoind about the state of a transaction, or record the TX informations in a database at each new block. At least you will have custom informations.
hero member
Activity: 692
Merit: 569
Have a look at moneywagon . Instead of using one blockexplorer service , it will randomly sample between various services. You can query blocks/transactions/address and even create transactions.
full member
Activity: 166
Merit: 100
you can try
https://www.blocktrail.com/api

i want lean how it works too..

how can use callback with php?

and how can send btc?

(i can use bitcoind and rpc, have experience)
legendary
Activity: 1512
Merit: 1057
SpacePirate.io
I want to integrate requesting Bitcoin data into a little project of mine. Therefore I am looking for an open API where I can request Bitcoin address data like balance and transactions. Google did not give me useful results. Any advices how to do without running an own Bitcoin node?

Blockchain.info is the easiest, but anything free has its limits. So some API calls may be limited on number of times per day, etc. Also, there's downtime to contend with that you're not always notified about. My earlier projects used free API's but later I moved to my own nodes.

Code:
function getBalance($address) {
    return file_get_contents('https://blockchain.info/en/q/addressbalance/'. $address);
}
$balance_address =  getBalance('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa');
hero member
Activity: 882
Merit: 533
you can use bcoin, or prune the bitcoin core, i am testing it on 0.14, it is great, even if you have to download the whole blockchain you keep just a fraction of it, you will need around 7gb to store a pruned bitcoin core.
You can also use other projects, depending on what you need you can use the APIs, or a pruned node, or if you are on nodeJS you can go bcoin, but you will need to be skilled as bcoin is kind of tricky, and complex.
full member
Activity: 166
Merit: 100
Is there a thing called "Open Source Web Wallets" ? Welp! I need to look that up son!
Would really help figure out transparency behind the wallet.Most of the online wallets do provide built in API's but with limited access and cross verification of the tokens.I'd rather write my own API instead of begging them to provide me unlimited requests per minute.
Check coinb.in they are opensource web based bitcoin wallet but i don't think they have API option.
You have to run own bitcoin node (wallet) to create own api or you can simply call your node using jsonrpc.

for bitcoin node need hosting.
hosting for bitcoind cost not cheap
newbie
Activity: 33
Merit: 0
bitgo.com
blockcypher.com
blockchain.info
bitcore.io

and many more
hero member
Activity: 882
Merit: 533
or maybe you found some open source web wallets with built-in API ?
Is there a thing called "Open Source Web Wallets" ? Welp! I need to look that up son!
Would really help figure out transparency behind the wallet.Most of the online wallets do provide built in API's but with limited access and cross verification of the tokens.I'd rather write my own API instead of begging them to provide me unlimited requests per minute.

there are a lot of open source wallets :

- Safe wallet
- Insight API (then you have to build the frontend)
- PiWallet

These are the most used projects, buti  am sure you can find more on github.
legendary
Activity: 994
Merit: 1000
Is there a thing called "Open Source Web Wallets" ? Welp! I need to look that up son!
Would really help figure out transparency behind the wallet.Most of the online wallets do provide built in API's but with limited access and cross verification of the tokens.I'd rather write my own API instead of begging them to provide me unlimited requests per minute.
Check coinb.in they are opensource web based bitcoin wallet but i don't think they have API option.
You have to run own bitcoin node (wallet) to create own api or you can simply call your node using jsonrpc.
legendary
Activity: 1988
Merit: 1317
Get your game girl
February 28, 2017, 04:46:35 PM
#23
or maybe you found some open source web wallets with built-in API ?
Is there a thing called "Open Source Web Wallets" ? Welp! I need to look that up son!
Would really help figure out transparency behind the wallet.Most of the online wallets do provide built in API's but with limited access and cross verification of the tokens.I'd rather write my own API instead of begging them to provide me unlimited requests per minute.
sr. member
Activity: 434
Merit: 253
February 28, 2017, 04:39:36 PM
#22

I am curious about your build, what did you created ? or maybe you found some open source web wallets with built-in API ?
the last i heard of bitgo was something like a year ago, they still exists then.


Bitgo is the wallet most exchangers are using, bitstamp, kraken, bitfinex, shapeshift, and most Bitcoin ATMs.
hero member
Activity: 882
Merit: 533
February 28, 2017, 04:23:00 PM
#21

I know how complex it is, and i know how much ressources it consumes, but why other API providers do it without restriction ?
Block.io is a simple API who does the job, now for security considerations i didn't went too much in testing as i never had to use it in a production environment, i just know that it is accessible, easy to use, clear UI. And these are very appreciated qualities.


Other API providers restrict usage of their APIs, and do not offer it for free.

Block.io does not do any job, and their API is shit and not free, I used them for a year and it was a pain in the ass to work with them, they use STRIPE to bill their customers even when they pay with bitcoin, what the heck ?

I used them in development only, i won't pay for an api, especially when i don't need to use it, it is just that APIs are easy to use, and provides quick deployment.
It can be a pain for sure, especially if you need methods they can't provide.
Have you switched to annother API ?

Moved to Bitgo, but I decided to build my own solutions instead of relying on third parties, even payable ones.

I am curious about your build, what did you created ? or maybe you found some open source web wallets with built-in API ?
the last i heard of bitgo was something like a year ago, they still exists then.
sr. member
Activity: 434
Merit: 253
February 28, 2017, 03:32:33 PM
#20

I know how complex it is, and i know how much ressources it consumes, but why other API providers do it without restriction ?
Block.io is a simple API who does the job, now for security considerations i didn't went too much in testing as i never had to use it in a production environment, i just know that it is accessible, easy to use, clear UI. And these are very appreciated qualities.


Other API providers restrict usage of their APIs, and do not offer it for free.

Block.io does not do any job, and their API is shit and not free, I used them for a year and it was a pain in the ass to work with them, they use STRIPE to bill their customers even when they pay with bitcoin, what the heck ?

I used them in development only, i won't pay for an api, especially when i don't need to use it, it is just that APIs are easy to use, and provides quick deployment.
It can be a pain for sure, especially if you need methods they can't provide.
Have you switched to annother API ?

Moved to Bitgo, but I decided to build my own solutions instead of relying on third parties, even payable ones.
hero member
Activity: 882
Merit: 533
February 28, 2017, 02:03:35 PM
#19

I know how complex it is, and i know how much ressources it consumes, but why other API providers do it without restriction ?
Block.io is a simple API who does the job, now for security considerations i didn't went too much in testing as i never had to use it in a production environment, i just know that it is accessible, easy to use, clear UI. And these are very appreciated qualities.


Other API providers restrict usage of their APIs, and do not offer it for free.

Block.io does not do any job, and their API is shit and not free, I used them for a year and it was a pain in the ass to work with them, they use STRIPE to bill their customers even when they pay with bitcoin, what the heck ?

I used them in development only, i won't pay for an api, especially when i don't need to use it, it is just that APIs are easy to use, and provides quick deployment.
It can be a pain for sure, especially if you need methods they can't provide.
Have you switched to annother API ?
sr. member
Activity: 434
Merit: 253
February 28, 2017, 01:56:45 PM
#18

I know how complex it is, and i know how much ressources it consumes, but why other API providers do it without restriction ?
Block.io is a simple API who does the job, now for security considerations i didn't went too much in testing as i never had to use it in a production environment, i just know that it is accessible, easy to use, clear UI. And these are very appreciated qualities.


Other API providers restrict usage of their APIs, and do not offer it for free.

Block.io does not do any job, and their API is shit and not free, I used them for a year and it was a pain in the ass to work with them, they use STRIPE to bill their customers even when they pay with bitcoin, what the heck ?
hero member
Activity: 882
Merit: 533
February 28, 2017, 01:33:13 PM
#17
using blockchain.info api, it would take really a month to get an API key Cheesy

my two applications got rejected recently
I don't understand why they are so restrictive about their API, but if you really need one to work with, use block.io, i like them because it is really easy to use, easy to generate and manage accounts, and they support bitcoin litecoin dogecoin.
I didn't tested the others but i plan to do it soon.
Talking about these APIs is there a website who tracks them ?

You do not understand ?

Because it costs them lots of money and ressources to maintain the API up, and to answer all the technical issues for the API users.
Why not just make an API like that one, for free and you will have an  idea of its complexity.


Block.io sucks.

I know how complex it is, and i know how much ressources it consumes, but why other API providers do it without restriction ?
Block.io is a simple API who does the job, now for security considerations i didn't went too much in testing as i never had to use it in a production environment, i just know that it is accessible, easy to use, clear UI. And these are very appreciated qualities.
sr. member
Activity: 434
Merit: 253
February 28, 2017, 11:03:35 AM
#16
using blockchain.info api, it would take really a month to get an API key Cheesy

my two applications got rejected recently
I don't understand why they are so restrictive about their API, but if you really need one to work with, use block.io, i like them because it is really easy to use, easy to generate and manage accounts, and they support bitcoin litecoin dogecoin.
I didn't tested the others but i plan to do it soon.
Talking about these APIs is there a website who tracks them ?

You do not understand ?

Because it costs them lots of money and ressources to maintain the API up, and to answer all the technical issues for the API users.
Why not just make an API like that one, for free and you will have an  idea of its complexity.


Block.io sucks.
hero member
Activity: 882
Merit: 533
February 28, 2017, 02:54:16 AM
#15
using blockchain.info api, it would take really a month to get an API key Cheesy

my two applications got rejected recently
I don't understand why they are so restrictive about their API, but if you really need one to work with, use block.io, i like them because it is really easy to use, easy to generate and manage accounts, and they support bitcoin litecoin dogecoin.
I didn't tested the others but i plan to do it soon.
Talking about these APIs is there a website who tracks them ?
member
Activity: 101
Merit: 10
February 27, 2017, 07:36:52 PM
#14
using blockchain.info api, it would take really a month to get an API key Cheesy

my two applications got rejected recently
legendary
Activity: 1134
Merit: 1118
February 27, 2017, 03:40:33 PM
#13
@all responders: Thanks, your suggestions helped me a lot to realize the script.

Do you need help?

I can help you for reward Smiley

what is your project?

Thanks, as said in the opening post, I just integrate a fast address balance check into my project. The project is a little community project. Nothing spectacular that has to be mentioned here Wink

I'm quite curious to see which of the APIs would be the fastest, actually. Have you considered trying each blockchain API in order to see which returns data the fastest? I suppose it doesn't matter too much for a community project, but it would be quite interesting to see anyways...
tyz
legendary
Activity: 3360
Merit: 1533
February 27, 2017, 03:00:25 PM
#12
@all responders: Thanks, your suggestions helped me a lot to realize the script.

Do you need help?

I can help you for reward Smiley

what is your project?

Thanks, as said in the opening post, I just integrate a fast address balance check into my project. The project is a little community project. Nothing spectacular that has to be mentioned here Wink
full member
Activity: 166
Merit: 100
February 20, 2017, 02:29:22 AM
#11
Do you need help?

I can help you for reward Smiley

what is your project?
member
Activity: 118
Merit: 11
February 19, 2017, 11:56:06 PM
#10
bitgo.com and blockchain.info these both are good , if you are working in PHP then pm me i can help you more
sr. member
Activity: 378
Merit: 250
February 10, 2017, 01:59:34 PM
#9
3.Addition to the above,I find this one quite faster https://www.blockcypher.com/dev/bitcoin/ in terms of handling multiple requests and calls per second.
i have seen it in this post couple of times, i was studying blockchain api for something that i wanna try, ill take a look to this one
legendary
Activity: 1750
Merit: 1115
Providing AI/ChatGpt Services - PM!
February 10, 2017, 10:46:18 AM
#8
I want to integrate requesting Bitcoin data into a little project of mine. Therefore I am looking for an open API where I can request Bitcoin address data like balance and transactions. Google did not give me useful results. Any advices how to do without running an own Bitcoin node?
1.You don't have to run your own bitcoin node.Just a source for JSON data supporting multiple API calls.
2.You can either write your own JSON Rpc or use one of the existing from n number of sites listed above.
3.Addition to the above,I find this one quite faster https://www.blockcypher.com/dev/bitcoin/ in terms of handling multiple requests and calls per second.
sr. member
Activity: 378
Merit: 250
February 10, 2017, 10:00:51 AM
#7
what languages and frameworks are you using? blockchain.info provides api for php,node,java and some oother that i cant remember, rigth now, i talk to you about this one because it is the one that i know, they have documentation and examples of usage
hero member
Activity: 882
Merit: 533
February 10, 2017, 06:33:45 AM
#6
blocktrail is easy to use and convinient, plus it is built for merchants as it have a well coded account system, you can easily create an account for each user and retrieve these informations quickly and without hustle.
In all cases, you will have to be confident with the usage of objects, wether you use PHP, NODEJS, JQUERY languages, these APIs always return objects, maybe sometimes arrays, and usually both at the same time so if you don't have a lot of experience in these languages, i advise you to ask for someone to help you, or at least, learn more about POO.
sr. member
Activity: 378
Merit: 250
February 09, 2017, 05:30:28 PM
#5
most web wallets offer apis to comunicate with it, those that have been mentioned here and some others like blockchain.info, you can also use  a desktop wallet lke electrum
legendary
Activity: 854
Merit: 1000
try bitgo.com - and it is free.


I agree, Bitgo is a pretty good service especially with BitGo Instant.. Everyone loves getting their balances upped instantly,
if they're using a Bitgo wallet as well that is.
sr. member
Activity: 434
Merit: 253
try bitgo.com - and it is free.
sr. member
Activity: 528
Merit: 368
BlockCypher offers an API, as do many other blockchain explorers. If you take a look at the popular ones you'll probably find a few more that have one.
tyz
legendary
Activity: 3360
Merit: 1533
I want to integrate requesting Bitcoin data into a little project of mine. Therefore I am looking for an open API where I can request Bitcoin address data like balance and transactions. Google did not give me useful results. Any advices how to do without running an own Bitcoin node?
Jump to: