The MIDIInputMap read-only interface of the Web MIDI API provides the set of MIDI input ports that are currently available. Available only in secure contexts.
MIDIInputMap
MDN Reference