FlightXML3: AirlineFlightSchedules exclude_codeshare issues

I’m having some issues getting accurate results from some AirlineFlightSchedules queries where the exclude_codeshare bool is set to true. For example, the following query


https://flightxml.flightaware.com/json/FlightXML3/AirlineFlightSchedules?start_date=1500004800&end_date=1500091200&origin=PIT&destination=EWR&howMany=50&exclude_codeshare=true


returns this response:



{
  "error": "NO_DATA No flight schedules found for your query"
}


However, with exclude_codeshare=false, we get these results:


{
  "AirlineFlightSchedulesResult": {
    "next_offset": -1,
    "flights": 
      {
        "ident": "DLH7896",
        "fa_ident": "RPA3455-1499837186-airline-0094",
        "actual_ident": "RPA3455",
        "departuretime": 1500055500,
        "arrivaltime": 1500061140,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "AUA7770",
        "fa_ident": "RPA3455-1499837186-airline-0094",
        "actual_ident": "RPA3455",
        "departuretime": 1500055500,
        "arrivaltime": 1500061140,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "DLH7869",
        "fa_ident": "RPA3453-1499837188-airline-0028",
        "actual_ident": "RPA3453",
        "departuretime": 1500051600,
        "arrivaltime": 1500057000,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E170",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3507",
        "fa_ident": "RPA3507-1499837188-airline-0407",
        "actual_ident": "RPA3507",
        "departuretime": 1500025500,
        "arrivaltime": 1500031020,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3609",
        "fa_ident": "RPA3609-1499837188-airline-0242",
        "actual_ident": "RPA3609",
        "departuretime": 1500033600,
        "arrivaltime": 1500039000,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3455",
        "fa_ident": "RPA3455-1499837186-airline-0094",
        "actual_ident": "RPA3455",
        "departuretime": 1500055500,
        "arrivaltime": 1500061140,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3456",
        "fa_ident": "RPA3456-1500094223-5-0-66",
        "actual_ident": "RPA3456",
        "departuretime": 1500068100,
        "arrivaltime": 1500073740,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3755",
        "fa_ident": "UAL3755-1500086004-9-0-91",
        "actual_ident": "RPA3755",
        "departuretime": 1500072000,
        "arrivaltime": 1500077400,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E75L",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3463",
        "fa_ident": "RPA3463-1499837188-airline-0134",
        "actual_ident": "RPA3463",
        "departuretime": 1500030000,
        "arrivaltime": 1500035640,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E170",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      },
      {
        "ident": "UAL3453",
        "fa_ident": "RPA3453-1499837188-airline-0028",
        "actual_ident": "RPA3453",
        "departuretime": 1500051600,
        "arrivaltime": 1500057000,
        "origin": "KPIT",
        "destination": "KEWR",
        "aircrafttype": "E170",
        "meal_service": "First: Refreshments / Economy: No meal",
        "seats_cabin_first": 6,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 64
      }
    ]
  }
}

Other queries like PIT → ORD (with that same start and end date) return results when exclude_codeshares=true but are missing certain flights, like ENY3362/AAL3362. I was under the assumption that excluding codeshares meant I would be getting back all of the flights with actual_ident values set as the ident. Is this a bug or is my assumption incorrect?

Thanks!

What’s happening here is that all of the flights between those airports are being flown by a regional carrier, so the ident never matches the actual_ident (so technically all of them are codeshares because no one can book a flight on the actual_ident). There may be some way to not exclude those flights, but I’ll have to file a bug and see what we can come up with on that.

Oh okay, I guess that makes sense. Yes, if you could file a bug and keep me updated on the status of that I would appreciate it. At the very least it might be worth clarifying that in the documentation.

Also, is there any sorting going on in the AirlineFlightSchedules response? It doesn’t seem like it. Would it be possible to sort from earliest to latest? Responding with an unsorted array means consumers will have to use the offset to paginate through (or set the max response) and get ALL of the scheduled flights in the date range before they can confidently display the earliest ones. This coupled with the query rate limiting in v3 could cause issues for many consumers of the API.

Good catch we’ll fix that also.

Just to chime in on this, it’d be awesome to have it setup (maybe with an option) to include regional flights but not codeshares. If I’m interested in only United Airlines flights, I’d definitely want to see regionals operating for United Airlines since United is the only way to book those flights. I think they fall in a different category because of this since true codeshares (say a United callsign for an Air Canada flight) can be booked through either airline generally.

Otherwise really looking forward to implementing FlightXML3. Looks like you guys have done a great job with it so far!

+1, this is a great idea. Something like exclude_codeshare=true&include_regional=true (or exclude_regional=false, whatever) is what I would love be able to do. Definitely seems like something many people would find useful!

@conej730 any update on getting the flights ordered by departure time? They’re still out of order:


https://flightxml.flightaware.com/json/FlightXML3/AirlineFlightSchedules/json/FlightXML3/AirlineFlightSchedules?start_date=1501214400&end_date=1501300800&origin=PIT&destination=ORD


{
  "AirlineFlightSchedulesResult": {
    "next_offset": 15,
    "flights": 
      {
        "ident": "QFA4619",
        "fa_ident": "SKW2979-1501046735-airline-0020",
        "actual_ident": "SKW2979",
        "departuretime": 1501269600,
        "arrivaltime": 1501275480,
        "origin": "KPIT",
        "destination": "KORD",
        "aircrafttype": "CRJ7",
        "meal_service": "First: No meal / Economy: No meal",
        "seats_cabin_first": 9,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 54
      },
      {
        "ident": "ASA4468",
        "fa_ident": "SKW2979-1501046735-airline-0020",
        "actual_ident": "SKW2979",
        "departuretime": 1501269600,
        "arrivaltime": 1501275480,
        "origin": "KPIT",
        "destination": "KORD",
        "aircrafttype": "CRJ7",
        "meal_service": "",
        "seats_cabin_first": 9,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 54
      },
      {
        "ident": "ETD3172",
        "fa_ident": "SKW2903-1501046743-airline-0077",
        "actual_ident": "SKW2903",
        "departuretime": 1501236000,
        "arrivaltime": 1501241400,
        "origin": "KPIT",
        "destination": "KORD",
        "aircrafttype": "CRJ7",
        "meal_service": "",
        "seats_cabin_first": 9,
        "seats_cabin_business": 0,
        "seats_cabin_coach": 54
      },
      …
   ]
}