Pages:
Author

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

legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 1638
Merit: 4508
**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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 1638
Merit: 4508
**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: 1960
Merit: 1908
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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 1960
Merit: 1908
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: 2212
Merit: 5622
Non-custodial BTC Wallet
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: 1960
Merit: 1908
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: 1638
Merit: 4508
**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: 1960
Merit: 1638
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: 1946
Merit: 3016
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
Cashback 15%
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.
Pages:
Jump to: