WebSocket endpoint

Mopidy has a WebSocket endpoint at /mopidy/ws. You can use this endpoint to access Mopidy's full API, and to get notified about events happening in Mopidy.
More info

HTTP POST RPC endpoint

Mopidy has a non-WebSocket API endpoint at /mopidy/rpc. You can use this endpoint to access Mopidy's full API. While you can't listen to events via this endpoint, it doesn't require maintaining a persistent connection.
More info

JavaScript API

Mopidy.js is an official library that provides full access to the JSON-RPC API via the WebSocket endpoint. For Mopidy extensions, it will automatically connect to the WebSocket endpoint with no constructor arguments. The examples on this page initiate a connection using the following script:

window.mopidy = new Mopidy();

More info can be found at the Mopidy.js documentation