Developers
The InternetDJ.com Developers portal allows you to integrate InternetDJ music, data and tools within your own platforms. Access to our APIs requires a key and queries are currently limited to 5000 per day.
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. Request your key. |
| format | optional | We output JSON by default and is currently the only output option. Can be set to:
|
| request_type | required | This is the type of data you are requesting. Can be set to:
|
| 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:
|
| artistsbygenre | array | Array containing all artists with metadata related to the genre ID passed. The data returned includes:
|
| songsbyartist | array | Array containing all songs with metadata related to the artist ID passed. The data returned includes:
|
| songsbygenre | array | Array containing last 100 songs uploaded with metadata related to the genre ID passed. The data returned includes:
|
| sotd | array | Array containing the current song of the day. The data returned includes:
|
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>

