×

Developers

OnSong Connect

OnSong Connect is a REST-based API that runs on an OnSong device through an in-app web server. It provides tools to connect to a device running OnSong and then query its state, search songs and perform most other functions remotely.

Discovery

If you are building an application that uses OnSong Connect, you can discover devices on the network using multicast DNS, better known as Bonjour in macOS. Each web service broadcasts its IP address and information. OnSong Connect will broadcast the device's IP address, using the OnSong port number 5076, or a portless configuration. However, the port is not required and can be changed. This requires additional information to be queried to determine if the device is an OnSong Connect client or server.

Once you've resolved the address of the device you should also receive TXT record data. This can be extracted into a dictionary of values which contain:

  • model - the model of the device which is being used. This displays "iPad", "iPhone", "iPod touch", etc.
  • deviceid - A unique identifier of the device for determining individual devices.
  • version - The version of OnSong running on the device.
  • role - The role of the device. Can be either "client" or "server".

API Documentation

The API documentation is included in OnSong and can be accessed by tapping on your device in the servers list in the OnSong Connect screen. You can also access the current API by downloading the documentation.