How can I get all the records that have a field equal to a given value

Hi
assume I have the following list of records:

{
  "name": "aaa",
  "ref": "ccc",
  "objectID": "111"
}
{
  "name": "bbb",
  "ref": "ccc",
  "objectID": "222"
}
{
  "name": "ccc",
  "ref": "aaa",
  "objectID": "333"
}

I need to get a list of objectIDs of all the records that have ref == ‘ccc’ (that actually are 111 and 222).

I’m trying to solve this silly problem in Python since yesterday with no success.
Any help is appreciated.

Thanks
Nico