# FlightXML3 GetFlightTrack inconsistency

**URL:** https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157
**Category:** AeroAPI
**Created:** [September 25, 2017, 12:16am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157 "2017-09-25T00:16:05Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![phumflyer](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/phumflyer/32/21787_2.png) [@phumflyer](https://discussions.flightaware.com/u/phumflyer)
#### Post date: [September 25, 2017, 12:16am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/1 "2017-09-25T00:16:05Z")

</div>

GetFlightTrack sometimes returns an error _NO\_DATA No data found for AAL2455-1505971539-airline-0583_ . Sometimes it actually provides the flight track data.

Has anyone else encountered such an inconsistency? Is there something I need to do to always get the proper results?

In both cases, I’ve used Python code that looks like:

```
payload={'ident':'AAL2455-1505971539-airline-0583'}
response = requests.get(fxmlUrl + "GetFlightTrack", params=payload,
			auth=(username, apiKey))

```

---

<div class="post-metadata">

### Author: ![conej730](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/conej730/32/122980_2.png) [@conej730](https://discussions.flightaware.com/u/conej730)
#### Post date: [September 28, 2017, 8:40pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/2 "2017-09-28T20:40:33Z")

</div>

Confirmed that there is an issue there. I’ve worked up a patch and will release it next week.

---

<div class="post-metadata">

### Author: ![phumflyer](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/phumflyer/32/21787_2.png) [@phumflyer](https://discussions.flightaware.com/u/phumflyer)
#### Post date: [September 29, 2017, 4:00am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/3 "2017-09-29T04:00:12Z")

</div>

That’s great news – thanks for the update!

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [November 6, 2017, 7:34pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/4 "2017-11-06T19:34:05Z")

</div>

Hi,  
trying to use that method and gives no data  
{“error”:“NO\_DATA No data found for CCA940-1509949537-airline-0315”}

---

<div class="post-metadata">

### Author: ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)
#### Post date: [November 6, 2017, 8:08pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/5 "2017-11-06T20:08:53Z")

</div>

> [@pribeirojit](#):
>
> rying to use that method and gives no data
> 
> {“error”:“NO\_DATA No data found for CCA940-1509949537-airline-0315”}

That flight is still in the future, so there is no positional data for it yet.

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [November 7, 2017, 9:20am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/6 "2017-11-07T09:20:09Z")

</div>

Something strange happened, I was sured that I had picked a random flight from your site [http://flightaware.com/live/](http://flightaware.com/live/) and then queried the FlightInfoStatus, and with the result ident queried GetFlightTrack… so it wasn’t in the future.

Just to have sure, I have repeated now the test with another random flight ocurring at this exact moment (UAE31), and it returned this ident UAE31-1510035986-airline-0234 wich I used in GetFlightTrack. Again, no data found.

Is there a bug, or I’am missing something?  
Thanks.

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [November 7, 2017, 4:37pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/7 "2017-11-07T16:37:07Z")

</div>

EDIT:  
I was firstly quering FlightInfoStatus with the param howMany=1, and I didn’t realized that I was really obtaining a flight that was planned to ocurr days later. So, my bad, my appologies. The GetFlightTrack method is working as expected.

My question now is if there is any way to obtain the current flight (that is really flying right now) given the ident UAE186, for example.  
This way it gives me a list of flights with that ICAO code and flight number, but I have to filter in my side by departure date time like today to obtain that unique record. For that, howMany must be superior than 1, since the method returns the list of flight ordered from newest to oldest. If there is not possible to obtain the current flight from one query, I am assured that the param howMany=15 (1query) is sufficient to give me the current flight in the list?

Thanks again.

---

<div class="post-metadata">

### Author: ![phumflyer](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/phumflyer/32/21787_2.png) [@phumflyer](https://discussions.flightaware.com/u/phumflyer)
#### Post date: [November 7, 2017, 5:54pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/8 "2017-11-07T17:54:09Z")

</div>

You should probably make a new thread if you have additional questions because they’re focused on _using_ the API and not on the bug I identified – which is now resolved.

> if there is any way to obtain the current flight (that is really flying right now) given the ident UAE186  
> I have to filter in my side by departure date time like today to obtain that unique record  
> If there is not possible to obtain the current flight from one query, I am assured that the param howMany=15 (1query) is sufficient to give me the current flight in the list?

Seems like you have it mostly figured out. Just use FlightInfoStatus with, say, howMany=15, and loop through the results looking for `status` that contains “En Route”

---

<div class="post-metadata">

### Author: ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)
#### Post date: [November 7, 2017, 6:48pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/9 "2017-11-07T18:48:29Z")

</div>

> [@phumflyer](#):
>
> Seems like you have it mostly figured out. Just use FlightInfoStatus with, say, howMany=15, and loop through the results looking for status that contains “En Route”

Yes, that the recommended strategy, though checking the timestamp fields for (actualdeparturetime != 0 and actualarrivaltime == 0) is probably safer than relying on the status string.

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [November 8, 2017, 9:25am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/10 "2017-11-08T09:25:47Z")

</div>

Thanks for your help @bovineone and @phumflyer

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [November 9, 2017, 3:42am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/11 "2017-11-09T03:42:58Z")

</div>

Hi Again,

Regarding the stategy to check if a plane is at the skies, Can I also check if is “en route” checking progress\_percent? If the value is \>0 and \<=100, then is flying.

---

<div class="post-metadata">

### Author: ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)
#### Post date: [November 9, 2017, 4:12am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/12 "2017-11-09T04:12:45Z")

</div>

The progress\_percent will not be a meaningful value for “position-only” flights that lack a flight plan and we are unable to determine what the destination of the flight is.

---

<div class="post-metadata">

### Author: ![conej730](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/conej730/32/122980_2.png) [@conej730](https://discussions.flightaware.com/u/conej730)
#### Post date: [November 10, 2017, 12:09am UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/13 "2017-11-10T00:09:43Z")

</div>

Yeah a better way to check if it’s in flight is to verify that actual\_departure\_time is not 0 or -1 and actual\_arrival\_time is 0 or -1 and cancelled and diverted are false.

---

<div class="post-metadata">

### Author: ![pribeirojit](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/pribeirojit/32/36295_2.png) [@pribeirojit](https://discussions.flightaware.com/u/pribeirojit)
#### Post date: [December 13, 2017, 11:47pm UTC](https://discussions.flightaware.com/t/flightxml3-getflighttrack-inconsistency/26157/14 "2017-12-13T23:47:05Z")

</div>

Thanks. I’m clarified on this.
