Filtering data from API in repeating group

I am trying to get flight data from an api but my issue is that I am trying to show potential departing flights in one page and returning flights in a different page. The way that the api returns flight data has data like shown below in postman (MIA to JFK in this example)

And then for returning flights has structured exactly the same in the same response (Return flight offered JFK to MIA)

I have been trying to structure the data to filter based on origin’s iata_code only for ‘MIA’ but cannot figure it out

I think the trouble is that the ‘origin’ and ‘iata_code’ are separated and Idk how to filter for just the departing flights and then show returning flights on a next page or something.

I have tried conditional formatting too that uses data stored from the search request but I have not been able to use that either.

Pls lmk if you have any questions or want clarification. I have been struggling with api call’s a lot but can’t seem to get it right

Also the API is called Duffel and the only parameters you can send are pagination and limit
here is their api documentation if you would like to see: Welcome | API Reference – Duffel