Text-Only Websites
The rate.sx site is pretty nifty. It provides a simple REST endpoint that server cryptocurrency exchange rate info. The nifty part is that it&#x27;s built to be used on the command line!<p><pre><code>    $ curl rate.sx        # outputs a nifty table of coins and their market rates
    $ curl rate.sx&#x2F;:help  # to see how to use the api
</code></pre>
I whipped up a shell function wrapper that makes this feel more like a standard cli command. In the off chance anyone is interested, I&#x27;m sharing it below (unfortunately, HN turns my tabs into spaces, so indentation is now a single space.)<p>Note that I was careful to not let it clutter up your environment, so feel free to include it in your .profile with impugnity. Also, this sort of exhibits my current experiments with terse shell style, so don&#x27;t hate on me for that, but otherwise the function should provide all the typical ergonomics you expect of a standard cli utility.<p><pre><code>    ratesx() (
     set -o errexit -o nounset -o noclobber
     RATESX_DOMAIN=${RATESX_DOMAIN:-rate.sx}
     RATESX_CURRENCY=${RATESX_CURRENCY:-USD}
     RATESX_NROWS=${RATESX_NROWS:-10}
     RATESX_FETCH_CMD=${RATESX_FETCH_CMD:-curl --silent}
    
     usage=$(cat &lt;&lt;-USAGE
     usage: ratesx [&lt;options&gt;] [&lt;command&gt; &lt;arguments&gt;]
    
     Show information about cryptocurrencies. Command defaults to &#x27;table&#x27;.
    
     Commands
       graph &lt;coin&gt; [&lt;interval&gt;]
         Display exchange rate graph for &lt;coin&gt; over &lt;interval&gt; (defaults to
         \$RATESX_CURRENCY hours)
    
       value &lt;amount&gt; &lt;coin&gt; [&lt;amount&gt; &lt;coin&gt;] ..]
         Convert sum of &lt;amount&gt;*&lt;coin&gt; to &lt;currency&gt; (defaults to
         \$RATESX_NROWS).
    
       table         Display table of top coins by market capitalization
       coins         Show list of supported cryptocurrency coins
       currencies    Show list of supported currencies
       info          Show upstream API info
    
     Options
       -q             Quiet mode. Hide header and footer
       -F             Hide &quot;Follow&quot; line
       -T             Disable ANSI color
       -n &lt;nrows&gt;     Number of currencies (rows) to display in output table
       -c &lt;currency&gt;  Base currency for exchange rate calculations
       -d &lt;domain&gt;    Use API endpoint located at &lt;domain&gt;
    
     Variables
       RATESX_DOMAIN=$RATESX_DOMAIN
         Default domain name of API endpoint
       RATESX_NROWS=$RATESX_NROWS
         Default count of rows to display in output table
       RATESX_CURRENCY=$RATESX_CURRENCY
         Default base currency for unit conversions
       RATESX_FETCH_CMD=$RATESX_FETCH_CMD
         Default command with which to submit API requests
     USAGE
     )
    
     fetch() { $RATESX_FETCH_CMD &quot;$@&quot;; }
     table() { fetch &quot;$1&#x2F;${2:+?$2}&quot;; }
     graph() { fetch &quot;$1&#x2F;$4${5:+@$5}${2:+?$2}&quot;; }
     value() { u=$1; o=$2; c=$3; shift 3; p=0
      for v in &quot;$@&quot;; do
       p=$((p^1)); [ $p = 1 ] &amp;&amp; r=&quot;${r:+$r+}&quot;; r=&quot;${r:-}$v&quot;
      done
      printf &#x27;%s %s\n&#x27; &quot;$(fetch &quot;$u&#x2F;$r${o:+?$o}&quot;)&quot; &quot;$c&quot;
     }
     info() { fetch &quot;$1&#x2F;:help&quot;; }
     currencies() { fetch &quot;$1&#x2F;:currencies&quot;; }
     coins() { fetch &quot;$1&#x2F;:coins&quot;; }
    
     while getopts &#x27;:qFTn:c:d:&#x27; opt &quot;$@&quot;; do
      case &quot;$opt&quot; in
      q) quiet=q;; F) follow=F;; T) ansi=T;;
      n) nrows=$OPTARG;; c) currency=$OPTARG;; d) url=$OPTARG;;
      :) error &quot;Need argument: -$OPTARG&quot; &quot;$usage&quot;;;
      *) error &quot;Unknown option: -$OPTARG&quot; &quot;$usage&quot;;;
      esac
     done; shift $((OPTIND - 1))
    
     nrows=${nrows:-$RATESX_NROWS}; currency=${currency:-$RATESX_CURRENCY};
     url=${url:-$RATESX_DOMAIN}; cmd=${1:-table}; shift || :;
    
     url=&quot;https:&#x2F;&#x2F;$currency${currency:+.}$url&quot;
     opts=&quot;${quiet:-}${follow:-}${ansi:-}&quot;
     opts=&quot;${opts:+$opts&amp;}${nrows:+n=$nrows}&quot;
     &quot;$cmd&quot; &quot;$url&quot; &quot;$opts&quot; &quot;$currency&quot; &quot;$@&quot;
    )</code></pre>