import { ListenBrainzClient } from "https://deno.land/x/listenbrainz@v0.8.1/mod.ts";
ListenBrainz API client to submit listens and request data.
You have to specify a user token which you can obtain from your settings.
Examples
Example 1
Example 1
const client = new ListenBrainzClient({ userToken: Deno.env.get("LB_TOKEN") });
await client.playingNow({ artist_name: "John Doe", track_name: "Love Song" });
Constructors
Methods
Deletes a particular listen from a user’s listen history.
The listen is not deleted immediately, but is scheduled for deletion, which usually happens shortly after the hour.
Fetches JSON data from the given GET
endpoint.
This method should only be directly called for unsupported endpoints.
Gets the number of listens for the given user.
Gets listens for the given user.
If no options are given, the most recent listens will be returned.
The optional max_ts
and min_ts
timestamps control at which point in
time to start or stop returning listens.
Listens are always returned in descending timestamp order.
Gets the listen being played right now for the given user.
Submits a playing now notification for the given track.
Sends the given JSON data to the given POST
endpoint.
This method should only be directly called for unsupported endpoints.
Searches a ListenBrainz-registered user and returns a list of names.
Checks whether the client’s user token is valid.