API Documentation
API is currently accessible at api.fimplug.net
API Objects
Standard Payload
{ "data": [], "meta": {}, "status": "OK", "time": 0.142137 }
Property | Type | Description |
---|---|---|
data | Array | Array of object(s) containing the requested data |
meta | Object | Metadata for the requested data |
status | String | Response status |
time | Number | Milliseconds it took to generate the response |
Media Object
{ "format": 1, "cid": "1oQ4g-_VC2w", "author": "The Collaboratory", "title": "All This Time | PMV Collab |", "plays": { "total": 313, "week": 3, "month": 6 }, "score": { "upvotes": 3296, "curates": 198, "downvotes": 22 }, "firstPlay": { "time": "2014-11-15T13:46:32.000Z", "user": { "id": null, "username": "thepipfan", "slug": null, "role": 0 } }, "lastPlay": { "time": "2016-07-19T13:53:37.000Z", "user": { "id": 6040860, "username": "PeKaNo", "slug": "pekano", "role": 1 } } }
Property | Type | Description |
---|---|---|
format | Number | Media format (1: YouTube, 2: SoundCloud) |
cid | String | Media content ID |
author | String | Media author |
title | String | Media title |
plays | Object | |
plays.total | Number | How many times the media has been played |
plays.week | Number | How many times the media has been played in the past 7 days |
plays.month | Number | How many times the media has been played in the past 30 days |
score | Object | |
score.upvotes | Number | How many times the media has been upvoted |
score.curates | Number | How many times the media has been curated |
score.downvotes | Number | How many times the media has been downvoted |
firstPlay | Object | |
firstPlay.time | String | Time |
firstPlay.user | Object | |
firstPlay.user.id | Number | Null | ID of the user that first played the media |
firstPlay.user.username | String | Username of the user that first played the media |
firstPlay.user.slug | String | Null | Slug of the user that first played the media |
firstPlay.user.role | Number | Role of the user that first played the media |
lastPlay | Object | |
lastPlay.time | String | Time |
lastPlay.user | Object | |
lastPlay.user.id | Number | Null | ID of the user that last played the media |
lastPlay.user.username | String | Username of the user that last played the media |
lastPlay.user.slug | String | Null | Slug of the user that last played the media |
lastPlay.user.role | Number | Role of the user that last played the media |
Pagination Object
{ "page": 1, "limit": 25, "total": 27306 }
Property | Type | Description |
---|---|---|
page | Number | Page number |
limit | Number | Item limit per-page |
total | Number | Total items |
User Object
{ id: 3631645, username: "TML", slug: "tml", role: 0, firstSeen: "2015-02-07T20:51:35.000Z", lastSeen: "2016-08-17T17:22:34.000Z", plays: { first: 177, total: 3419 }, score: { given: { upvotes: 18825, downvotes: 84 }, received: { upvotes: 49444, downvotes: 1327 } } }
Property | Type | Description |
---|---|---|
id | Number | User ID |
username | String | User username |
slug | String | Null | User slug |
role | Number | User role |
firstSeen | String | Time user was created |
lastSeen | String | Time user was last updated |
plays | Object | |
plays.first | Number | Amount of first plays |
plays.total | Number | Total amount of plays |
score | Object | |
score.given | Object | |
score.given.upvotes | Number | Times user has upvoted |
score.given.downvotes | Number | Times user has downvoted |
score.received | Object | |
score.received.upvotes | Number | Times user has been upvoted |
score.received.downvotes | Number | Times user has been downvoted |
Media API
[GET] /media
Get media table state
{ "data": [ { "unique": 27306, "total": 213121, "since": "2014-10-25T06:34:02.000Z" } ], "meta": {}, "status": "OK", "time": 20.367529 }
Property | Type | Description |
---|---|---|
unique | Number | Amount of media in the table |
total | Number | Total amount of plays in the table |
since | String | Date of the first media in the table |
[GET] /media/new
Get media sorted by first play date
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/recent
Get media sorted by last play date
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/search
Search for media by author or title
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
q | String | Search query |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/top
Get media sorted by total plays
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/top/month
Get media sorted by plays in the past 30 days
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/top/week
Get media sorted by plays in the past 7 days
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
{ "data": [ {media-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 26.387351 }
[GET] /media/:format/:cid
Get media by format and content id
Parameter | Type | Description |
---|---|---|
format | Number | Media format |
cid | String | Media content id |
{ "data": [ {media-object} ], "meta": {}, "status": "OK", "time": 2.172895 }
Room API
[GET] /room
Get room state
{ "data": [ { "name": "FiM: Brony and Pony Music!", "media": { "author": "Night Breeze", "format": 1, "image": "http://i1.ytimg.com/vi/2qHkD-2_9ZU/default.jpg", "cid": "2qHkD-2_9ZU", "duration": 267, "title": "Night Breeze | Childhood Eyes", "id": 213505069 }, "dj": { "avatarID": "classic08", "badge": "bt-g", "gRole": 0, "grab": false, "id": 3631645, "joined": "2013-05-19 18:36:56.961000", "language": "fi", "level": 15, "role": 0, "slug": "tml", "status": 1, "sub": 1, "username": "TML", "vote": 0 }, "population": 29, "guests": 0 } ], "meta": {}, "status": "OK", "time": 1.837708 }
Property | Type | Description |
---|---|---|
name | String | Room name |
media | Object | Current media (plug.dj media object) |
dj | Object | Current DJ (plug.dj user object) |
population | Number | Users in room |
guests | Number | Guests in room |
[GET] /room/staff
Get room staff
{ "data": [ { "avatarID": "classic07", "badge": "ss-g", "gRole": 0, "grab": false, "id": 3730413, "joined": "2013-12-27 15:29:02.022000", "language": "en", "level": 17, "role": 3, "slug": "bot", "status": 1, "sub": 0, "username": "Bot", "vote": 1 }, {...} ], "meta": { "total": 27 }, "status": "OK", "time": 1.837708 }
[GET] /room/users
Get room users
{ "data": [ { "avatarID": "classic07", "badge": "ss-g", "gRole": 0, "grab": false, "id": 3730413, "joined": "2013-12-27 15:29:02.022000", "language": "en", "level": 17, "role": 3, "slug": "bot", "status": 1, "sub": 0, "username": "Bot", "vote": 1 }, {...} ], "meta": { "total": 27 }, "status": "OK", "time": 1.837708 }
[GET] /room/waitlist
Get room waitlist
{ "data": [ { "avatarID": "classic07", "badge": "ss-g", "gRole": 0, "grab": false, "id": 3730413, "joined": "2013-12-27 15:29:02.022000", "language": "en", "level": 17, "role": 3, "slug": "bot", "status": 1, "sub": 0, "username": "Bot", "vote": 1 }, {...} ], "meta": { "total": 27 }, "status": "OK", "time": 1.837708 }
User API
[GET] /users
Get users table state
{ "data": [ { "users": 2041, "since": "2015-02-06T01:18:18.000Z" } ], "meta": {}, "status": "OK", "time": 3.833063 }
Property | Type | Description |
---|---|---|
users | Number | Amount of users in the table |
since | String | Date of the first user in the table |
[GET] /users/search
Search for users by username
Query | Type | Description |
---|---|---|
page | Number | Page number to return |
q | String | Search query |
{ "data": [ {user-object}, {...} ], "meta": {pagination-object}, "status": "OK", "time": 5.218364 }