Skip to content

Instantly share code, notes, and snippets.

@dbiesecke
Last active December 21, 2018 23:23
Show Gist options
  • Save dbiesecke/799815a88506e8fab4c250b393d4ef99 to your computer and use it in GitHub Desktop.
Save dbiesecke/799815a88506e8fab4c250b393d4ef99 to your computer and use it in GitHub Desktop.
Crypto Coin API's

Crypto REST Api Calls

       curl 'https://www.kraken.com/ajax'   -H 'accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,mt;q=0.6' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36' -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' -H 'accept: text/plain, */*; q=0.01' -H 'referer: https://www.kraken.com/u/trade' -H 'authority: www.kraken.com' -H 'x-requested-with: XMLHttpRequest' -H 'dnt: 1' --data 'dataflag%5Bacc%5D=967&dataflag%5Bpub%5D=40&orderlistflag=3&positionlist%5Bpos%5D=0&positionlist%5Breqid%5D=0&positionlist%5Bgroup%5D=1&orderlistclose%5Bpos%5D=0&orderlistclose%5Breqid%5D=1&tradelist%5Bpos%5D=0&tradelist%5Breqid%5D=1&ledger%5Bpos%5D=0&ledger%5Breqid%5D=1&pair=XMREUR&rate%5Breqid%5D=0&rate%5Bkv%5D=false&depth%5Breqid%5D=0&a=fetch' --compressed | jq  '.data.rate.rate'


curl --request GET                                   
  --url https://api.bitfinex.com/v1/pubticker/etheur
function crypto-rates {
DATA=`curl -kSsl 'https://www.kraken.com/ajax' -H 'accept-language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,mt;q=0.6' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36' -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' -H 'accept: text/plain, */*; q=0.01' -H 'referer: https://www.kraken.com/u/trade' -H 'authority: www.kraken.com' -H 'x-requested-with: XMLHttpRequest' -H 'dnt: 1' --data 'dataflag%5Bacc%5D=967&dataflag%5Bpub%5D=40&orderlistflag=3&positionlist%5Bpos%5D=0&positionlist%5Breqid%5D=0&positionlist%5Bgroup%5D=1&orderlistclose%5Bpos%5D=0&orderlistclose%5Breqid%5D=1&tradelist%5Bpos%5D=0&tradelist%5Breqid%5D=1&ledger%5Bpos%5D=0&ledger%5Breqid%5D=1&pair=XMREUR&rate%5Breqid%5D=0&rate%5Bkv%5D=false&depth%5Breqid%5D=0&a=fetch' --compressed`
# return
# check arguments
if [ $# -eq 0 ];
then
echo $DATA | jq '.data.rate.rate'
else
echo $DATA | jq '.data.rate.rate.'$1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment