Inara API
What is SLEF
The Ship Loadout Exchange Format (SLEF) is a format of data serving for exporting and importing ship loadouts between apps and sites, based on a principle 'require what is necessary, do not force the rest'.
In its principle, it copies the loadout data format contained within Frontier journals (for the implementation simplicity), but defines the required properties and adds some simple envelope around, for easier identification of apps using the data. Please see the data format description and example below.
Format description
The data consist of two blocks, header and data. While header contains just some formal stuff, the data contain the ship loadouts. For the header, the only properties required are appName, appVersion. For the data, the only properties required are Ship, Modules, Slot, Item and also BlueprintName, Level, Quality, ExperimentalEffect for Engineering when present. Also, the format may contain multiple ship loadouts at once, when necessary - each with its individual header and data. But even with the single ship loadout present, the format is still as array/dictionary.
See the simple example below with a limited number of modules for a better overview of all required properties, the blue properties in the header are optional.
Any app using this format should be able to handle this minimal format. But, of course, there can be much more data contained within. For example, you can simply put the full Loadout event from the journal to the data and your work is done. It's up to each app if it will use such data or not.
[ { "header": { "appName": "Inara", "appVersion": "1.0", "appURL": "https:\/\/inara.cz\/cmdr-fleet\/1\/32243\/", "appCustomProperties": { "anything": "here" } }, "data": { "Ship": "Anaconda", "Modules": [ { "Slot": "HugeHardpoint1", "Item": "Hpt_BeamLaser_Gimbal_Huge", "Engineering": { "BlueprintName": "Weapon_LightWeight", "Level": 4, "Quality": 0.95, "ExperimentalEffect": "special_corrosive_shell" } }, { "Slot": "largehardpoint1", "Item": "hpt_multicannon_gimbal_large" } ] } }, { "header": { "appName": "Inara", "appVersion": "1.0", "appURL": "https:\/\/inara.cz\/cmdr-fleet\/1\/944\/", "appCustomProperties": { "anything": "here" } }, "data": { "Ship": "asp", "Modules": [ { "Slot": "mediumhardpoint1", "Item": "hpt_multicannon_gimbal_medium" } ] } } ]
What data Inara provides for exports
Inara is always trying to provide as much data as possible, including module values, ship names and so on. But, keep in mind it may not be always a case and also the data may not be always absolutely correct, as the data may be using very old (and limited) imports, may be altered by user interactions or simply affected by other problems outside the control of Inara. The data provided will always contain the minimum described above, though.
Sending the ship loadout back to Inara is simple - just POST the SLEF in a variable externalslefimport to the URL provided in the export (appURL property) and when the ship's owner is logged in, his ship will get updated.
You can get some sample data in your Fleet under your Commander profile right here on Inara (if you are having the ship loadouts present there).