2. 8tracks
• Simple way for people to share and
discover music
• A mix is a short playlist contains at least 8
tracks
• Listeners can stream the mix in a legal
radio style manner
3. Stratus
• Stratus is an API management service
• Front end to API (auth, security,
monitoring, etc)
• Recently launched
4. API
• Search and Play mixes
• Simple XML or JSON
• Register for a key at developer.8tracks.com
• Documentation available
5. Authentication
• Use your Access Key and Secret Key from
Stratus
• HTTP Basic Authentication
require 'Base64'
creds = "{accesskey}" + ':' + "{secretkey}"
puts 'Authorization: Basic ' + Base64::encode64(creds)
6. Search for mixes
http://api.8tracks.com/mixes.xml?q=miles+davis
<?xml version="1.0" encoding="UTF-8"?>
<response>
<logged-in type="boolean">false</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<mixes type="array">
<mix>
<description>Ten tracks including music by Charles Mingus, Charlie Parker and
Dave Brubeck Quartet.</description>
<first-published-at type="datetime">2009-09-17T21:36:33Z</first-published-at>
<flagged-for-review type="boolean">false</flagged-for-review>
<id type="integer">47967</id>
<name>Consider me Miles Davis</name>
...
7. Mix Information
http://api.8tracks.com/mixes/47967.xml
<mix>
<description>Ten tracks including music by Charles Mingus, Charlie Parker and
Dave Brubeck Quartet.</description>
<first-published-at type="datetime">2009-09-17T21:36:33Z</first-published-at>
<flagged-for-review type="boolean">false</flagged-for-review>
<id type="integer">47967</id>
<name>Consider me Miles Davis</name>
<plays-count type="integer">46</plays-count>
<published type="boolean">true</published>
<slug>consider-me-miles-davis</slug>
<tag-list-cache>jazz</tag-list-cache>
...
8. Playback
• Get a Play Token
• Call Play mix
• Play the media (mp3)
• Call Next or Skip