This project aims to provide an OpenAPI 3 specification for the ListenBrainz API.
The specification is split up in multiple folders and files. Here is an overview of the folders:
.
├── components # holds data models
│ ├── art
│ ├── common
│ ├── core
│ ├── metadata
│ ├── playlists
│ ├── popularity
│ ├── recommendations
│ ├── recordings
│ ├── social
│ └── stats
└── paths # holds API endpoints
├── art
├── core
├── metadata
├── misc
├── playlists
├── popularity
├── recommendations
├── recordings
├── social
└── stats
For each category of the ListenBrainz API, there is a folder under components
and paths
.
components
contains the data models and paths
the API endpoints.
On top sits the lb.yaml
which holds everything together.
Even if the goal is to include every endpoint in this specification, some things are missing:
/1/playlist/(playlist_mbid)/xspf
/1/playlist/(playlist_mbid)/export/(service)
/1/playlist/import/(service)
/1/playlist/(service)/(playlist_id)/tracks
/1/playlist/export-jspf/(service)
/1/feedback/import
Client code for the API can be generated with the OpenAPI Generator.
To generate a Java client:
openapi-generator generate -g java -i ./lb.yaml -o ./output/ -c config.json
To set and validate the ListenBrainz user token:
LbCoreApi core = new LbCoreApi();
core.getApiClient().setApiKey("Token mySecretToken");
core.validateToken().execute()
Contributing is welcome!