Pages:
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.
Pages:
Jump to: