summaryrefslogtreecommitdiff
path: root/sh/rate
blob: 1824e7704d696b33490b2dcc32ce8e35fe59c936 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

# https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getTickerInformation
# click url/ result to see more return data descriptions
# last 24 hours volume weighted average price
# XXMRZUSD seems same as XMR/USD, but don't know how to query XMR/USD via jq
curl -sS "https://api.kraken.com/0/public/Ticker?pair=XXMRZUSD" | jq -r .result.XXMRZUSD.p.[1]

# Another less reliable way, due to `units_cur` sometimes error, maybe due to
# api website 403 error
#units -t XMR USD