Filtering data by key value

I can’t figure out how to limit data only by key value. Let’s say I have following data:

[
{“a”:{“type”:“string”,“value”:“ABC0”,“key”:“a”},“b”:{“type”:“string”,“value”:“XYZ0”,“key”:“b”},
{“a”:{“type”:“string”,“value”:“ABC1”,“key”:“a”},“b”:{“type”:“string”,“value”:“XYZ1”,“key”:“b”},
]

How to query this data by key value so I get only objects that I need. For example I would like to get only object with key “b” of value “XYZ1” - it should return me only second object.

This endpoint https://nodes-testnet.wavesnodes.com/api-docs/index.html#!/addresses/getDataItem_1 is able to filter only by key name but I need to filter data by key value.

Write a script/piece of code to do this?