"Variant or Airframe" list, through API

I do pull the list of supported aircraft, and know how to pull user custom airframe definitions by their internal ID, BUT what I would like to do with the API is load and specify on our site the so called “variant or airframe” public list for a given airframe, and have that available for selection as well.

This list …

Currently a user could pull one of these as a starting airframe, create their own internal ID, give me that ID, and then it can be added and referenced on the call to SImBrief, but obviously a bit cumbersome and not a general solution.

Instead, for example, if there was a json list with the normal types listed, but each entry that has one, a variant field added (NULL if only a default one) OR leave the current type list unchanged and have a separate json list showing all the types that have public variant and their reference ID – and then you offered another API field for specification …

$sb_arg_array['type'] = $sb_type;   // current field
$sb_arg_array['type_variant_id'] = $sb_type_variant_id;   // proposed additional field

Or, more simply, have an “internal ID” for these publicly available configs in a json list, and just sub that ID in the current aircraft type field, one step easier.

Would be cool.

* Orest

Hi Orest,

I think this is already achievable under the current airframe list endpoint?

Specifically this one:

https://www.simbrief.com/api/inputs.airframes.json

You can loop through that object to extract all of the public variants for each airframe. Something like (rough code):

$list = json_decode(file_get_contents('https://www.simbrief.com/api/inputs.airframes.json'),true);

$variants = array();

foreach ($list as $type => $data)
	{
	foreach ($data['airframes'] as $airframe)
		{
		$list_type = $airframe['airframe_list_type'];
		
		if (empty($variants[$list_type]))
			{
			$variants[$list_type] = array();
			}
		
		$variants[$list_type][] = array(
					'internal_id' => $airframe['airframe_internal_id'],
					'description' => $airframe['airframe_comments']
					);
		}
	}

print_r($variants['B738']);

Running the above code, and printing the ‘B738’ array, will return:

Array
(
    [0] => Array
        (
            [internal_id] => B738
            [description] => Default
        )

    [1] => Array
        (
            [internal_id] => 349674_1661382482154
            [description] => PMDG (MSFS 2020) - First Class Config [credit: Awemeter]
        )

    [2] => Array
        (
            [internal_id] => 349674_1661385747787
            [description] => PMDG (MSFS 2020) - Economy Config [credit: Awemeter]
        )

    [3] => Array
        (
            [internal_id] => 349674_1661387182464
            [description] => PMDG (MSFS 2020) - Boeing Converted Freighter [credit: Awemeter]
        )

    [4] => Array
        (
            [internal_id] => 349674_1661390511374
            [description] => PMDG (MSFS 2020) - BEDEK Special Freighter [credit: Awemeter]
        )

    [5] => Array
        (
            [internal_id] => 746599_1761165451022
            [description] => PMDG (MSFS 2024) - Dual Class [credit: PMDG Official]
        )

    [6] => Array
        (
            [internal_id] => 746599_1761165330356
            [description] => PMDG (MSFS 2024) - Single Class [credit: PMDG Official]
        )

    [7] => Array
        (
            [internal_id] => 746599_1761163464850
            [description] => PMDG (MSFS 2024) - High Density [credit: PMDG Official]
        )

    [8] => Array
        (
            [internal_id] => 746599_1761167330749
            [description] => PMDG (MSFS 2024) - Boeing Converted Freighter [credit: PMDG Official]
        )

    [9] => Array
        (
            [internal_id] => 746599_1761168575251
            [description] => PMDG (MSFS 2024) - BEDEK Special Freighter [credit: PMDG Official]
        )

    [10] => Array
        (
            [internal_id] => 223254_1615396809795
            [description] => ProSim (MSFS) - B737-800 [credit: DaddyBoon]
        )

)

I think that should do what you’re looking for? If not let me know.

Best regards,

Didn’t know about the airframe list pull.

Thanks, that is just what I was looking for, easy to pull the date from there.

* Orest

1 Like

A parallel question, and I expect this is not doable due to privacy issues, but is there a way to query all the personal aircraft profiles created by a given user, for selection when that very user is creating a dispatch, on our site?

For example, say the pilot input his SimBrief pilot ID into our site, and then a call to the SimBrief API could pull all his aircraft profile IDs – and make them also available for direct selection together with all the public ones.

I know that you can have the pilot query the internal aircraft profile ID in his simbrief aircraft profile editor, and provide that manually to our site, for the call for dispatch. But that is not as slick.

* Orest

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.