
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
musicxmatch-api
Advanced tools
A lightweight TypeScript wrapper for the Musixmatch API with automatic signature generation.
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
Took me 1 hr 28 mins 56 secs to build this package.
npm install musixmatch-api
pnpm install musixmatch-api
yarn add musixmatch-api
bun install musixmatch-api
Requires Node.js 16+
Here's how you can use the MusixMatchAPI
class to interact with the MusixMatch API:
import { MusixMatchAPI } from "musicxmatch-api";
const musixMatchAPI = new MusixMatchAPI();
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");
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();
This package is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
FAQs
A lightweight TypeScript wrapper for the Musixmatch API with automatic signature generation.
The npm package musicxmatch-api receives a total of 4 weekly downloads. As such, musicxmatch-api popularity was classified as not popular.
We found that musicxmatch-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.