Skip to content

Instantly share code, notes, and snippets.

View thomasjp0x42's full-sized avatar

James P. Thomas thomasjp0x42

View GitHub Profile
@Frank-Buss
Frank-Buss / coinquote.sh
Created February 6, 2022 01:36
get the quote for a crypto currency from coinmarketcap in USD
#!/bin/bash
# first create an API key at coinmarketcap.com. It is free for personal use. Set it in a variable:
export API_KEY="11111111-1111-1111-1111-111111111111"
# now you can call the API with curl, and extract the result with jq
# for example to get the quote for a crypto currency in USD:
coinquote() {
curl -s -H "X-CMC_PRO_API_KEY:$API_KEY" -H "Accept:application/json" \
-d "symbol=$1&convert=USD" \