Finding fifth freedom flights, or "flights that did NOT touch airport XXX"

I got a little down the rabbit hole on fifth freedom flights, which led me to wondering if there’s any efficient way to do something like this:

“Show me all flights operated by Emirates within a time window where DXB is neither the arrival nor departure airport”

You could easily brute-force it by pulling all EK flights for a time window and then filtering out, but that’s orders of magnitude more data than I’m actually after… anyway, it’s certainly not the most important thing in the world but seemed like an interesting question.

Note that just because a flight doesn’t touch a carrier’s hub/home country doesn’t mean they necessarily have fifth freedom traffic rights.

completely fair, but ignores the actual aeroapi question that I was really asking :wink: