You cant access these in flight APIs in exactly the same way as you can while on the plane, but the same information can be found for almost all flight in the air that use ADS-B, and there are many services that offer this as an API[1]
[0]: https://www.rtl-sdr.com/rtl-sdr-tutorial-receiving-noaa-weat...