I have this script:
curl -sX 'GET' \
'https://api.coingecko.com/api/v3/exchange_rates' \
-H 'accept: application/json' | jq -rc '.[]|select(.)|keys,(.[].value|tostring)'
and the source of the JSON is:
{
"rates": {
"btc": {
"name": "Bitcoin",
"unit": "BTC",
"value": 1,
"type": "crypto"
},
"eth": {
"name": "Ether",
"unit": "ETH",
"value": 14.327,
"type": "crypto"
}, ...
I cannot make pairs key (coin id, "btc")-value (value of the coin, "1"), what I need is the id of the coin and its value:
btc 1
eth 14.327
How can I make these two separate arrays as one?