Simple integrate of API musixmatch.com with python

Overview

Python Musixmatch

Simple integrate of API musixmatch.com with python

Github Issues MIT licensed

Logo

Quick start

$ pip install pymusixmatch

or

$ python setup.py install

Authentication

Register for an API key:

All you need to do is register in order to get your API key, a mandatory parameter for most of our API calls. It’s your personal identifier and should be kept secret.

Usage

With your key in hand, it's time to authenticate, so run:

>>> from musixmatch import Musixmatch

>>> musixmatch = Musixmatch('<apikey>')

Chart Artists Get

This api provides you the list of the top artists of a given country.

Parameters:

  • country - A valid country code (default US).
  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range 1 - 100).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.chart_artists(1, 1)

Chart Tracks Get

This api provides you the list of the top songs of a given country.

Parameters:

  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range 1 - 100).
  • f_has_lyrics - When set, filter only contents with lyrics.
  • country - A valid country code (default US).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.chart_tracks_get(1, 1)

Chart Tracks Get

Search for track in our database.

Parameters:

  • q_track - The song title
  • q_artist - The song artist
  • q_lyrics - Any word in the lyrics
  • f_artist_id - When set, filter by this artist id
  • f_music_genre_id - When set, filter by this music category id
  • f_lyrics_language - Filter by the lyrics language (en,it,..)
  • f_has_lyrics - When set, filter only contents with lyrics
  • f_track_release_group_first_release_date_min - When set, filter the tracks with release date newer than value, format is YYYYMMDD
  • f_track_release_group_first_release_date_max - When set, filter the tracks with release date older than value, format is YYYYMMDD
  • s_artist_rating - Sort by our popularity index for artists (asc|desc)
  • s_track_rating - Sort by our popularity index for tracks (asc|desc)
  • quorum_factor - Search only a part of the given query string.Allowed range is (0.1 – 0.9)
  • page - Define the page number for paginated results
  • page_size - Define the page size for paginated results. Range is 1 to 100.
  • callback - jsonp callback
  • format - Decide the output type (json or xml)
>>> musixmatch.track_search(q_artist='twentyonepilots', page_size=10, page=1, s_track_rating='desc')

Track Get

Get a track info from our database: title, artist, instrumental flag and cover art.

Parameters:

  • track_id - The musiXmatch track id.
  • commontrack_id - The musiXmatch commontrack id.
  • track_isrc - A valid ISRC identifier.
  • track_mbid - The musicbrainz recording id.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_get(15445219)

Track Lyrics Get

Get the lyrics of a track.

Parameters:

  • track_id - The musiXmatch track id.
  • track_mbid - The musicbrainz recording id.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_lyrics_get(15953433)

Track Snippet Get

Get the snippet for a given track.

A lyrics snippet is a very short representation of a song lyrics. It’s usually twenty to a hundred characters long and it’s calculated extracting a sequence of words from the lyrics.

Parameters:

  • track_id - The musiXmatch track id.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_snippet_get(16860631)

Track Snippet Get

Retreive the subtitle of a track.

Return the subtitle of a track in LRC or DFXP format. Refer to Wikipedia LRC format page or DFXP format on W3c for format specifications.

Parameters:

  • track_id - The musiXmatch track id.
  • track_mbid - The musicbrainz track id.
  • subtitle_format - The format of the subtitle (lrc,dfxp,stledu). Default to lrc.
  • f_subtitle_length - The desired length of the subtitle (seconds).
  • f_subtitle_length_max_deviation - The maximum deviation allowed from the f_subtitle_length (seconds).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_subtitle_get(14201829)

Track Richsync Get

Get the Rich sync for a track.

A rich sync is an enhanced version of the standard sync which allows:

  • position offset by single characther.
  • endless formatting options at single char level.
  • multiple concurrent voices.
  • multiple scrolling direction.

Parameters:

  • track_id - The musiXmatch track id.
  • f_sync_length - The desired length of the sync (seconds).
  • f_sync_length_max_deviation - The maximum deviation allowed.
  • from the f_sync_length (seconds).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_richsync_get(14201829)

Track Lyrics Post

Submit a lyrics to our database.

It may happen we don’t have the lyrics for a song, you can ask your users to help us sending the missing lyrics. We’ll validate every submission and in case, make it available through our api.

Please take all the necessary precautions to avoid users or automatic software to use your website/app to use this commands, a captcha solution like http://www.google.com/recaptcha or an equivalent one has to be implemented in every user interaction that ends in a POST operation on the musixmatch api.

Parameters:

  • track_i - dA valid country code (default US).
  • lyrics_body - The lyrics.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.track_lyrics_post(1471157, 'test')

Track Lyrics Post

This API method provides you the opportunity to help us improving our catalogue.

We aim to provide you with the best quality service imaginable, so we are especially interested in your detailed feedback to help us to continually improve it.

Please take all the necessary precautions to avoid users or automatic software to use your website/app to use this commands, a captcha solution like http://www.google.com/recaptcha or an equivalent one has to be implemented in every user interaction that ends in a POST operation on the musixmatch api.

Parameters:

  • lyrics_id - The musiXmatch lyrics id.
  • track_id - The musiXmatch track id.
  • feedback - The feedback to be reported, possible values are: wrong_lyrics, wrong_attribution, bad_characters,
  • lines_too_long, wrong_verses, wrong_formatting
  • format - Decide the output type json or xml (default json)
>>> musixmatch.track_lyrics_feedback_post(1471157, 4193713, 'wrong_verses')

Matcher Lyrics Get

Get the lyrics for track based on title and artist.

Parameters:

  • q_track - The song title
  • q_artist - The song artist
  • track_isrc - If you have an available isrc id in your catalogue you can query using this id only (optional)
  • format - Decide the output type json or xml (default json)
>>> musixmatch.matcher_lyrics_get('Sexy and I know it', 'LMFAO')

Matcher Track Get

Match your song against our database.

In some cases you already have some informations about the track title, artist name, album etc. A possible strategy to get the corresponding lyrics could be:

  • search our catalogue with a perfect match,
  • maybe try using the fuzzy search,
  • maybe try again using artist aliases, and so on.

The matcher.track.get method does all the job for you in a single call. This way you dont’t need to worry about the details, and you’ll get instant benefits for your application without changing a row in your code, while we take care of improving the implementation behind. Cool, uh?

Parameters:

  • q_track - The song title.
  • q_artist - The song artist.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.matcher_track_get('Lose Yourself (soundtrack)', 'Eminem')

Matcher Subtitle Get

You can use the f_subtitle_length_max_deviation to fetch subtitles within a given duration range.

Parameters:

  • q_track - The song title
  • q_artist - The song artist
  • f_subtitle_length - Filter by subtitle length in seconds
  • f_subtitle_length_max_deviation - Max deviation for a subtitle length in seconds
  • track_isrc - If you have an available isrc id in your catalogue you can query using this id only (optional)
  • format - Decide the output type json or xml (default json)

Note: This method requires a commercial plan.

>>> musixmatch.matcher_subtitle_get('Sexy and I know it', 'LMFAO', 200, 3)

Artist Get

Get the artist data from our database.

Parameters:

  • artist_id - Musixmatch artist id
  • artist_mbid - Musicbrainz artist id
  • format - Decide the output type json or xml (default json)
>>> musixmatch.artist_get(118)

Artist Search

Search for artists in our database.

Parameters:

  • q_artist - The song artist.
  • f_artist_id - When set, filter by this artist id.
  • f_artist_mbid - When set, filter by this artist musicbrainz id.
  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range is 1 to 100).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.artist_search('prodigy', 1, 1, 16439, '4a4ee089-93b1-4470-af9a-6ff575d32704')

Artist Album Get

Get the album discography of an artist.

Parameters:

  • artist_id - Musixmatch artist id.
  • artist_mbid - Musicbrainz artist id.
  • g_album_name - Group by Album Name.
  • s_release_date - Sort by release date (asc|desc).
  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range is 1 to 100).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.artist_albums_get(1039, 1, 1, 1, 'desc')

Artist Related Get

Get a list of artists somehow related to a given one.

Parameters:

  • artist_id - Musixmatch artist id.
  • artist_mbid - Musicbrainz artist id.
  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range is 1 to 100).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.artist_related_get(56, 1, 1)

Album Get

Get an album from our database: name, release_date, release_type, cover art.

Parameters:

  • album_id - The musiXmatch album id
  • format - Decide the output type json or xml (default json).
>>> musixmatch.album_get(14250417)

Album Tracks Get

This api provides you the list of the songs of an album.

Parameters:

  • album_id - Musixmatch album id.
  • album_mbid - Musicbrainz album id.
  • f_has_lyrics - When set, filter only contents with lyrics.
  • page - Define the page number for paginated results.
  • page_size - Define the page size for paginated results (range is 1 to 100).
  • format - Decide the output type json or xml (default json).
>>> musixmatch.album_tracks_get(13750844, 1, 1, '')

Tracking Url Get

Get the base url for the tracking script

With this api you’ll be able to get the base url for the tracking script you need to insert in your page to legalize your existent lyrics library.

Read more here: rights-clearance-on-your-existing-catalog

In case you’re fetching the lyrics by the musiXmatch api called track.lyrics.get you don’t need to implement this API call.

Parameters:

  • domain - Your domain name.
  • format - Decide the output type json or xml (default json).
>>> musixmatch.album_tracks_get(13750844, 1, 1, '')

Catalogue Dump Get

Get the list of our songs with the lyrics last updated information

CATALOGUE_COMMONTRACKS

Dump of our catalogue in this format:

{
    "track_name": "Shape of you",
    "artist_name": "Ed Sheeran",
	"commontrack_id": 12075763,
    "instrumental": false,
    "has_lyrics": yes,
    "updated_time": "2013-04-08T09:28:40Z"
}

Note: This method requires a commercial plan.

>>> musixmatch.catalogue_dump_get('test')

Features

Dependencies

License

MIT

Owner
Hudson Brendon
Backend Engineer
Hudson Brendon
Huggingface inference with GPU Docker on AWS

This repository contains code to containerize and deploy a GPU docker on AWS for summarization task. Find a detailed blogpost here Youtube Video Versi

Ramsri Goutham Golla 21 Dec 30, 2022
A community made discord bot coded in Python and running on AWS.

Pogbot Project Open Group Discord This is an open source community ran project. Join the discord for more information on how to participate. Coded in

Project Open Group 2 Jul 27, 2022
Generates a coverage badge using coverage.py and the shields.io service.

Welcome to README Coverage Badger 👋 Generates a coverage badge using coverage.py and the shields.io service. Your README file is then updated with th

Victor Miti 10 Dec 06, 2022
Pythonic and easy iCalendar library (rfc5545)

ics.py 0.8.0-dev : iCalendar for Humans Original repository (GitHub) - Bugtracker and issues (GitHub) - PyPi package (ics) - Documentation (Read The D

ics.py 513 Jan 02, 2023
微信支付接口V3版python库

wechatpayv3 介绍 微信支付接口V3版python库。 适用对象 wechatpayv3支持微信支付直连商户,接口说明详见 官网。 特性 平台证书自动更新,无需开发者关注平台证书有效性,无需手动下载更新; 支持本地缓存平台证书,初始化时指定平台证书保存目录即可。 适配进度 微信支付V3版A

chen gang 258 Jan 06, 2023
Get some python in google cloud functions

[NOTE]: This is a highly experimental (and proof of concept) library so do not expect all python packages to work flawlessly. Also, cloud functions ar

Martin Abelson Sahlen 200 Nov 24, 2022
Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Alberto Ortega 25 Nov 26, 2022
Discord Token Generator based on HTTPX, makes unverified tokens and automatically joins your server! this is used for memberboosting

Discord Token Generator | 2021 Features: (1) hCaptcha Bypasser, latest hfuck.py Updated by me (2) Free Proxy Support/Scrapper (3) Custom Realistic Dat

2 Nov 30, 2021
This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

RwinShow 57 Dec 18, 2022
Powerful spammer bots for telegram made with python and telethon.

Powerful spammer bots for telegram made with python and telethon. We can deploy upto 70 bots at a time.

32 Dec 15, 2022
A discord.py code generator program. Compatible with both linux and windows.

Astro-Cord A discord.py code generator program. Compatible with both linux and windows. About This is a program made to make discord.py bot developmen

Astro Inc. 2 Dec 23, 2021
Find Roblox Groups & Send To Discord

Roblox-Group-Finder A tool to help you find ownerless roblox groups :) It's really easy, all you need is a discord webhook :) It will not send locked

1 Dec 13, 2021
Discord Streaming Statut (Bot/SelfBot)

Discord-Streaming-Status Discord Streaming Status For Both User Accounts And Bot Accounts. Open your cmd and enter the command: pip install discord BE

Komuro 2 Nov 02, 2021
A MassDM selfbot which is working in 2021

mass-dm-discord - Little preview of the Logger and the Spammer Features Logging User IDS Sending DMs to the logged IDs Blacklist IDs (add the ID of th

karma.meme 88 Dec 26, 2022
Git Plan - a better workflow for git

git plan A better workflow for git. Git plan inverts the git workflow so that you can write your commit message first, before you start writing code.

Rory Byrne 178 Dec 11, 2022
Tracks twitter spaces and sends it to a discord webhook.

Tracks twitter spaces and sends it to a discord webhook. Uses the twitter api to find twitter spaces and then the m3u8 url for the space is found using selenium and will have it posted using a discor

Sam Phung 20 Dec 17, 2022
Automated AWS account hardening with AWS Control Tower and AWS Step Functions

Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean

AWS Samples 20 Dec 07, 2022
Event-driven-model-serving - Unified API of Apache Kafka and Google PubSub

event-driven-model-serving Unified API of Apache Kafka and Google PubSub 1. Proj

Danny Toeun Kim 4 Sep 23, 2022
A discord self-bot to automate shitposting for your everyday needs.

Shitpost Selfbot A discord self-bot to automate shitposting for your everyday needs. Caution: May be a little racist. I have no clue where we are taki

stormy 1 Mar 31, 2022
Cloudshell-sandbox-reporter - Helper modules and classes for writing to Cloudshell sandbox console

Cloudshell Sandbox Reporter This project provides utility classes for formatting

QualiLab 2 Sep 07, 2022