# Koito

Koito is a scrobbler. It sits behind whatever you actually play music with, records every track that gets played, and turns that stream of events into something worth looking at: top artists, top albums, listening hours, and a history you can scroll back through.

It speaks the ListenBrainz API, which is the useful part. Anything that can scrobble to ListenBrainz can scrobble to Koito instead, and that covers [Navidrome](</app/navidrome/>), most Android and iOS music players, and the desktop bridges people use for Spotify and Apple Music. Nothing needs to know Koito exists by name.

[Get a 7-day trial of ElfHosted Koito! 🪄](<https://store.elfhosted.com/product/koito/>)

## How do I access Koito?

Koito is available:

- From your dashboard: [https://your-username.elfhosted.com](<https://your-username.elfhosted.com>)
- Directly: [https://your-username-koito.elfhosted.com](<https://your-username-koito.elfhosted.com>)

> [!NOTE]
>
> **Signed-in users see their own URLs**
>
> The addresses above show the general pattern. [Sign in](<https://docs-internal.elfhosted.com/app/koito/>) and these become your personal, clickable links.

## Why would I want this?

- **Your history stops belonging to somebody else.** Last.fm has your listening data going back years and can decide tomorrow what you may do with it. Koito keeps the same data where you can export it.
- **It runs alongside your existing scrobbler, not instead of it.** Koito can relay everything it receives on to Last.fm or ListenBrainz, so you can run it for a few months and lose nothing if you decide it is not for you.
- **It brings your old history with it.** Imports work from Spotify, Last.fm, ListenBrainz and Maloja, so you start with your full history rather than an empty page.

## First login

Koito ships with a starting account of `elfie` / `changemeelfie`. Change the password from the **Account** tab in Koito's settings the first time you sign in.

Your ElfHosted login already stands in front of the Koito web interface, so this second password is not what keeps strangers out. It is what protects your **API Keys** page, and that key is the one thing worth guarding: anyone holding it can write listens into your history.

## Getting your API key

Press ++backslash++ (or click the settings icon), sign in on the **Account** tab, then open the **API Keys** tab. The key shown there is what every scrobble client authenticates with.

## Scrobbling from Navidrome

Point [Navidrome](</app/navidrome/>) at Koito with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Replace `<domain>` with the domain in your dashboard's address (*for example `elfhosted.com`*).

Quick-paste into Navidrome's environment variables using ElfBot

```
ND_LISTENBRAINZ_ENABLED=true
ND_LISTENBRAINZ_BASEURL=https://<your username>-koito.<domain>/apis/listenbrainz/1
```

Then in Navidrome, open **Settings**, then **Personal**, and turn on **Scrobble to ListenBrainz**. It will ask for a token: paste in your Koito API key.

## Scrobbling from a phone or desktop

Any ListenBrainz-compatible client works the same way. Give it:

| Setting | Value |
| --- | --- |
| API URL | `https://<your username>-koito.<domain>/apis/listenbrainz/1` |
| Token | Your Koito API key |

Some clients want the address without the trailing `/1`. If a client rejects the URL above, try it without.

The scrobble endpoint is reachable without an ElfHosted login, because a phone cannot complete a browser sign-in. It is protected by your API key instead, and rejects anything that does not carry one. Everything else, including the page that shows you that key, stays behind your ElfHosted login.

## Showing album art

Koito can pull artwork from your [Navidrome](</app/navidrome/>) library rather than the internet. Set these with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Koito's environment variables using ElfBot

```
KOITO_SUBSONIC_URL=https://<your username>-navidrome.<domain>
KOITO_SUBSONIC_PARAMS=u=<navidrome user>&t=<token>&s=<salt>
```

The three parameters come out of any authenticated Navidrome request. Open Navidrome in a browser, press ++f12++, look at the **Network** tab, and copy them from the query string of a `getCoverArt` call.

> [!WARNING]
>
> **Koito refuses to start if these are wrong**
>
> Koito validates the Subsonic settings during startup and exits if they fail. If Koito stops coming up after you set these, that is why. Clear them with ElfBot and it will start again.

## Importing your history

Koito reads import files from `import` inside its config folder, and picks them up when it next starts.

1. Get your export: [Spotify](<https://www.spotify.com/us/account/privacy/>), [Last.fm via ghan.nl](<https://lastfm.ghan.nl/export/>), [ListenBrainz](<https://listenbrainz.org/settings/export/>), or the `Export` button on another Maloja instance.
2. Copy the file into `/storage/config/koito/import/` using [FileBrowser](</app/filebrowser/>).
3. Restart Koito from [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>). The import starts on its own.

The filename matters, because that is how Koito decides which format it is looking at. Keep `Streaming_History_Audio` in Spotify filenames, `recenttracks` for Last.fm, `listenbrainz` for ListenBrainz, and `maloja` for Maloja.

> [!TIP]
>
> **Large imports take a while**
>
> Every unfamiliar artist means a MusicBrainz lookup, and those are rate limited to one per second, by MusicBrainz and not by us. A decade of Last.fm history can take hours. It runs in the background and you can use Koito while it works.

## Relaying to Last.fm or ListenBrainz

If you are not ready to leave your existing scrobbler, Koito will forward everything it receives to another ListenBrainz-compatible server. Set this with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Koito's environment variables using ElfBot

```
KOITO_ENABLE_LBZ_RELAY=true
KOITO_LBZ_RELAY_URL=https://api.listenbrainz.org/1
KOITO_LBZ_RELAY_TOKEN=<your listenbrainz token>
```

Restart Koito afterwards. The relay URL needs the full path to the other server's endpoint, not just its hostname.

## Koito or Maloja?

Both record the same thing. [Maloja](</app/maloja/>) is the older and steadier of the two, speaks more scrobble dialects, and has a plainer interface. Koito is the newer one, is faster with a large history, and looks considerably better.

Koito's own author describes the project as unstable and still moving, so expect the occasional rough edge on upgrade. If that matters more to you than the interface does, run [Maloja](</app/maloja/>) instead. Both can import from the other, so the choice is not permanent.

## Koito also works with

- [x] [Navidrome](</app/navidrome/>)
- [x] [Lidarr](</app/lidarr/>)
- [x] [Maloja](</app/maloja/>)

## How do I get support for Koito?

1. For general use of Koito, refer to the [official site](<https://github.com/gabehf/Koito>) or to one of the links in the resources section below.
2. For specific support re your ElfHosted configuration / account, see the [ElfHosted support options](</get-help/>)!

## Sponsor Koito ❤️

You can contribute directly to the development of Koito using the following:

- [Ko-Fi](<https://ko-fi.com/gabehf>)

## Koito resources

- [Koito (*official site*)](<https://github.com/gabehf/Koito>)
- [Koito Documentation](<https://koito.io>)
