I am trying to use jq to get certain information from this endpoint
curl -s https://bittrex.com/api/v1.1/public/getmarketsummaries/ | jq '[.]'
and the output below
[
{
"success": true,
"message": "",
"result": [
{
"MarketName": "BTC-1ST",
"High": 0.00010322,
"Low": 9.32e-05,
"Volume": 1475820.53114847,
"Last": 9.414e-05,
"BaseVolume": 145.89904728,
"TimeStamp": "2017-10-05T00:32:45.283",
"Bid": 9.415e-05,
"Ask": 9.521e-05,
"OpenBuyOrders": 614,
"OpenSellOrders": 5887,
"PrevDay": 0.00010169,
"Created": "2017-06-06T01:22:35.727"
},
{
"MarketName": "BTC-2GIVE",
"High": 1.31e-06,
"Low": 1.24e-06,
"Volume": 4356547.69360079,
"Last": 1.29e-06,
"BaseVolume": 5.59000303,
"TimeStamp": "2017-10-05T00:21:46.333",
"Bid": 1.29e-06,
"Ask": 1.31e-06,
"OpenBuyOrders": 298,
"OpenSellOrders": 2290,
"PrevDay": 1.29e-06,
"Created": "2016-05-16T06:44:15.287"
},
{
"MarketName": "BTC-ABY",
"High": 1.89e-06,
"Low": 1.62e-06,
"Volume": 31422008.3611497,
"Last": 1.68e-06,
"BaseVolume": 53.99330434,
"TimeStamp": "2017-10-05T00:25:21.307",
"Bid": 1.68e-06,
"Ask": 1.7e-06,
"OpenBuyOrders": 437,
"OpenSellOrders": 4761,
"PrevDay": 1.63e-06,
"Created": "2014-10-31T01:43:25.743"
}
When i try to get only MarketName
curl -s https://bittrex.com/api/v1.1/public/getmarketsummaries/ | jq '.[] | select(.MarketName=="BTC-1ST")'
i get the following error
jq: error (at <stdin>:0): Cannot index boolean with string "MarketName"
Other errors
curl -s https://bittrex.com/api/v1.1/public/getmarketsummaries/ | jq '.[1]'
and i get this
jq: error (at <stdin>:0): Cannot index object with number
Anyone know the right command to get those?
If you want everything in the
{}
that matches that marketName you can doIf you want to list all the MarketNames you can do
Also must programming landuages the lists start at 0.. so if I want to get the first item in the list in jq I can do
There's only 1 list item so that's why you get an error if you use
[1]
Know this is awhile ago, but I was able to do it by having