API Reference - acm-uiuc/beats GitHub Wiki

All POST endpoints require token form data.

POST /v1/player/play_next

Skip song.

POST /v1/player/pause

Pause song.

POST /v1/player/volume

vol: int between 0 and 100

Change volume.

GET /v1/songs/<song_id>

Get info about song with id song_id.

GET /v1/songs/search

q: search query

Search for songs.

GET /v1/songs/random

limit: (Default: 20) number of songs to get

Get random songs.

GET /v1/songs/history

limit: (Default: 20) number of songs to get

Get play history.

GET /v1/songs/top_songs

limit: (Default: 20) number of songs to get

Get top played songs, sorted by play count descending.

GET /v1/songs/top_artists

limit: (Default: 20) number of artists to get

GET /v1/queue

user: NetID of logged-in user, used to set has_voted flag.

Get queue.

{
  "queue": [
    {
      "artist": "YouTube video", 
      "length": 741.0, 
      "packet": {
        "has_voted": false, 
        "num_votes": 1, 
        "user": "bezault2"
      }, 
      "title": "Neko Case: NPR Music Tiny Desk Concert", 
      "url": "https://www.youtube.com/watch?v=FwRcPEg1MyE"
    }, 
    {
      "artist": "YouTube video", 
      "length": 1069.0, 
      "packet": {
        "has_voted": false, 
        "num_votes": 1, 
        "user": "bezault2"
      }, 
      "title": "Iron And Wine: NPR Music Tiny Desk Concert:", 
      "url": "https://www.youtube.com/watch?v=6nT911jkWEo"
    }
  ]
}

DELETE /v1/queue/<int:song_id>

Remove the song with id song_id from the queue. (I wrote this?)

DELETE /v1/queue

Clear the queue. (I wrote this?!?!)

POST /v1/queue/add

  • id id of song to add, OR
  • url URL of YouTube video to add

Add a song to the queue.

GET /v1/now_playing

Get the currently playing song.

{
  "media": {
    "artist": "YouTube video", 
    "length": 741.0, 
    "title": "Neko Case: NPR Music Tiny Desk Concert", 
    "url": "https://www.youtube.com/watch?v=FwRcPEg1MyE"
  }, 
  "player_status": {
    "current_time": 312535, 
    "duration": 740368, 
    "media": "http://r14---sn-vgqsene6.googlevideo.com/videoplayback?mt=1409519738&sver=3&expire=1409541442&pbr=yes&mv=m&pm_type=static&ms=au&id=o-AOhOTLVqsmA0rvDShuqtys05O1feRM94rCMcqizdMNgq&mm=31&source=youtube&dur=740.368&initcwndbps=4215000&ip=130.126.106.94&fexp=902408%2C916600%2C927622%2C931983%2C932404%2C932625%2C934024%2C934030%2C939962%2C940696%2C946013%2C948205%2C953801&pfa=20s&itag=140&clen=11759261&lmt=1394287212325516&sparams=clen%2Cdur%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmm%2Cms%2Cmv%2Cpbr%2Cpfa%2Cpm_type%2Csource%2Cupn%2Cexpire&signature=2BE747CD154EC176F1C25890FEBFD4FA0171F0CE.A388AFB377A6CE165A73C8BC87C14017431679EE&ipbits=0&gir=yes&key=yt5&upn=HU3LvsRj3WU&ratebypass=yes", 
    "state": "State.Paused", 
    "volume": 88
  }
}

POST /v1/session

  • username: NetID
  • password: password

Login.

{
  "created-date": 1409540212721, 
  "expand": "user", 
  "expiry-date": 1409542012721, 
  "link": {
    "href": "REDACTED", 
    "rel": "self"
  }, 
  "token": "fxmTaAy7uoGwGbLTAdMZaA00", 
  "user": {
    "link": {
      "href": "REDACTED", 
      "rel": "self"
    }, 
    "name": "klwang3"
  }
}

GET /v1/session/<token>

Return 200 if session is valid. Return 400 if it's expired.

DELETE /v1/session/<token>

Logout.

⚠️ **GitHub.com Fallback** ⚠️