Local API

Use the power of the Lexicon Local API to connect other apps or services in no time.

Lexicon has an API that other applications can use to get data out of Lexicon. You can get almost anything out of Lexicon, like your tracks, playlists, cues, beatgrids, tags, etc.

You can also directly query the Lexicon SQLite database, but it is not recommended to do so. You may run into locking issues while Lexicon is running, and you will have to join your own data. Unless you have a very specific use-case, you should always use the API first.

Every endpoint is documented in the API Reference at the bottom of this page: tracks and searching, playlists, Custom Tags, playback control, and what is currently playing or queued.

Enabling the API

The Lexicon Local API is a REST API that you can send requests to as long as Lexicon is running.

The API is disabled by default. You can enable the API in the Lexicon settings under Integrations.

Authentication

There is currently no authentication for the API, but this will change in the future.

Network access

The API listens on every network interface, not only on localhost. Any device that can reach your computer on port 48624, such as anything else on the same Wi-Fi, can read and modify your whole library without a password. The API also accepts requests from any website open in your browser.

Only enable the API on networks you trust, and switch it off in the Lexicon settings when you are not using it. Be especially careful on shared networks such as a venue, hotel or festival.

Parameters

All query parameters can also be sent as a JSON body, even for GET requests. It does not work the other way around: only GET requests read the query string, so POST, PATCH and DELETE requests need a JSON body.

Query string parameter arrays and objects are in the following form:

Array: /tracks?fields=title&fields=artist

Object: /search/tracks?filter[artist]=Daft%20Punk&filter[title]=Touch

Array of objects, as URL-encoded JSON: /tracks?sort=[{"field":"title","dir":"asc"}]
or in bracket form: /tracks?sort[0][field]=title&sort[0][dir]=asc

Errors

A request that fails returns a JSON body with a message and an errorCode, usually with HTTP status 400. All error codes are listed under the Error schema in the API Reference.

The API handles one request at a time. Wait for the response before you send the next request, otherwise it fails with error code 2.

Getting started

You will find the API on your own computer at http://localhost:48624. From another device on the same network, use that computer's IP address instead of localhost.

After enabling the API in the Lexicon settings, you can test this by sending a simple request: GET: http://localhost:48624/v1/tracks
With the following query string parameters or JSON body:

{
  "limit": 10,
  "offset": 0
}

This will return the first 10 tracks of your library. That is one of many endpoints, so have a look at the API Reference below for the rest.

Need help or have feedback?

You can get help or share your feedback or project with other Lexicon users on the forum or on Discord.

Missing something in the API? Let us know!

API Reference