Service URL

url method description
http://www.internetdj.com/developers/api.php GET or POST Submit your request to this url via GET or POST, passing the required and optional variables outlined below.

Service Inputs

Field Type Description
api_key required License key assigned to your account. Get your key.
format optional We output JSON by default and is currently the only output option. Can be set to:
  • json
request_type required This is the type of data you are requesting. Can be set to:
  • genre
  • artistsbygenre
  • songsbyartist
  • songsbygenre
  • top10today
  • sotd
  • song
  • top40week
genre_id optional After you retrieve the list of genres from the \"genre\" request type, you will have the genre IDs and can use them with the request types artistsbygenre and songsbygenre.
artist_id optional After you retrieve the list of artists from the "artistsbygenre" request type, you will have the artist IDs and can use them with the request types songsbyartist.

JSON: Service Outputs

Request Type Format Description and Output
genre array Array containing all top level and sub-genres. Sub-genres are linked to the top level genre by parent_genre_id. The data returned includes:
  • genre_id
  • genre_name
  • parent_genre_id
  • genre_url
artistsbygenre array Array containing all artists with metadata related to the genre ID passed. The data returned includes:
  • artist_id
  • artist_name
  • artist_url
  • artist_description
  • artist_country
songsbyartist array Array containing all songs with metadata related to the artist ID passed. The data returned includes:
  • song_id
  • song_title
  • song_url
  • song_audio_url
  • song_image_url
  • song_description
  • song_avg_rating
songsbygenre array Array containing last 100 songs uploaded with metadata related to the genre ID passed. The data returned includes:
  • artist_id
  • artist_name
  • song_id
  • song_title
  • song_url
  • song_audio_url
  • song_image_url
  • song_description
  • song_avg_rating
sotd array Array containing the current song of the day. The data returned includes:
  • artist_id
  • artist_name
  • song_id
  • song_title
  • song_url
  • song_audio_url
  • song_image_url
  • song_description
  • song_avg_rating

Code Samples

Here's an example of how to create a list of the top-level genres using JQuery & our JSON API. Replace API_KEY with your own.
<html>
  
  <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  </head>
  
  <body>
    <ul id="genres" data-role="listview"></ul>


    <script>
    $(document).ready(function(){
      $.getJSON("http://www.internetdj.com/developers/api.php?api_key=API_KEY&request_type=genre", function(genres){
        $.each(genres, function(i,genre) {
          if(genre.parent_genre_id=='0') {
            var s_gen=encodeURIComponent(genre.genre_name);
            $('#genres').append('<li>'+genre.genre_name+'</li>');
          }
        });
        $('#genres').listview('refresh');
      });

    });
    </script>
  </body>
</html>