Posted: . At: 1:00 PM. This was 2 years ago. Post ID: 14860
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



A very nice one-liner to return the Bitcoin price in USD.


This is a nice one-liner, it will return the current Bitcoin price in USD.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5]
└─$ curl -s usd.rate.sx/btc?T | grep avg: | awk '{ print $2}'

This is the script in action.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5]
└─$ curl -s usd.rate.sx/btc?T | grep avg: | awk '{ print $2}'
$42539

Use it like this to get the current price in British Pounds.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5]
└─$ curl -s gbp.rate.sx/btc?T | grep avg: | awk '{ print $2}'
£31138

Just access the site using curl like this to see a not so good graph of the Bitcoin price over time. This is not looking good.

┌──(john㉿DESKTOP-PF01IEE)-[/mnt/c/Users/Intel i5]
└─$ curl -s usd.rate.sx/btc?T
 
▶ Bitcoin (BTC) ▶ Mon 17 +1d -1.47%
 
 
  │     43000.0
  │ ⢣   ⡄ ⢠⠋⢇
  │  ⢣⡀⡘⠱⠳⠐ ⢸
  │   ⠈      ⡇           ⣀⢀   ⡀⡀ ⣠
  │          ⠃⣀⡰⠄⠄    ⡜⢢⢠⠃⠸⡀ ⡸⠘⢱⠔⠉⠦⡀⣴⢀
  │            ⠁ ⠑⡇   ⡇ ⠁  ⢣⡄⡇     ⠣⡇⠁⢣⡴
  │               ⡇  ⢸      ⢱⡇        ⠘⠁⡇ ⣾   ⢀⢸⢱
  │               ⡇  ⡜      ⠘           ⢸⢐⠙⡄⡜⣶⠉⠇⠸⡀ ⡀
  │               ⢸ ⡤⠃                   ⠏ ⠣⠃⠁   ⡇⡸⢱
  │               ⢸⢀⠇                      ⠈     ⠘⠁⢸
  │               ⢸⡸                               ⠘⢴
  │               ⠈⠁                                ⢸⢠
  │                                                 ⢸⢸⡄
  │                                                  ⡇⠧⡀                         ⢀⣀⠇
  │                                                  ⠃ ⢱         ⡠⠊⡆⡀            ⡎
  │                                                     ⡆      ⡸⣼   ⡇      ⢀⡇⢠⡆⡤⢓⡆
  │                                                     ⢣⢰⢸   ⡰⠃⠋   ⠑⠤⡀    ⢸⢸⡔⠹⠁ ⠁
  │                                                     ⠈⠇⠈⡆  ⡇       ⢱    ⢸⠘⠁
  │                                                        ⠸⡀⡜        ⠘⡄   ⡸
  │                                                         ⠱⠃         ⡇   ⡇
  │                                                                    ⢸   ⡇
  │                                                                    ⠈⡆  ⡇
  │                                                                     ⠇  ⡇
  │                                                                     ⢣⡄⢀⠇
  │                                                                     ⠘⠸⣸
  │                                                                       ⠿
  │                                                                     41700.0
  └────────────────────────────────────────────────────────────────────────────────
 
begin: $43001 (Mon 17 01:00) // end: $42369 (Tue 18 00:50)
high: $43008 (Mon 17 03:10) // low: $41680 (Mon 17 22:20)
avg: $42539 // median: $42344 // change: -631.78 (-1.47%)
Use @ for interval specification: /btc@10d, /eth@4w, /xrp@January (more in /:help)

This should be very useful for a Bitcoin fan. But is it on the last legs in 2022? Is it time to admit that digital currency is quite volatile? Are NFT`s the next thing to sink?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.