npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

musicxmatch-api

v1.0.1

Published

A lightweight TypeScript wrapper for the Musixmatch API with automatic signature generation.

Downloads

10

Readme

🎵 Musixmatch API

musicxmatch-api is an npm package that provides easy access to MusixMatch API endpoints. It supports searching tracks, getting track details, lyrics, artists, albums, and more. This package handles the necessary signing and authentication required by MusixMatch.

Time I spent on this project so far wakatime

Took me 1 hr 28 mins 56 secs to build this package. image

✨ Features

  • Fetch lyrics, tracks, albums, and artists
  • Automatically fetches app signature from Musixmatch
  • Proxy support built-in (currently not used internally)
  • Fully typed (TypeScript support)

📦 Installation

npm install musixmatch-api
pnpm install musixmatch-api
yarn add musixmatch-api
bun install musixmatch-api

Requires Node.js 16+

Usage

Here's how you can use the MusixMatchAPI class to interact with the MusixMatch API:

Importing the Package

import { MusixMatchAPI } from "musicxmatch-api";

Creating an Instance

const musixMatchAPI = new MusixMatchAPI();

Available Methods

searchTracks(options: { query?: string; track?: string; artist?: string; page: number; }): Promise<SearchTracksResponse>

Search for tracks based on the provided options.

const tracks = await musixMatchAPI.searchTracks({
  query: "love",
  track: "Shape of You",
  artist: "Ed Sheeran",
  page: 1,
});

getTrack(trackId?: string | null, trackIsrc?: string | null): Promise<GetTrackResponse>

Get track details by track ID or ISRC.

const track = await musixMatchAPI.getTrack("123456");

getTrackLyrics(trackId?: string | null, trackIsrc?: string | null): Promise<GetLyricsResponse>

Get lyrics of a track by track ID or ISRC.

const lyrics = await musixMatchAPI.getTrackLyrics("123456");

searchArtist(query: string, page?: number): Promise<SearchArtistsResponse>

Search for artists by name.

const artist = await musixMatchAPI.searchArtist("Queen");

getArtist(artistId: string): Promise<GetArtistResponse>

Get artist details by artist ID.

const artist = await musixMatchAPI.getArtist("118");

getArtistAlbums(artistId: string, page?: number): Promise<GetArtistAlbumsResponse>

Get albums of an artist by artist ID.

const albums = await musixMatchAPI.getArtistAlbums("118");

getAlbum(albumId: string): Promise<GetAlbumResponse>

Get album details by album ID.

const album = await musixMatchAPI.getAlbum("32541950");

getAlbumTracks(albumId: string, page?: number): Promise<GetAlbumTracksResponse>

Get tracks of an album by album ID.

const tracks = await musixMatchAPI.getAlbumTracks("32541950");

getTrackLyricsTranslation(trackId: string, language: string): Promise<GetTrackLyricsTranslationResponse>

Get lyrics translation of a track by track ID and language.

const translation = await musixMatchAPI.getTrackLyricsTranslation("123456", "es");

rawRequest(endpoint: string): Promise<any>

Make a raw request to any MusixMatch API endpoint.

const response = await musixMatchAPI.rawRequest("track.get?app_id=community-app-v1.0&format=json&track_id=123456");

Example

import { MusixMatchAPI } from "musicxmatch-api";

const musixMatchAPI = new MusixMatchAPI();

async function fetchTrackDetails() {
  try {
    const track = await musixMatchAPI.getTrack("123456");
    console.log(track);
  } catch (error) {
    console.error("Error fetching track details:", error);
  }
}

fetchTrackDetails();

License

This package is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.