Developers

Overview

If you’d like to do more with Frodio, we have an extensive API for you to use. While it’s still a work in progress, it allows you to read and write raw data, giving you loads of flexibility.

All libraries and examples will be published on Github.com.
You can follow us and watch our repositories.

Authentication

Current version of Frodio API (version 1.0) supports auth using temporary session (X-Frodio-Auth header). Version 2.0 of Frodio API should support OAuth 2.0.

REST

Our API is RESTful. Supports any GET or POST requests on base URL http://api.frodio.com, format of data is JSON.
For example: http://api.frodio.com/
Response:

{"hello":"Hello, Frodio!"}

You can try it using JS Fiddle http://frd.io/i98.

Error Messages

Errors are sent with a corresponding HTTP Status code along with a JSON fragment containing the error and it’s messages. See Error Messages section in the documentation.
For example: http://api.frodio.com/foo-bar
Response:

{"error":{"msg":"Bad request","code":"5"}}

Frodio API

Working with Users

1. Sign up

POST /signup Parameters:
  • username
  • password
  • password2
  • email
  • first_name
  • last_name
All parameters are required.
Successful response:
{ "signup": "ok" } 

2. Login

POST /login Parameters:
  • username
  • password
Username can be login or email of the user. All parameters are required.
Successful response:
{ "login": { "session": session-id } }
The session-id value is used in private methods (when request has got successful authorization), as X-Frodio-Auth header:
X-Frodio-Auth: session-id

3. Profile

GET /profile Authorization: yes Successful response:
{
    "user": {
        "id": "...",
        "email": "...",
        "username": "...",
        "first_name": "...",
        "last_name": "...",
        "bio": "...",
        "gender": "...",
        "photo": "...",
        "photo_big": "...",
        "created": "..."
    }
}

4. Notify settings

GET /profile/notify Authorization: yes Parameters:
  • lastfm_scrob=1 — scrobbling tracks to Last.fm
  • lastfm_like=1 — like tracks on Last.fm
Successful response:
{ "notify": "ok" }

5. Log out

ANY /logout Authorization: yes Successful response:
{ "logout": "ok" }

Working with Stations

1. List of stations

GET /stations Parameters:
  • ext=1 — for extended station info: logo, background, URLs
Successful response:
{
    "stations": [
        {
            "id": "...",
            "name": "...",
            "title": "...",
            "info": "...",
            "stream_mp3": "...",
            "stream_aac": "...",
            "count_listeners": "..."
        },
        ...
     ]
}

2. List of favorite stations

GET /stations/favorite Authorization: yes Parameters:
  • ext=1 – for extended station info: logo, background, URLs
Successful response:
{
    "stations": [
        {
            "id": "...",
            "name": "...",
            "title": "...",
            "info": "...",
            "stream_mp3": "...",
            "stream_aac": "...",
            "count_listeners": "..."
        },
        ...
     ]
}

3. Check if the station is among your liked ones?

GET /like Authorization: yes Parameters:
  • station_id
Successful response:
{ "like": "..." }

4. Like or unlike the station

POST /like Authorization: yes Parameters:
  • station_id
Successful response:
{ "ok": "1", "count": "1", "sign": "..." }

Working with Tracks

1. Current track of the station

GET /onair Authorization: optional Parameters:
  • display_scale – screen size, value 2.0 – the image is not bigger than 500 pixels, 1.0 – is not bigger 252, default – image is square 126x126.
  • sid – station ID, a current track of this station
Successful response:
{
    "onair": {
        station-id : {
            "id" : "...",
            "link": "...",
            "created": "...",
            "liked": "...", // auth
            "artist": {
                "id": "...",
                "name": "...",
                "img": "..."
            },
            "track": {
                "id": "...",
                "title": "..."
             }
        },
        ...
    }
}

2. Check if the track is among your liked ones?

GET /like Authorization: yes Parameters:
  • track_id
Successful response:
{ "like": "..." }

3. Like or unlike the track

POST /like Authorization: yes Parameters:
  • track_id
Optional parameters:
  • sid (station ID)
Successful response:
{ "ok": "1", "count": "1", "sign": "..." }

Working with FRD.IO

GET http://frd.io/shorten?url=URL Successful response:
{ "shortUrl": "http://..." }
Error response:
{ "error": "..." }

Error types

1. Sign up

{
    "code": "4",
    "msg" : "Bad parameters",
    "params": {
        "field1": "type1",
        ...
    }
}
Parameters of error messages:
  • empty: username, email, password, password2, first_name, last_name
  • incorrect: email, first_name, last_name
  • eqpassword: password
  • badpassword: password
  • usernameexists: username
  • emailexists: email

2. Login

{"code": "4", "msg": "Bad parameters", "params": { ... }}
Parameters of error messages:
  • empty: username password
  • login404: username
  • badpassword: password

3. Check authorization

{"code": "2", "msg": "User authorization failed"}

4. Track's like

{"code": "4", "msg": "Bad parameters", "params": { ... }}
Parameters of error messages:
  • empty: track_id
  • not_found: track_id

5. Current track

{"code": "4", "msg": "Bad parameters", "params": { ... }}
Parameters of error messages:
  • not_found: sid


Questions or suggestions?

Feel free to contact us at support@applifto.com

Top Social Radio Streams
Top Stations (11) More Stations
About Station
DnBHeaven
Description: 24/7 Drum and Bass Radio
Format: Drum & Bass
Owner: John James
Website: http://dnbheaven.com/
Stream: MP3 AAC
Listening now: 9
Peak Listeners: 38
Listeners
All Listeners (11589)