The API is one way.
However, there's a much easier way:
Go to Systems Manager > Software.
Here you'll find all the software installed across every device
In the search, type System which will bring up Systems Manager, devices and versions
Click CSV and open...