Bitcoin Forum
May 09, 2021, 10:01:48 PM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Price Image v2 (supporting Segwit addresses)  (Read 350 times)
TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
June 29, 2019, 11:46:51 PM
Last edit: June 20, 2020, 01:00:36 PM by TryNinja
Merited by OmegaStarScream (7), LoyceV (6), pooya87 (2), 1miau (2), bL4nkcode (1), bitmover (1)
 #1

EDIT: Other tickers are down for now as I change some API endpoints. Use only USD.

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.

1620597708
Hero Member
*
Offline Offline

Posts: 1620597708

View Profile Personal Message (Offline)

Ignore
1620597708
Reply with quote  #2

1620597708
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
joniboini
Legendary
*
Offline Offline

Activity: 1288
Merit: 1516


Be careful of impostor. Ask for a signed message.


View Profile
June 30, 2019, 05:08:32 AM
 #2

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.


        ▄▄▀▀▀▄▄
     ▄▄▀▄▄███▄▄▀▄▄
  ▄▄▀▄▄█████████▄▄▀▄▄
▄▀▄▄█████ ██▄▄▄▄▀██▄▄▀▄
█ ██████ ▄ █████ ████ █
█ █████ ▄█▄ ██ ▄█████ █
█ ████ ▄███▄ ██ █████ █
█ ███ ▄█████▄ ██ ████ █
▀▄▀▀█▄███████▄██▄██▀▀▄▀
  ▀▀▄▀▀█████████▀▀▄▀▀
     ▀▀▄▀▀███▀▀▄▀▀
        ▀▀▄▄▄▀▀

       ▄▄▄▄▄▄▄
   ▄▄▀▀       ▀▀▄▄
  █               █ ▄
 █   █▀▄ ▀█▀ ▀█▀   █ ▀▄
 █   █▀▄  █   █    █  ▀▄
  █  ▀▀   ▀   ▀   █    █
▄▀ ▄▄           ▄▀    ▄▀
 ▀▀  ▀▀▄▄▄▄▄▄▄▀▀      ▀▄
        ▀▄▄      ▄▄▀▀▄▄▀
           ▀▀▀▀▀▀

                      ▄▄▄
  ▄█▄              ▄███████▄
  ▀████▄▄         ██████▀██████▀
    ▀▀▀████▄▄     ███████████▀
    ▀██▄███████▄▄███████████
     ▄▄▄▀██████████████████
      ▀████████████████████
▀█▄▄     ▀████████████████
  ▀████████████████▀█████
    ▀████████████▀▄▄███▀
       ▀▀██████████▀▀
           ▀▀▀▀▀

               ▄▄   ▄▄
              ▄▀ ▀▀█  █
             ▄▀     ▀▀
         ▄▄▄▄█▄
     ▄█▀▀▀▀▀▀▀▀▀▀█▄
 ▄▀▄▀              ▀▄▀▄
█  █   ▄█▄    ▄█▄   █  █
 ▀█    ▀█▀    ▀█▀    █▀
  █                  █
   █   ▀▄      ▄▀   █
    ▀▄   ▀▀▀▀▀▀   ▄▀
      ▀▀▄▄▄▄▄▄▄▄▀▀

   ▄▄████████████████████▄▄
 ▄██████████████████████████▄
▄████████████████████████████▄
██████████ ▀▀█████████████████
██████████     ▀▀█████████████
██████████         ▀▀█████████
██████████         ▄▄█████████
██████████     ▄▄█████████████
██████████ ▄▄█████████████████
▀████████████████████████████▀
 ▀██████████████████████████▀
   ▀▀████████████████████▀▀

   ▄▄███████████████▄▄
 ▄██▀▀             ▀▀██▄
▄██              ▄▄   ██▄
██        ▄▄▄▄▄  ▀▀    ██
██      ▄▀     ▀▄      ██
██     █         █     ██
██     █         █     ██
██      ▀▄     ▄▀      ██
██        ▀▀▀▀▀        ██
▀██                   ██▀
 ▀██▄▄             ▄▄██▀
   ▀▀███████████████▀▀

   ▄▄███████████████▄▄
 ▄█████████████████████▄
▄██████████████▀▀███████▄
████████████▀▀    ███████
█████████▀▀   ▄   ███████
██████▀▀     █    ███████
████▀       █     ███████
█████▄▄   ▄█      ███████
████████ ██▄      ███████
▀████████ ▀▄███▄▄███████▀
 ▀█████████████████████▀
   ▀▀███████████████▀▀

  ▄▄███████████████▄▄
 █████████████████████
███████████████████████
███████████▀    ███████
██████████  ▄██████████
██████████  ███████████
████████      ▄████████
██████████  ███████████
██████████  ███████████
██████████  ███████████
 █████████████████████
  ▀▀███████████████▀▀

   ▄▄████████████████▄▄
 ▄█████▀▀▀██████▀▀▀█████▄
▄████▀  ▀▀▀    ▀▀▀  ▀████▄
████▀                ▀████
███▀                  ▀███
███       ▄    ▄       ███
██▀      ███  ███      ▀██
██       ▀█▀  ▀█▀       ██
██▄     ▄        ▄     ▄██
▀██▄     ▀▀▄▄▄▄▀▀     ███▀
 ▀███▄▄▄▄▄▄████▄▄▄▄▄▄███▀
   ▀▀████████████████▀▀
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 2380
Merit: 2633



View Profile
June 30, 2019, 06:42:13 AM
 #3

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.

TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
June 30, 2019, 11:08:49 AM
Last edit: June 30, 2019, 11:56:34 AM by TryNinja
 #4

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".

TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
June 30, 2019, 12:35:46 PM
Merited by OmegaStarScream (1)
 #5

@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

klaaas
Hero Member
*****
Offline Offline

Activity: 1456
Merit: 542



View Profile
June 30, 2019, 01:28:47 PM
 #6

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 ?

Shopping online and stekking sats (satsback) via Lightning
TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
June 30, 2019, 02:42:24 PM
 #7

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...

bitmover
Legendary
*
Offline Offline

Activity: 1204
Merit: 2439



View Profile WWW
July 01, 2019, 03:45:59 AM
 #8

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.

TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
July 04, 2019, 11:53:14 PM
 #9

Bump Smiley

Stedsm
Legendary
*
Offline Offline

Activity: 2394
Merit: 1235



View Profile
July 10, 2019, 05:28:23 AM
 #10

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?

███████████████████████████
███████████████████████████
██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█████████
████████████▀▀       ▀▀████
█████▀▀▀▀▀▀             ███
██████████    ▄█████▄    ██
██████████    ███████    ██
██████████    ▀█████▀    ██
█████▄▄▄▄▄▄             ███
████████████▄▄       ▄▄████
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█████████
███████████████████████████
███████████████████████████
.
.ROLLBIT..
THE SOCIAL & PROVABLY FAIR
CRYPTO CASINO

                TWITTER     |     DISCORD               
●  Instant Deposits & Withdrawals
●  Rakeback & Level Up Bonuses
●  Live Customer Support
..PLAY NOW..
TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
July 10, 2019, 05:57:09 AM
 #11

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?

Stedsm
Legendary
*
Offline Offline

Activity: 2394
Merit: 1235



View Profile
July 10, 2019, 02:37:16 PM
 #12

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.

███████████████████████████
███████████████████████████
██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█████████
████████████▀▀       ▀▀████
█████▀▀▀▀▀▀             ███
██████████    ▄█████▄    ██
██████████    ███████    ██
██████████    ▀█████▀    ██
█████▄▄▄▄▄▄             ███
████████████▄▄       ▄▄████
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█████████
███████████████████████████
███████████████████████████
.
.ROLLBIT..
THE SOCIAL & PROVABLY FAIR
CRYPTO CASINO

                TWITTER     |     DISCORD               
●  Instant Deposits & Withdrawals
●  Rakeback & Level Up Bonuses
●  Live Customer Support
..PLAY NOW..
TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
May 29, 2020, 07:18:33 PM
 #13

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

bL4nkcode
Copper Member
Legendary
*
Offline Offline

Activity: 1904
Merit: 1190


Buy high, sell low ヽ( ´¬`) ~


View Profile
September 26, 2020, 01:45:11 AM
Merited by TryNinja (1)
 #14

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 =

..bustadice..         ▄▄████████████▄▄
     ▄▄████████▀▀▀▀████████▄▄
   ▄███████████    ███████████▄
  █████    ████▄▄▄▄████    █████
 ██████    ████████▀▀██    ██████
██████████████████   █████████████
█████████████████▌  ▐█████████████
███    ██████████   ███████    ███
███    ████████▀   ▐███████    ███
██████████████      ██████████████
██████████████      ██████████████
 ██████████████▄▄▄▄██████████████
  ▀████████████████████████████▀
                     ▄▄███████▄▄
                  ▄███████████████▄
   ███████████  ▄████▀▀       ▀▀████▄
               ████▀      ██     ▀████
 ███████████  ████        ██       ████
             ████         ██        ████
███████████  ████     ▄▄▄▄██        ████
             ████     ▀▀▀▀▀▀        ████
 ███████████  ████                 ████
               ████▄             ▄████
   ███████████  ▀████▄▄       ▄▄████▀
                  ▀███████████████▀
                     ▀▀███████▀▀
           ▄██▄
           ████
            ██
            ▀▀
 ▄██████████████████████▄
██████▀▀██████████▀▀██████
█████    ████████    █████
█████▄  ▄████████▄  ▄█████
██████████████████████████
██████████████████████████
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
       ████████████
......Play......
ETFbitcoin
Legendary
*
Offline Offline

Activity: 1862
Merit: 2781


NotYourKeys.org - Not Your Keys, Not Your Bitcoin


View Profile
September 26, 2020, 11:34:58 AM
 #15

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 =

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.

TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
September 26, 2020, 12:07:04 PM
 #16

~
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).

ETFbitcoin
Legendary
*
Offline Offline

Activity: 1862
Merit: 2781


NotYourKeys.org - Not Your Keys, Not Your Bitcoin


View Profile
September 26, 2020, 12:10:15 PM
 #17

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).

Sorry, shouldn't assume you already fixed it (since the thread last updated few months ago) before it broke again.

TryNinja
Legendary
*
Offline Offline

Activity: 1736
Merit: 3275


Merit & Notifications bot: @BTTSuperNotifier_bot


View Profile WWW
September 26, 2020, 12:22:11 PM
 #18

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!