User Tools

Site Tools


jq

Find particular object

For an array of objects like so:

{
  "prepaidTypeId": "1023062",
  "name": "Tuts Twister GBP 5.0000",
  "org": "Yggdrasil",
  "status": "active",
  "category": "",
  "type": "",
  "variant": "",
  "model": "",
  "gameId": 7349,
  "aspect": "BONUS",
  "currency": "GBP",
  "betAmount": "125.00",
  "totalPrice": "121.625",
  "clientName": "",
  "gameParams": "{\"cheat\":\"\"}",
  "createdBy": "0",
  "extendRuleFn": "",
  "extendRule": "",
  "extendRuleType": "",
  "extendRuleValue": "0.00",
  "extendRuleSubType": "",
  "extendRuleCount": null
}
cat listprepaidtypes_ygg.json | jq '.data[] | select(.gameId == 7349 and .currency == "GBP") | .betAmount'

Random examples

curl -s "https://test-hrg-chs.lttlapp.com/api/v1/products?operatorId=hrg-chs&countryId=null&currencyId=EUR" -H 'Accept: application/json' | jq '.items[] | [.title, .id] | join(",")'
jq.txt · Last modified: 2021/02/16 09:56 (external edit)