Hello! Thanks in advance.
What’s the best strategy for getting all the flights each day for a given list of aircraft (around 50 right now)?
Strategy 1
I started off doing /flights/search?query=-idents "{{mylist}}"
every five minutes.
pros:
- can get all my aircraft in a single api call
- don’t have to wrestle with “Too Many Requests” throttle
- good resolution, and relatively real time data
- simple model to reason about
cons:
- this is 288 calls per day to an API that costs USD 0.05, and so is about $14/ day (and this is a hobby project)
- I could back it down to every 30 minutes, but that’s still $2.40 / day; and, many of the flights I care about are training flights and I worry that I’d miss them, given that calls with this signature seem to only reply with flights in the air right now
Strategy 2
So I’ve swapped to a call to /flights/{{ident}}
once per day.
pros:
- now I’m down to roughly 50 calls per day to an API that costs USD $0.005, or about 25c / day
cons:
- my python code needs logic to handle the Too Many Requests, so its slightly more complicated and definitely takes longer to run
- much less real time data
questions:
- with the new strategy, I think I’m still getting all the flights for each tail each day, but will I? I’ve seen responses to this API include things that were multiple hours in the past - will it get things that are days in the past?
- how far back will this API go; could I back it off to once per week for aircraft that don’t fly that often?
- My “list” is a ragtag collection of aircraft reg numbers that FAA, TransportCanada, and other sources believe are electric aircraft; Pipistrel VELIS Electros, Beta Alia 250’s, and other assorted odds and ends. is there a way to query using
/flights/seach
but specify something likeengine_type
that I’m not seeing instead of listingidents
individually?