8tracks api presentation

13
8tracks Developers API Richard Caetano 8tracks.com/arsy [email protected]

Upload: david-porter

Post on 26-Jan-2015

104 views

Category:

Entertainment & Humor


0 download

DESCRIPTION

Presentation of the 8tracks playback API by Rich Caetano at Music Hack Day on Nov 21st, 2009.

TRANSCRIPT

Page 1: 8tracks API presentation

8tracks Developers APIRichard Caetano8tracks.com/arsy

[email protected]

Page 2: 8tracks API presentation

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

Page 3: 8tracks API presentation

Stratus

• Stratus is an API management service

• Front end to API (auth, security, monitoring, etc)

• Recently launched

Page 4: 8tracks API presentation

API

• Search and Play mixes

• Simple XML or JSON

• Register for a key at developer.8tracks.com

• Documentation available

Page 5: 8tracks API presentation

Authentication

• Use your Access Key and Secret Key from Stratus

• HTTP Basic Authentication

require 'Base64'creds = "{accesskey}" + ':' + "{secretkey}"puts 'Authorization: Basic ' + Base64::encode64(creds)

Page 6: 8tracks API presentation

Search for mixeshttp://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>

...

Page 7: 8tracks API presentation

Mix Informationhttp://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>

...

Page 8: 8tracks API presentation

Playback

• Get a Play Token

• Call Play mix

• Play the media (mp3)

• Call Next or Skip

Page 9: 8tracks API presentation

Play Tokenhttp://api.8tracks.com/sets/new.xml

<?xml version="1.0" encoding="UTF-8"?><response> <logged-in type="boolean">false</logged-in> <status>200 OK</status> <play-token>570329908</play-token> <errors nil="true"></errors> <notices nil="true"></notices></response>

Page 10: 8tracks API presentation

Play Mix

http://api.8tracks.com/sets/570329908/play.xml?mix_id=47067

<track> <djName>jaguarshark9</djName> <is-fav type="boolean">false</is-fav> <item>http://8tracks.s3.amazonaws.com/tf/000/003/020/01_So_What_54122904b931a7814659.mp3</item> <mixName>Consider me Miles Davis</mixName> <album>Kind of Blue</album> <year type="integer">1959</year> <duration type="integer">0</duration> <title>So What</title> <mixDescription>Ten tracks including music by Charles Mingus,...</mixDescription> <trackId type="integer">3020</trackId> <price></price> <referenceUrl>http://8tracks.com/jaguarshark9/consider-me-miles-davis</referenceUrl> <contributor>Miles Davis</contributor> <photo>http://cf3.8tracks.us/mix_covers/000/047/967/6983186934.sq56.jpg</photo> <allowSkip>true</allowSkip> </track>

Page 11: 8tracks API presentation

Next or Skip

http://api.8tracks.com/sets/570329908/next.xml?mix_id=47067

http://api.8tracks.com/sets/570329908/skip.xml?mix_id=47067

Page 12: 8tracks API presentation

Ideas

• SoundManager Javascript

• Twitter Player

• Genre Player / Music Stations

• Firefox Player

Page 13: 8tracks API presentation

iPhone Demo