Rights clearance on your existing catalog

Are you already running a web site with an existing catalog?
Great. We have implemented a fast and simple method to grant you the legal clearance of rights for your site, even before you migrate to a full musiXmatch API integration.

In order to accomplish this and have the lyrics views of your catalog accurately tracked you need to insert a script into your page code. The script URL is made of three parts:

  • The base url
    You can obtain your base url for each of your existing domains using our api tracking.url.get
    This operation may be performed just once for the lifetime of your implementation, but for security reason we suggest you to run it on a daily or monthly basis.

  • The parameters
    To the base URL you need to append the track_name and the artist_name of the lyrics as GET parameters.

  • The signature
    The signature: Calculate the md5 of this URL+apikey and add it as the “s” parameter.

Examples

Suppose you are running a website named www.mylyricswebsite.com and your api key is 5f423b7772a80f77438407c8b78ff305

  • The base url

    First of all you need a base URL which you can get using the tracking.url.get api

    http://api.musixmatch.com/ws/1.1/tracking.url.get?apikey=5f423b7772a80f77438407c8b78ff305&format=json&domain=www.mylyricswebsite.com

    Good! My base URL is http://tracking.musixmatch.com/t1.0/a1b2c3d4e5f6g7/

  • Parameters

    Now for every lyrics page you need to add the parameters track_name and artist_name.
    In case you are generating the page for Katy Perry Hot N Cold you have:

    http://tracking.musixmatch.com/t1.0/a1b2c3d4e5f6g7/?artist_name=katy%20perry%20&track_name=hot%20n%20cold

  • The signature

    s=md5("http://tracking.musixmatch.com/t1.0/a1b2c3d4e5f6g7/?artist_name=katy%20perry%20&track_name=hot%20n%20cold"+"5f423b7772a80f77438407c8b78ff305")
  • Your final url is:

    http://tracking.musixmatch.com/t1.0/a1b2c3d4e5f6g7/?artist_name=katy%20perry%20&track_name=hot%20n%20cold&s=131079fe6e7cfd2388099ff80cb77f19

Now insert the URL as a script tag like


<script type="text/javascript" src="http://tracking...."></script>

PHP code


$track_name   = "Hot N Cold";
$artist_name  = "Katy Perry";
$base_url     = "http://tracking.musixmatch.com/t1.0/a1b2c3d4e5f6g7/";
$api_key      = "5f423b7772a80f77438407c8b78ff305";
$tracking_url = $base_url.'?artist_name='.urlencode($artist_name).'&track_name='.urlencode($track_name);
$signature    = md5($tracking_url.$api_key);
$tracking_url.='&s='.$signature;


</div>