API examples?

Hi all

I’d like to give the IF api a go, but I don’t really plan to make anything. I’ve only really used the Github and Evernote api before, and never something like IFs.

Are there any api examples that I could look at? I’ve checked out Cameron’s Liveflight on Github, it’s helped quite a bit.

Thanks in advance! 😁

1 Like

I presume these are the api’s?

1 Like

Liveflight would be the best example.

Also Laura’s IFCTest app which I know you have seen since you had a pull request on it.

Those pretty much cover all the API calls. What else do you need?

2 Likes

Those are the objects that the API responses can be deserialized to. The actual calls that are sent to the server are sprinkled throughout the code.

2 Likes

Thanks for the answers!

I presume Cameron’s Liveflight stuff has the networking on it? 😁

1 Like

Yep. IFConnectorClient.cs (originally written by Laura) contains the connections to the IF app.

2 Likes

Awesome, thanks so much for the help!

1 Like
[DataMember]
public float Temperature { get; set; }
[DataMember]
public float DewPoint { get; set; }
[DataMember]
public short WindDirection { get; set; }
[DataMember]
public short WindSpeed { get; set; }
[DataMember]
public short WindGust { get; set; }
[DataMember]
public float Altimeter { get; set; }
[DataMember]
public float Visibility { get; set; }
[DataMember]
public string RawData { get; set; }
[DataMember]
public DateTime ReportTimeUTC { get; set; }
[DataMember]
public bool Available { get; set; }
[DataMember]
public string RawTAF { get; set; }

Just looked at this, seems intresting. Can I set the weather with it?

1 Like

No this is only to retrieve current weather.

3 Likes

Isn’t this the same guy who keeps complaining about why things in IF are paid…? (As he proceeds to get FREE API stuff)

21 Likes


Sorry just had to :p
Also, good luck!

11 Likes

Is this necessary? There’s no reason to threadcrap.

6 Likes

I’ll make a proper post to announce this but there is a github repo dedicated to API documentation : https://github.com/flyingdevelopmentstudio/infiniteflight-api

It will be updated and improved with a wiki etc

Also, I published an NPM module for Infinite Flight but haven’t written docs about it yet : https://www.npmjs.com/package/ifc

I’m on holydays right now but I’ll publish docs and tutorial in a real post in a week or two

3 Likes

Thank you!

So do I need all files in this? I understand the api, but not how it connects to the app and such. I’d like it to do it over the local network.

Note that with Infinite Flight there are two APIs:

  • Live API (this is what LiveFlight on the web and on iOS use - well, a derived form, that’s closed source).

  • Connect API which is above. Fantastic docs btw, @nicolas!

3 Likes

Is there any difference? I presume apps like @epaga’s use Connect api. I’d like to host my app thing on the web.

Thanks!

I think I’ve explained this to you in a PM before.

Basically, Connect is over a local network - you must have a device running Infinite Flight nearby on the same network in order to interact. As a result, you can control almost everything IF related from an interface on that network.

In contrast, the Live API (RESTful API) is accessible over the internet. This is only for retrieving data, such as aircraft positions, etc.

For you, you’d be after the Live API to have your app available as a website. If you were to use the Connect API on the web, you’d probably have to package it as a Chrome extension or something to get it to work, probably not the best thing for a beginner to do.

3 Likes

Okay, thank you very much for the help!

Are there any recommendations for a super simple starter project I could do? 😊

1 Like

One thing to add that I found out with IF-Assistant is that, if running on the same device, you can simply use the loopback address (127.0.0.1) and don’t even need a running network.

2 Likes

Oh yeah, good point! Meanwhile I’m still dealing with the network support requests… haha.

1 Like