Skip to content

Onzr 0.1.0

Endpoints


GET /queue/

Queue List

Description

List queue tracks.

Response 200 OK

{
    "playing": null,
    "tracks": [
        {
            "current": true,
            "position": 0,
            "track": {
                "id": 0,
                "title": "string",
                "album": "string",
                "artist": "string"
            }
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "playing": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Playing"
        },
        "tracks": {
            "items": {
                "$ref": "#/components/schemas/QueuedTrack"
            },
            "type": "array",
            "title": "Tracks"
        }
    },
    "type": "object",
    "required": [
        "playing",
        "tracks"
    ],
    "title": "QueuedTracks",
    "description": "Queued Tracks list."
}

POST /queue/

Queue Add

Description

Add tracks to queue given their identifiers.

Request body

[
    0
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "items": {
        "type": "integer"
    },
    "type": "array",
    "title": "Track Ids"
}

Response 200 OK

{
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "message": {
            "type": "string",
            "title": "Message"
        }
    },
    "type": "object",
    "required": [
        "message"
    ],
    "title": "ServerMessage",
    "description": "Generic server message."
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /queue/

Queue Clear

Description

Clear tracks queue.

Response 200 OK

{
    "player": "string",
    "queue": {
        "playing": null,
        "queued": 0
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "player": {
            "type": "string",
            "title": "Player"
        },
        "queue": {
            "$ref": "#/components/schemas/QueueState"
        }
    },
    "type": "object",
    "required": [
        "player",
        "queue"
    ],
    "title": "ServerState",
    "description": "Onzr server state."
}

GET /queue/{rank}/stream

Stream Track

Description

Stream Deezer track given its identifer.

Input parameters

Parameter In Type Default Nullable Description
rank path integer No

Response 200 OK

Schema of the response body

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /now

Now Playing

Description

Get info about current track.

Response 200 OK

{
    "player": {
        "state": "string",
        "length": 0,
        "time": 0,
        "position": 10.12
    },
    "track": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "player": {
            "$ref": "#/components/schemas/PlayerState"
        },
        "track": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/TrackShort"
                },
                {
                    "type": "null"
                }
            ]
        }
    },
    "type": "object",
    "required": [
        "player"
    ],
    "title": "PlayingState",
    "description": "Playing player state."
}

POST /play

Play

Description

Start playing current queue.

Request body

{
    "rank": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "rank": {
            "anyOf": [
                {
                    "type": "integer",
                    "minimum": 0.0
                },
                {
                    "type": "null"
                }
            ],
            "title": "Rank"
        }
    },
    "type": "object",
    "title": "PlayQueryParams",
    "description": "Play endpoint parameters."
}

Response 200 OK

{
    "action": "string",
    "state": {
        "player": "string",
        "queue": {
            "playing": null,
            "queued": 0
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "action": {
            "type": "string",
            "title": "Action"
        },
        "state": {
            "$ref": "#/components/schemas/ServerState"
        }
    },
    "type": "object",
    "required": [
        "action",
        "state"
    ],
    "title": "PlayerControl",
    "description": "Player controls."
}

Response 422 Unprocessable Entity

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /pause

Pause

Description

Pause/resume playing.

Response 200 OK

{
    "action": "string",
    "state": {
        "player": "string",
        "queue": {
            "playing": null,
            "queued": 0
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "action": {
            "type": "string",
            "title": "Action"
        },
        "state": {
            "$ref": "#/components/schemas/ServerState"
        }
    },
    "type": "object",
    "required": [
        "action",
        "state"
    ],
    "title": "PlayerControl",
    "description": "Player controls."
}

POST /stop

Stop

Description

Stop playing.

Response 200 OK

{
    "action": "string",
    "state": {
        "player": "string",
        "queue": {
            "playing": null,
            "queued": 0
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "action": {
            "type": "string",
            "title": "Action"
        },
        "state": {
            "$ref": "#/components/schemas/ServerState"
        }
    },
    "type": "object",
    "required": [
        "action",
        "state"
    ],
    "title": "PlayerControl",
    "description": "Player controls."
}

POST /next

Next

Description

Play next track in queue.

Response 200 OK

{
    "action": "string",
    "state": {
        "player": "string",
        "queue": {
            "playing": null,
            "queued": 0
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "action": {
            "type": "string",
            "title": "Action"
        },
        "state": {
            "$ref": "#/components/schemas/ServerState"
        }
    },
    "type": "object",
    "required": [
        "action",
        "state"
    ],
    "title": "PlayerControl",
    "description": "Player controls."
}

POST /previous

Previous

Description

Play previous track in queue.

Response 200 OK

{
    "action": "string",
    "state": {
        "player": "string",
        "queue": {
            "playing": null,
            "queued": 0
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "action": {
            "type": "string",
            "title": "Action"
        },
        "state": {
            "$ref": "#/components/schemas/ServerState"
        }
    },
    "type": "object",
    "required": [
        "action",
        "state"
    ],
    "title": "PlayerControl",
    "description": "Player controls."
}

GET /state

State

Description

Server state.

Response 200 OK

{
    "player": "string",
    "queue": {
        "playing": null,
        "queued": 0
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "player": {
            "type": "string",
            "title": "Player"
        },
        "queue": {
            "$ref": "#/components/schemas/QueueState"
        }
    },
    "type": "object",
    "required": [
        "player",
        "queue"
    ],
    "title": "ServerState",
    "description": "Onzr server state."
}

GET /ping

Ping

Description

Server ping.

Response 200 OK

Schema of the response body


Schemas

HTTPValidationError

Name Type
detail Array<ValidationError>

PlayerControl

Name Type
action string
state ServerState

PlayerState

Name Type
length integer
position number
state string
time integer

PlayingState

Name Type
player PlayerState
track

PlayQueryParams

Name Type
rank

QueuedTrack

Name Type
current boolean
position integer
track TrackShort

QueuedTracks

Name Type
playing
tracks Array<QueuedTrack>

QueueState

Name Type
playing
queued integer

ServerMessage

Name Type
message string

ServerState

Name Type
player string
queue QueueState

TrackShort

Name Type
album string
artist string
id integer
title string

ValidationError

Name Type
loc Array<>
msg string
type string