# FlightXML Java - Print Altitudes

**URL:** <https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922>\
**Category:** AeroAPI\
**Created:** [January 20, 2016, 1:42am UTC](https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922 "2016-01-20T01:42:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RSonecha](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@RSonecha](https://discussions.flightaware.com/u/RSonecha)\
**Post date:** [January 20, 2016, 1:42am UTC](https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922/1 "2016-01-20T01:42:59Z")

</div>

Hi, I am trying to print a table that has the time and then the altitude for a specific flight. Here is what I have so far:

System.out.println(“---------- PRINT ALTITUDES ----------”);  
FlightInfoExRequest flight\_req = new FlightInfoExRequest();  
flight\_req.setHowMany(5);  
flight\_req.setIdent(“UAL468”);  
flight\_req.setOffset(0);  
FlightInfoExStruct flightstruct = (df.flightInfoEx(flight\_req)).getFlightInfoExResult();  
System.out.println(flightstruct);

I am not getting the output I need, and I’m not sure what method I should be using.

Does anyone have any suggestions?

Thank you!

---

<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:** [January 20, 2016, 11:33pm UTC](https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922/2 "2016-01-20T23:33:08Z")

</div>

If the flight has not departed yet, then there likely will not be an interesting altitude for the flight yet.

Are you trying to retrieve the planned cruising altitude, or the current live altitude of the aircraft?

The planned cruising altitude is filed\_altitude, as returned by FlightInfoEx.

For the live altitude (and position), you might want to use the “InFlightInfo” function.

---

<div class="post-metadata">

**Author:** ![RSonecha](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@RSonecha](https://discussions.flightaware.com/u/RSonecha)\
**Post date:** [January 24, 2016, 6:30am UTC](https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922/3 "2016-01-24T06:30:55Z")

</div>

I’m trying to get the altitudes of a past flight. Is there a specific method for that?

---

<div class="post-metadata">

**Author:** ![adimic](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@adimic](https://discussions.flightaware.com/u/adimic)\
**Post date:** [January 25, 2016, 4:09pm UTC](https://discussions.flightaware.com/t/flightxml-java-print-altitudes/17922/4 "2016-01-25T16:09:22Z")

</div>

Altitudes and lat/lon positions for past flights can be found using “GetHistoricalTrack”. Documentation here: [https://flightxml.flightaware.com/soap/FlightXML2/doc#op\_GetHistoricalTrack](https://flightxml.flightaware.com/soap/FlightXML2/doc#op_GetHistoricalTrack)  
So for this DAL802 flight on 20th Jan: [https://flightaware.com/live/flight/DAL802/history/20160120/2045Z/KATL/KLGA](https://flightaware.com/live/flight/DAL802/history/20160120/2045Z/KATL/KLGA)  
you could use the call:

```auto

https://flightaware.com/json/FlightXML2/GetHistoricalTrack?faFlightID=DAL802-1453098419-airline-0151

```

where faFlightID is FlightAware’s id for that flight.

For positions within the last 24 hours you could use [https://flightxml.flightaware.com/soap/FlightXML2/doc#op\_SearchBirdseyeInFlight](https://flightxml.flightaware.com/soap/FlightXML2/doc#op_SearchBirdseyeInFlight). This allows for a more complicated query, for example if you want flights within a certain lat, lon box.
