Author

Topic: [TOOL] Bitcoin data API to use in bitcointalk as images (Read 642 times)

legendary
Activity: 2352
Merit: 6089
bitcoindata.science
updated the transaction API to show coinbase transaction data:




Was it possible to turn the image into a gif and have the option to go through the last 3 or 4 transactions?

In my TODO list Smiley
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
Was it possible to turn the image into a gif and have the option to go through the last 3 or 4 transactions?

Like that:

date, transaction1 +1 BTC
5 seconds later
date, transaction2 -0.5 BTC
5 seconds later
date, transaction2 -0.0001 BTC


Something somewhat simple, but interesting.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I have some free time this week, I am open for new ideas and suggestions in this api

What kind of data would you like to see in this api?

Do you guys think a charts could be useful? Maybe I could do some charts, like a price chart, always updated.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
New feature: colors and font bold.

Example: Requesting the price of 0.1 bitcoin in EUR.
Using bold and purple color, just and parameters &hex=872cc3 and &bold

Code:
[img]https://bitcoindata.science/api/localprice.php?amount=0.1¤cy=EUR&hex=872cc3&bold[/img]


And Orange and bold
Code:
https://bitcoindata.science/api/addressbalance.php?address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa&hex=ffa500&bold



those new parameters works in all API.

Details in documentation.



https://bitcoindata.science/bitcointalk-api.html#local-price
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Thanks for you suggestion!!
Thanks! It's a good improvement Smiley

Quote
Looks like this message is badly decoded , even in other block explorers. Is this the message you are expecting to see?

Code:
D.@M ."
That's what I get when I copy it from Blockchair. But when I just look at it, it looks like this:
Code:
D.@M ."
I'd say it's fine. At least it's now clear there's something, and it's up to the viewer to dig deeper.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Can you add OP_RETURN data to the image?
For this transaction:


Done!
Thanks for you suggestion!!

Looks like this message is badly decoded , even in other block explorers. Is this the message you are expecting to see?

Code:
D.@M ."


Another examples:



legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Can you add OP_RETURN data to the image?
For this transaction:

I'd like to see this:
Image loading...
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Since we can't use Bank to buy BTC, there's no way of using USD directly. That's why we have to use USDT and the rate varies. I'm not an expert, so I'm not sure if you can get the price from Binance P2P (given link above). That's the actual price. Price in USD*BDT isn't the actual one.

But, the price in P2P is always higher than the real bitcoin price. I am of the opinion that the reference should never be the price in P2P.

Now, if that peer doesn't officially exist, then yes, you can use P2P. But the reference should always be the official quote and not the P2P quote.



We had a similar problem in Brazil about 5-6 years ago. Bitcoin was about 5-10% more expensive here compared to USD price.

The point is that the p2p option is probably the only option, joker_josue.



Little Mouse, I believe I have solved BDT problem:

Tether (USDT) price:
Code:
[url=https://bitcoindata.science/bitcointalk-api.html#local-price][img height=16]https://bitcoindata.science/api/localprice.php?coin=tether&amount=1¤cy=BDT[/img][/url]


Bitcoin (BTC) price:
Code:
[url=https://bitcoindata.science/bitcointalk-api.html#local-price][img height=16]https://bitcoindata.science/api/localprice.php?coin=bitcoin&amount=1¤cy=BDT[/img][/url]


Using data from binance p2p.
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
Since we can't use Bank to buy BTC, there's no way of using USD directly. That's why we have to use USDT and the rate varies. I'm not an expert, so I'm not sure if you can get the price from Binance P2P (given link above). That's the actual price. Price in USD*BDT isn't the actual one.

But, the price in P2P is always higher than the real bitcoin price. I am of the opinion that the reference should never be the price in P2P.

Now, if that peer doesn't officially exist, then yes, you can use P2P. But the reference should always be the official quote and not the P2P quote.
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
Where can I follow BDTUSDT price? I couldnt find this price in binance. Do you have any other reliable price for USDT BDT pair?
Here- https://p2p.binance.com/en/trade/sell/BTC?fiat=BDT&payment=ALL


Well, the problem is with USD rate vs USDT rate.

You are providing data based on USD rate while in our country, USD rate and USDT rate aren't the same. 1 USD based on the bank rate is 107 BDT while 1 USDT is now worth 113+ BDT. That's the difference.

Since we can't use Bank to buy BTC, there's no way of using USD directly. That's why we have to use USDT and the rate varies. I'm not an expert, so I'm not sure if you can get the price from Binance P2P (given link above). That's the actual price. Price in USD*BDT isn't the actual one.

My bad, I think it's too demanding from you since you are doing all these voluntarily. The point is if no one is willing to sell at the price, say X BDT, what's the point of saying 1 BTC is worth X BDT when it actually worths more?
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Suggestion: Add width and height tags to the image, to prevent the page size from changing after the image loads.
That's only possible if the dimensions don't change.

It is a good idea to fix height for some endpoints (not all). Width is impossible.

This is prevent most layout shift. The problem is that this cannot be defined in the api, but in the forum user post only...

Added some fixed height here:
https://bitcoindata.science/bitcointalk-api.html

@bitmover Is it possible to implement truncating in case there are so many decimal zero's?
Thank for pointing out.
I will check this 3 zero decimal point, which is wrong for usd. It must be 2. I will fix this next week.

Reduced to 2 decimal points now.


But the actual price of BTC right now is- 26700*113= 3017000 or 3 million BDT. (Here's 113 is USDT to BDT conversion rate)
There's a difference of 150k BDT which is huge.

On the other hand, in Binance P2P, right now, 1 BTC = 3019000 which is slightly different from the actual price I have shared.

So, Binance P2P is the most accurate price for BDT. No one will sell you 1 BTC for the price your image is showing.

The problem is that in Bangladesh has a very specific situation where 1 BTC is worth more than it is worth in other countries, you have a high spread rate. I can just convert USD to BDT that the price is not accurate to your country.

Where can I follow BDTUSDT price? I couldnt find this price in binance. Do you have any other reliable price for USDT BDT pair?


Quote
It would be a handy tool for us to be honest as there's no source which share the actual price in BDT, I repeat no source.

The source of the information is in the API documentation.

Quote
Using blockchain data from mempool.space and price data from coingecko and exchange.host
https://bitcoindata.science/bitcointalk-api.html
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
I am not sure if I understand. Is the BDT BTC price very different?
What is a good and reliable source of BDT BTC price?
According to your source, the current price of 1 BTC is-

It's 2.85 million BDT at the time of writing

But the actual price of BTC right now is- 26700*113= 3017000 or 3 million BDT. (Here's 113 is USDT to BDT conversion rate)
There's a difference of 150k BDT which is huge.

On the other hand, in Binance P2P, right now, 1 BTC = 3019000 which is slightly different from the actual price I have shared.

So, Binance P2P is the most accurate price for BDT. No one will sell you 1 BTC for the price your image is showing.
It would be a handy tool for us to be honest as there's no source which share the actual price in BDT, I repeat no source.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I guess it can be too heavy for a hosting it is hosted, especially if many users will start using it.
I'd guess the problem is with the API, not OP's hosting. If that's the case, maybe OP can temporarily cache data? It won't be real-time, but at least it will work all the time.

There is a 30sec cache. I will take a look at different options.

@bitmover Is it possible to implement truncating in case there are so many decimal zero's?
Thank for pointing out.
I will check this 3 zero decimal point, which is wrong for usd. It must be 2. I will fix this next week.

Suggestion: Add width and height tags to the image, to prevent the page size from changing after the image loads.
That's only possible if the dimensions don't change.

It is a good idea to fix height for some endpoints (not all). Width is impossible.

This is prevent most layout shift. The problem is that this cannot be defined in the api, but in the forum user post only...

That's awesome! I have tried it with BDT but the price I'm getting isn't exactly the price it should be. Well, your given price is correct as per the USD rate you are using but we are following the price based on USDT and the difference between the USD price from Google and USDT price on fake P2P exchange has a difference of 6-7 BDT. Can you by any chance bring me the price based on that rate? Well, it's too much asking for free I think as I'm going to use it on a web page. This rate can be implemented everywhere but when we think about the true price of Bitcoin in BDT, there's no way to get it as per my concern. I wouldn't mind spending little funds depending on the cost size.

I am not sure if I understand. Is the BDT BTC price very different?
What is a good and reliable source of BDT BTC price?
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
Bitcoin Price to local currency endpoint
That's awesome! I have tried it with BDT but the price I'm getting isn't exactly the price it should be. Well, your given price is correct as per the USD rate you are using but we are following the price based on USDT and the difference between the USD price from Google and USDT price on fake P2P exchange has a difference of 6-7 BDT. Can you by any chance bring me the price based on that rate? Well, it's too much asking for free I think as I'm going to use it on a web page. This rate can be implemented everywhere but when we think about the true price of Bitcoin in BDT, there's no way to get it as per my concern. I wouldn't mind spending little funds depending on the cost size.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Suggestion: Add width and height tags to the image, to prevent the page size from changing after the image loads.
That's only possible if the dimensions don't change.
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
Suggestion: Add width and height tags to the image, to prevent the page size from changing after the image loads.

When it's just a line, it's not noticeable, but when it's a broader set of information, it's noticeable.
copper member
Activity: 2170
Merit: 1822
Top Crypto Casino
@bitmover Is it possible to implement truncating in case there are so many decimal zero's?

Like with this price


Is it possible to have a feature/setting that removes or reduces the zeros to the nearest decimal non-zero figure?

79,362,000.000 USD could just be 79,362,000 USD
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I guess it can be too heavy for a hosting it is hosted, especially if many users will start using it.
I'd guess the problem is with the API, not OP's hosting. If that's the case, maybe OP can temporarily cache data? It won't be real-time, but at least it will work all the time.
legendary
Activity: 1974
Merit: 3049
This tool looks useful for some cases so I've tried it today. And I can say that sometimes it works fast enough, but in some cases it appears too slow (and I guess during that time not everyone will understand clear enough that a picture is expected there). Sometimes it doesn't show at all like here.



I guess it can be too heavy for a hosting it is hosted, especially if many users will start using it. Not criticizing, just sharing my experience.

As I said, the tool by itself looks useful. 👍
legendary
Activity: 2212
Merit: 7064
The reason is that some users just make the forum background black. Those users will simple don't see the image if who posted uses ?color=black in the endpoint.
Correct.
I think currently used neutral gray color is very good, unless someone is using exactly the same gray color shade for forum theme, but this would be very rear.
One easy alternative option is to use inverted colors in cases when images can't be seen.
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
The reason is that some users just make the forum background black. Those users will simple don't see the image if who posted uses ?color=black in the endpoint.

This is also true.

So I suggest using the green color as the standard color.
It is similar to what happens in the cinema area, which uses the green screen to adapt to any background that may be placed.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I agree black is better, however I need a color that will fit all users, and some of them use a dark background (even in the forum).

Maybe endpoints could include text color option. This would allow anyone who wants to change to another color.

I even implemented this solution,  but I decoded to rollback.

The reason is that some users just make the forum background black. Those users will simple don't see the image if who posted uses ?color=black in the endpoint.
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
Fantastic tool. Saved.  Wink


I agree black is better, however I need a color that will fit all users, and some of them use a dark background (even in the forum).

Maybe endpoints could include text color option. This would allow anyone who wants to change to another color.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I tested it by converting one of the PNGs to GIF, and it was smaller. Using less colors doesn't matter for the quality of those images.

Converted to gif
I will study how to make animations in a few days.

Is it just me or the font color of the text in the image is actually blurry. I mean we have to pay more attention to it to see it clearly.
It would have been more easier if the font color was black rather than grey.

I agree black is better, however I need a color that will fit all users, and some of them use a dark background (even in the forum).
hero member
Activity: 2702
Merit: 716
Nothing lasts forever
Is it just me or the font color of the text in the image is actually blurry. I mean we have to pay more attention to it to see it clearly.
It would have been more easier if the font color was black rather than grey.
If @bitmover could do this change it would be great.

Great efforts though. Congratulations.

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I researched about png x gif, and saw this:

Quote
PNG files almost always offer better compression and a reduced file size compared to GIF. The PNG format also supports variable transparency and millions of colors while GIF only supports 256 colors and does not offer alpha channels. For online use, the only scenario where GIF files are appropriate instead of PNG is animations.
https://www.diffen.com/difference/GIF_vs_PNG
I tested it by converting one of the PNGs to GIF, and it was smaller. Using less colors doesn't matter for the quality of those images.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I'm happy with the effort you're making to make things simpler, but manual editing means I need to bookmark this page and come back to it whenever I need code, so using some scripts like the one below would be very helpful.

Although this looks useful, I don't know how many people would use it. It has a total of 4 downloads..

Personally,  I think add-ons and extensions a bit invasive and I don't like to install them  only when need such as an adblock.
I will think about your suggestion.

I had to test this for a large transaction:

You always make good stress tests, but I was ready now.  I tested with chipmixer campaign transactions.

Nice tool. This could make discussion about specific TXID/address easier. But IMO it'd be better if BBcode generated by your page lead to web page of the source data (e.g. to mempool.space/tx/64_CHARACTER_HEX).

As I want to somehow promote the documentation page, an animated gif would be a nice fix.
I will try to do so and add mempool.space  website as the link when it is done.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
Nice tool. This could make discussion about specific TXID/address easier. But IMO it'd be better if BBcode generated by your page lead to web page of the source data (e.g. to mempool.space/tx/64_CHARACTER_HEX).



Test with transaction which makes Ordinal popular.

Default BB tag,


Replace url to mempool.space website,
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I had to test this for a large transaction:

I'm not disappointed! Update: okay, a bit: the image doesn't always load. My guess: API-limits on mempool.space?

Suggestions:
  • Remove the empty space under the data.
  • Use GIF instead of PNG (it's slightly smaller)
  • Crazy idea: use animated gif, without infinite loop (so loop once). Show "Created by Bitcoindata.science" for a few seconds, then make it disappear until reloading
legendary
Activity: 1596
Merit: 1288
I'm happy with the effort you're making to make things simpler, but manual editing means I need to bookmark this page and come back to it whenever I need code, so using some scripts like the one below would be very helpful.



If the image here for input and output is in tabular form, it's easier to follow. like blockchair.com Wallet statement

Code:
[img]https://bitcoindata.science/api/transaction.php?id=15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521[/img]
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Bitcoin BlockData API to use in Bitcointalk as Images

I have been working in this API for a few weeks, and I believe it is now ready to share with you guys.
The documentation is here: https://bitcoindata.science/bitcointalk-api.html

Using blockchain data from mempool.space and price data from coingecko and exchange.host, it is now possible to share bitcoin data such as address balances and transactions as an image in bitcointalk.org or any other forum using our API. The data is always updated when reloaded.

I have made four endpoints.


Transaction Details endpoint

Instead of just posting the transaction ID, you can just use this end point to show all transaction details, including all inputs/outputs, confirmation status, block height, fee rate , etc

For example transaction id 15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521
Code:
[img]https://bitcoindata.science/api/transaction.php?id=15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521[/img]



Bitcoin Mempool Fees


Requesting the recommend fees (data from mempool.space).

Code:
https://bitcoindata.science/api/bitcoinfees.php




Address Balance endpoint

Post the updated balance of any address, in any currency you like.

Example: Requesting the balance of address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNain EUR.

Code:
[img]https://bitcoindata.science/api/addressbalance.php?address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa¤cy=EUR[/img]




Bitcoin Price to local currency endpoint

Post the price of any amount of bitcoin in any fiat currency

Example: Requesting the price of 0.1 bitcoin in BRL.
Using bold and purple color, just and parameters &hex=872cc3 and &bold

Code:
[img]https://bitcoindata.science/api/localprice.php?coin=bitcoin&amount=0.1¤cy=BRL&hex=872cc3&bold[/img]




I hope those endpoints are useful for you. I believe the transaction endpoint is quite useful, as it has a lot of information which may be available without leaving the forum.

Please post suggestions or any bug you notice!
Jump to: