Author

Topic: Bitcoin Price Image v2 (supporting Segwit addresses) (Read 512 times)

legendary
Activity: 2758
Merit: 6830
And... we're back!

The API is working again (and I'll keep it that way).
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
Seems like there's an error and it shows 502 bad gateway status.
Thanks, it should be working now.

edit: Give it some time for the cache to clear.
All goods now. Thank you!
legendary
Activity: 2758
Merit: 6830
Seems like there's an error and it shows 502 bad gateway status.
Thanks, it should be working now.

edit: Give it some time for the cache to clear.
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
Found my thread that uses this feature and wonder why the image doesn't load and drive me to see this thread. Seems like there's an error and it shows 502 bad gateway status.
legendary
Activity: 2758
Merit: 6830
Sorry, shouldn't assume you already fixed it (since the thread last updated few months ago) before it broke again.
I haven't touched the code in a while. I only cared about keeping the primary function working (address balance to BTC and USD), since that's what most people use.

What messed up everything was BitcoinAverage (the previous API I used) wanting me to pay for a subscription. I wrote everything based on their API and changing it now would need a whole rewrite anyways. I was lazy at the time so just changed what I had to change to keep the basics. Cheesy

I'll make everything work again when I have some free time.
legendary
Activity: 2758
Merit: 6830
~
I changed the API and some things got messed up. Those links were actually returning the BTC value in USD (but with "BTC" at the end). That's fixed for now (USD > BTC), but I should honestly just rewrite the whole thing.

Looks like it's swapped from USD/BTC to BTC/USD. Also if you look closely when you use link to get EUR/BTC price, you got BTC/USD instead.
The EUR ticket is not working (there is a warning in the OP).
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
I got here from searching, but one thing I observed is this (below). An error, and should be "0.023"ish (in decimal, base in coingecko rate) instead of 266*****.** BTC.

USD to BTC
Code:
https://btc.ninjastic.space/price/AMOUNT-IN-USD/HEX-COLOR?size=14

https://btc.ninjastic.space/price/250/ff0000?size=14

250 USD =

Same thing with the one with other ticker parameter
Code:
https://btc.ninjastic.space/price/250/ff0000?size=16&ticker=EUR

250 USD =
legendary
Activity: 2758
Merit: 6830
I don't think there is anything wrong with bumping this old thread, right? Completly forgot I had created it. Cheesy

The project is back online after being requested here. I talked about how my API was limited to 5k requests/month for the price endpoint, but it looks like BitcoinAverage just randomly gave me 80k requests/month, so we are good. Cheesy

Now you can get an address value in a currency by using /price/ with the address instead of a number:
https://btc.ninjastic.space/price/3P3QsMVK89JBNqZQv5zMAKG8FK3kJM4rjt

And now you can also use different tickers for the whole /price/ endpoint (default is USD):
https://btc.ninjastic.space/price/3P3QsMVK89JBNqZQv5zMAKG8FK3kJM4rjt?ticker=EUR
https://btc.ninjastic.space/price/250?ticker=EUR
legendary
Activity: 3052
Merit: 1273
P.S.: Can you also create a BTC-to-ALT provider which could show our balance's value in our choice of alt based on a specific exchange?
I’ll take a look at this tomorrow. Smiley

So... a specific address balance in your chosen alt, right? E.g the address 1Ninja... balance (1 BTC) in ETH?

Yeah, you got that right.
Not just ETH, but a few more or even all of the alts (just like you did with the Fiat currencies as I can watch almost any Fiat currency's conversion to BTC).

One last request, can you also add alts in opposite and put the price in alts and see how much BTC is it worth (like we put price in fiat)? Can be said vice-versa of what I asked first.
legendary
Activity: 2758
Merit: 6830
P.S.: Can you also create a BTC-to-ALT provider which could show our balance's value in our choice of alt based on a specific exchange?
I’ll take a look at this tomorrow. Smiley

So... a specific address balance in your chosen alt, right? E.g the address 1Ninja... balance (1 BTC) in ETH?
legendary
Activity: 3052
Merit: 1273
Checked this - https://btc.ninjastic.space/balance/bc1q3zedphng6fckmal76g89n6e3ludvw4hyfwpysn

But received a completely blank (black) page there without showing any amount whereas I've got some change amount in it. Is there any minimum value set that will only be shown, for e.g.; 1 mBTC or more?

EDIT: My mistake I didn't add the hex color I wanted to see it in. It worked out well, great job. Smiley

https://btc.ninjastic.space/balance/bc1q3zedphng6fckmal76g89n6e3ludvw4hyfwpysn/ff0000
Did the job for me. I'm glad we don't need a specific amount of BTC in our wallet to be able to use this and it has given significance to SegWit which I don't see in most of the explorers too (blockchain.info is still not allowing SegWit addresses to let us watch our transactions and balance in their explorer).

P.S.: Can you also create a BTC-to-ALT provider which could show our balance's value in our choice of alt based on a specific exchange?
legendary
Activity: 2758
Merit: 6830
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
Nice job.

Why don't you add instructions about how to use your Price Image script in https://btc.ninjastic.space/ (it may even be your OP here)

It would be nice to have instructions and more detailed information, then just enter commands based on this thread.
legendary
Activity: 2758
Merit: 6830
Works good over here, nice. Maybe a euro to btc version could be added.
Curious what is used as the source to pull the price from ?
I'm using bitcoinaverage.com's API.

Works good over here, nice. Maybe a euro to btc version could be added.
Curious what is used as the source to pull the price from ?
Done. Now there is an ticker option (default is USD).

Since I noticed I would need to start adding a lot of params (like/this/and/it/would/be/huge/and/weird), I've added it as a query param (?ticker=USD).

Example:
https://btc.ninjastic.space/price/1250/ff0000?ticker=EUR

You can use USD, EUR, AUR, BRL, etc...
hero member
Activity: 1568
Merit: 544
Works good over here, nice. Maybe a euro to btc version could be added.
Curious what is used as the source to pull the price from ?
legendary
Activity: 2758
Merit: 6830
@OmegaStarScream done!

I've increased the default size a little bit, added an option to choose a custom size and the usd to btc endpoint.

New format is:
https://btc.ninjastic.space/balance/ADDRESS/HEX-COLOR/SIZE for address' balance.
https://btc.ninjastic.space/price/AMOUNT/HEX-COLOR/SIZE for usd to btc.

(color and size are optional)

 Smiley
legendary
Activity: 2758
Merit: 6830
The images that you posted above shows as invalid image for me. I use Brave with dnscrypt btw. Not sure if the problem is on my end or the code.

Can you try again? Maybe it was because I enables HTTPS but forgot to change my urls. (also try ctrl + f5 to clear your browser’s cache)

It’s showing up fine for me.

For suggestions, do you have any plans for the other features other than the one for checking balance? Like:

Code:
https://btc-priceimg.herokuapp.com/img/10.00/00f

I understand that yours is supposed to be for SegWit support and the above command is kinda irrelevant but, having all-in-one tool can be useful.

I also think that you should make the font in the image a little bit bigger.
It’s not irrelevant. I can work on that. Smiley

It also makes sense since I named it "Bitcoin Price Image".
staff
Activity: 3500
Merit: 6152
The problem should be from his end.

For suggestions, do you have any plans for the other features other than the one for checking balance? Like:

Code:
https://btc-priceimg.herokuapp.com/img/10.00/00f

I understand that yours is supposed to be for SegWit support and the above command is kinda irrelevant but, having all-in-one tool can be useful.

I also think that you should make the font in the image a little bit bigger.
legendary
Activity: 2170
Merit: 1789
The images that you posted above shows as invalid image for me. I use Brave with dnscrypt btw. Not sure if the problem is on my end or the code.
legendary
Activity: 2758
Merit: 6830
Now back online!

Inspired by btc-priceimg.herokuapp.com, I've create a (pretty much identical) page that generates an image with the address' current balance.

Why?

Because the original one doesn't accept bech32 addresses (they use Blockchain.info). Mine uses Blockstream's API, so bech32 addresses are allowed.

How to use it:

BItcoin Address:
Code:
https://btc.ninjastic.space/balance/YOUR-ADDRESS/HEX-COLOR

USD to BTC: (new)
Code:
https://btc.ninjastic.space/price/AMOUNT-IN-USD/HEX-COLOR?size=20

EUR to BTC: (new)
Code:
https://btc.ninjastic.space/price/AMOUNT-IN-EUR/HEX-COLOR?size=18&ticker=EUR

Options:
color, size and ticker are optional;
default color is black;
default ticker is USD.



Example 1:
https://btc.ninjastic.space/balance/bc1qfxj5fzzhkpnuyyezy9z7j7axja7n632d5wxzj6/ff0000

Result:

Example 2:
https://btc.ninjastic.space/price/250/ff0000?size=15

Result:

Example 3:
https://btc.ninjastic.space/price/250/ff0000?size=16&ticker=EUR

Result:

Example 4: (new)
https://btc.ninjastic.space/price/3P3QsMVK89JBNqZQv5zMAKG8FK3kJM4rjt/ff0000?size=16&ticker=BRL

Result:




Changelog:
Code:
06/30 - changed the size option to be a url query
06/30 - added a ticker option (suggested by @klaaas)
06/30 - added usd to btc price image, added size customization (suggested by @OmegaStarScream)
06/29 - released



If you have any suggestions, please let me know.
Jump to: