818 lines
284 KiB
HTML
818 lines
284 KiB
HTML
<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Linux/FreeBSD DAAP (iTunes) and MPD media server with support for AirPlay devices (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio. "><meta name=author content="OwnTone maintainers"><link href=https://owntone.github.io/owntone-server/json-api/ rel=canonical><link href=../advanced/multiple-instances/ rel=prev><link rel=icon href=../assets/favicon.ico><meta name=generator content="mkdocs-1.6.1, mkdocs-material-9.5.49"><title>JSON API - OwnTone</title><link rel=stylesheet href=../assets/stylesheets/main.6f8fc17f.min.css><link rel=stylesheet href=../assets/stylesheets/palette.06af60db.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><link rel=stylesheet href=../assets/extra.css><script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=white data-md-color-accent=teal> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#api-endpoint-reference class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class=md-header data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=.. title=OwnTone class="md-header__button md-logo" aria-label=OwnTone data-md-component=logo> <img src=../assets/logo.svg alt=logo> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> OwnTone </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> JSON API </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media data-md-color-scheme=default data-md-color-primary=white data-md-color-accent=teal aria-label="Switch to dark mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3"/></svg> </label> <input class=md-option data-md-color-media data-md-color-scheme=slate data-md-color-primary=blue-grey data-md-color-accent=teal aria-label="Switch to light mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6m0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4M7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"/></svg> </label> </form> <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script> <label class="md-header__button md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg> </label> <div class=md-search data-md-component=search role=dialog> <label class=md-search__overlay for=__search></label> <div class=md-search__inner role=search> <form class=md-search__form name=search> <input type=text class=md-search__input name=query aria-label=Search placeholder=Search autocapitalize=off autocorrect=off autocomplete=off spellcheck=false data-md-component=search-query required> <label class="md-search__icon md-icon" for=__search> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </label> <nav class=md-search__options aria-label=Search> <button type=reset class="md-search__icon md-icon" title=Clear aria-label=Clear tabindex=-1> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg> </button> </nav> </form> <div class=md-search__output> <div class=md-search__scrollwrap tabindex=0 data-md-scrollfix> <div class=md-search-result data-md-component=search-result> <div class=md-search-result__meta> Initializing search </div> <ol class=md-search-result__list role=presentation></ol> </div> </div> </div> </div> </div> <div class=md-header__source> <a href=https://github.com/owntone/owntone-server title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg> </div> <div class=md-source__repository> owntone/owntone-server </div> </a> </div> </nav> </header> <div class=md-container data-md-component=container> <nav class=md-tabs aria-label=Tabs data-md-component=tabs> <div class=md-grid> <ul class=md-tabs__list> <li class=md-tabs__item> <a href=.. class=md-tabs__link> Home </a> </li> <li class=md-tabs__item> <a href=../getting-started/ class=md-tabs__link> Documentation </a> </li> <li class="md-tabs__item md-tabs__item--active"> <a href=./ class=md-tabs__link> JSON API </a> </li> </ul> </div> </nav> <main class=md-main data-md-component=main> <div class="md-main__inner md-grid"> <div class="md-sidebar md-sidebar--primary" data-md-component=sidebar data-md-type=navigation hidden> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav class="md-nav md-nav--primary md-nav--lifted" aria-label=Navigation data-md-level=0> <label class=md-nav__title for=__drawer> <a href=.. title=OwnTone class="md-nav__button md-logo" aria-label=OwnTone data-md-component=logo> <img src=../assets/logo.svg alt=logo> </a> OwnTone </label> <div class=md-nav__source> <a href=https://github.com/owntone/owntone-server title="Go to repository" class=md-source data-md-component=source> <div class="md-source__icon md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 448 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg> </div> <div class=md-source__repository> owntone/owntone-server </div> </a> </div> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=.. class=md-nav__link> <span class=md-ellipsis> Home </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2> <label class=md-nav__link for=__nav_2 id=__nav_2_label tabindex=0> <span class=md-ellipsis> Documentation </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=1 aria-labelledby=__nav_2_label aria-expanded=false> <label class=md-nav__title for=__nav_2> <span class="md-nav__icon md-icon"></span> Documentation </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../getting-started/ class=md-nav__link> <span class=md-ellipsis> Getting Started </span> </a> </li> <li class=md-nav__item> <a href=../installation/ class=md-nav__link> <span class=md-ellipsis> Installation </span> </a> </li> <li class=md-nav__item> <a href=../configuration/ class=md-nav__link> <span class=md-ellipsis> Configuration </span> </a> </li> <li class=md-nav__item> <a href=../building/ class=md-nav__link> <span class=md-ellipsis> Building </span> </a> </li> <li class=md-nav__item> <a href=../library/ class=md-nav__link> <span class=md-ellipsis> Library </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2_6> <label class=md-nav__link for=__nav_2_6 id=__nav_2_6_label tabindex=0> <span class=md-ellipsis> Control </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_2_6_label aria-expanded=false> <label class=md-nav__title for=__nav_2_6> <span class="md-nav__icon md-icon"></span> Control </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../control-clients/mobile/ class=md-nav__link> <span class=md-ellipsis> Mobile Device </span> </a> </li> <li class=md-nav__item> <a href=../control-clients/desktop/ class=md-nav__link> <span class=md-ellipsis> Desktop </span> </a> </li> <li class=md-nav__item> <a href=../control-clients/web/ class=md-nav__link> <span class=md-ellipsis> Browser </span> </a> </li> <li class=md-nav__item> <a href=../control-clients/cli-api/ class=md-nav__link> <span class=md-ellipsis> API and CLI </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2_7> <label class=md-nav__link for=__nav_2_7 id=__nav_2_7_label tabindex=0> <span class=md-ellipsis> Audio Outputs </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_2_7_label aria-expanded=false> <label class=md-nav__title for=__nav_2_7> <span class="md-nav__icon md-icon"></span> Audio Outputs </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../audio-outputs/airplay/ class=md-nav__link> <span class=md-ellipsis> AirPlay </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/chromecast/ class=md-nav__link> <span class=md-ellipsis> Chromecast </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/local-audio/ class=md-nav__link> <span class=md-ellipsis> Local Audio </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/mobile/ class=md-nav__link> <span class=md-ellipsis> Mobile Device </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/web/ class=md-nav__link> <span class=md-ellipsis> Web </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/roku/ class=md-nav__link> <span class=md-ellipsis> Roku </span> </a> </li> <li class=md-nav__item> <a href=../audio-outputs/streaming/ class=md-nav__link> <span class=md-ellipsis> Streaming </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=../media-clients/ class=md-nav__link> <span class=md-ellipsis> Media Clients </span> </a> </li> <li class=md-nav__item> <a href=../artwork/ class=md-nav__link> <span class=md-ellipsis> Artwork </span> </a> </li> <li class=md-nav__item> <a href=../playlists/ class=md-nav__link> <span class=md-ellipsis> Playlists and Radio </span> </a> </li> <li class=md-nav__item> <a href=../smart-playlists/ class=md-nav__link> <span class=md-ellipsis> Smart Playlists </span> </a> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2_12> <label class=md-nav__link for=__nav_2_12 id=__nav_2_12_label tabindex=0> <span class=md-ellipsis> Services Integration </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_2_12_label aria-expanded=false> <label class=md-nav__title for=__nav_2_12> <span class="md-nav__icon md-icon"></span> Services Integration </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../integrations/spotify/ class=md-nav__link> <span class=md-ellipsis> Spotify </span> </a> </li> <li class=md-nav__item> <a href=../integrations/lastfm/ class=md-nav__link> <span class=md-ellipsis> LastFM </span> </a> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--nested"> <input class="md-nav__toggle md-toggle " type=checkbox id=__nav_2_13> <label class=md-nav__link for=__nav_2_13 id=__nav_2_13_label tabindex=0> <span class=md-ellipsis> Advanced Setup </span> <span class="md-nav__icon md-icon"></span> </label> <nav class=md-nav data-md-level=2 aria-labelledby=__nav_2_13_label aria-expanded=false> <label class=md-nav__title for=__nav_2_13> <span class="md-nav__icon md-icon"></span> Advanced Setup </label> <ul class=md-nav__list data-md-scrollfix> <li class=md-nav__item> <a href=../advanced/outputs-alsa/ class=md-nav__link> <span class=md-ellipsis> ALSA </span> </a> </li> <li class=md-nav__item> <a href=../advanced/outputs-pulse/ class=md-nav__link> <span class=md-ellipsis> PulseAudio </span> </a> </li> <li class=md-nav__item> <a href=../advanced/radio-streams/ class=md-nav__link> <span class=md-ellipsis> Radio Streams </span> </a> </li> <li class=md-nav__item> <a href=../advanced/remote-access/ class=md-nav__link> <span class=md-ellipsis> Remote Access </span> </a> </li> <li class=md-nav__item> <a href=../advanced/multiple-instances/ class=md-nav__link> <span class=md-ellipsis> Multiple Instances </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> <li class="md-nav__item md-nav__item--active"> <input class="md-nav__toggle md-toggle" type=checkbox id=__toc> <label class="md-nav__link md-nav__link--active" for=__toc> <span class=md-ellipsis> JSON API </span> <span class="md-nav__icon md-icon"></span> </label> <a href=./ class="md-nav__link md-nav__link--active"> <span class=md-ellipsis> JSON API </span> </a> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a href=#player class=md-nav__link> <span class=md-ellipsis> Player </span> </a> <nav class=md-nav aria-label=Player> <ul class=md-nav__list> <li class=md-nav__item> <a href=#get-player-status class=md-nav__link> <span class=md-ellipsis> Get player status </span> </a> </li> <li class=md-nav__item> <a href=#control-playback class=md-nav__link> <span class=md-ellipsis> Control playback </span> </a> </li> <li class=md-nav__item> <a href=#skip-tracks class=md-nav__link> <span class=md-ellipsis> Skip tracks </span> </a> </li> <li class=md-nav__item> <a href=#set-shuffle-mode class=md-nav__link> <span class=md-ellipsis> Set shuffle mode </span> </a> </li> <li class=md-nav__item> <a href=#set-consume-mode class=md-nav__link> <span class=md-ellipsis> Set consume mode </span> </a> </li> <li class=md-nav__item> <a href=#set-repeat-mode class=md-nav__link> <span class=md-ellipsis> Set repeat mode </span> </a> </li> <li class=md-nav__item> <a href=#set-volume class=md-nav__link> <span class=md-ellipsis> Set volume </span> </a> </li> <li class=md-nav__item> <a href=#seek class=md-nav__link> <span class=md-ellipsis> Seek </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#outputs class=md-nav__link> <span class=md-ellipsis> Outputs </span> </a> <nav class=md-nav aria-label=Outputs> <ul class=md-nav__list> <li class=md-nav__item> <a href=#get-a-list-of-available-outputs class=md-nav__link> <span class=md-ellipsis> Get a list of available outputs </span> </a> </li> <li class=md-nav__item> <a href=#set-enabled-outputs class=md-nav__link> <span class=md-ellipsis> Set enabled outputs </span> </a> </li> <li class=md-nav__item> <a href=#get-an-output class=md-nav__link> <span class=md-ellipsis> Get an output </span> </a> </li> <li class=md-nav__item> <a href=#change-an-output class=md-nav__link> <span class=md-ellipsis> Change an output </span> </a> </li> <li class=md-nav__item> <a href=#toggle-an-output class=md-nav__link> <span class=md-ellipsis> Toggle an output </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#queue class=md-nav__link> <span class=md-ellipsis> Queue </span> </a> <nav class=md-nav aria-label=Queue> <ul class=md-nav__list> <li class=md-nav__item> <a href=#list-queue-items class=md-nav__link> <span class=md-ellipsis> List queue items </span> </a> </li> <li class=md-nav__item> <a href=#clearing-the-queue class=md-nav__link> <span class=md-ellipsis> Clearing the queue </span> </a> </li> <li class=md-nav__item> <a href=#adding-items-to-the-queue class=md-nav__link> <span class=md-ellipsis> Adding items to the queue </span> </a> </li> <li class=md-nav__item> <a href=#updating-a-queue-item class=md-nav__link> <span class=md-ellipsis> Updating a queue item </span> </a> </li> <li class=md-nav__item> <a href=#removing-a-queue-item class=md-nav__link> <span class=md-ellipsis> Removing a queue item </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#library class=md-nav__link> <span class=md-ellipsis> Library </span> </a> <nav class=md-nav aria-label=Library> <ul class=md-nav__list> <li class=md-nav__item> <a href=#library-information class=md-nav__link> <span class=md-ellipsis> Library information </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists class=md-nav__link> <span class=md-ellipsis> List playlists </span> </a> </li> <li class=md-nav__item> <a href=#get-a-playlist class=md-nav__link> <span class=md-ellipsis> Get a playlist </span> </a> </li> <li class=md-nav__item> <a href=#update-a-playlist class=md-nav__link> <span class=md-ellipsis> Update a playlist </span> </a> </li> <li class=md-nav__item> <a href=#delete-a-playlist class=md-nav__link> <span class=md-ellipsis> Delete a playlist </span> </a> </li> <li class=md-nav__item> <a href=#list-playlist-tracks class=md-nav__link> <span class=md-ellipsis> List playlist tracks </span> </a> </li> <li class=md-nav__item> <a href=#update-playlist-tracks class=md-nav__link> <span class=md-ellipsis> Update playlist tracks </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists-in-a-playlist-folder class=md-nav__link> <span class=md-ellipsis> List playlists in a playlist folder </span> </a> </li> <li class=md-nav__item> <a href=#list-artists class=md-nav__link> <span class=md-ellipsis> List artists </span> </a> </li> <li class=md-nav__item> <a href=#get-an-artist class=md-nav__link> <span class=md-ellipsis> Get an artist </span> </a> </li> <li class=md-nav__item> <a href=#list-artist-albums class=md-nav__link> <span class=md-ellipsis> List artist albums </span> </a> </li> <li class=md-nav__item> <a href=#list-albums class=md-nav__link> <span class=md-ellipsis> List albums </span> </a> </li> <li class=md-nav__item> <a href=#get-an-album class=md-nav__link> <span class=md-ellipsis> Get an album </span> </a> </li> <li class=md-nav__item> <a href=#list-album-tracks class=md-nav__link> <span class=md-ellipsis> List album tracks </span> </a> </li> <li class=md-nav__item> <a href=#get-a-track class=md-nav__link> <span class=md-ellipsis> Get a track </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists-for-a-track class=md-nav__link> <span class=md-ellipsis> List playlists for a track </span> </a> </li> <li class=md-nav__item> <a href=#update-track-properties class=md-nav__link> <span class=md-ellipsis> Update track properties </span> </a> </li> <li class=md-nav__item> <a href=#list-genres class=md-nav__link> <span class=md-ellipsis> List genres </span> </a> </li> <li class=md-nav__item> <a href=#list-albums-for-genre class=md-nav__link> <span class=md-ellipsis> List albums for genre </span> </a> </li> <li class=md-nav__item> <a href=#get-count-of-tracks-artists-and-albums class=md-nav__link> <span class=md-ellipsis> Get count of tracks, artists and albums </span> </a> </li> <li class=md-nav__item> <a href=#list-local-directories class=md-nav__link> <span class=md-ellipsis> List local directories </span> </a> </li> <li class=md-nav__item> <a href=#add-an-item-to-the-library class=md-nav__link> <span class=md-ellipsis> Add an item to the library </span> </a> </li> <li class=md-nav__item> <a href=#trigger-rescan class=md-nav__link> <span class=md-ellipsis> Trigger rescan </span> </a> </li> <li class=md-nav__item> <a href=#trigger-metadata-rescan class=md-nav__link> <span class=md-ellipsis> Trigger metadata rescan </span> </a> </li> <li class=md-nav__item> <a href=#backup-db class=md-nav__link> <span class=md-ellipsis> Backup DB </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#search class=md-nav__link> <span class=md-ellipsis> Search </span> </a> <nav class=md-nav aria-label=Search> <ul class=md-nav__list> <li class=md-nav__item> <a href=#search-by-search-term class=md-nav__link> <span class=md-ellipsis> Search by search term </span> </a> </li> <li class=md-nav__item> <a href=#search-by-query-language class=md-nav__link> <span class=md-ellipsis> Search by query language </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#server-info class=md-nav__link> <span class=md-ellipsis> Server info </span> </a> <nav class=md-nav aria-label="Server info"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#config class=md-nav__link> <span class=md-ellipsis> Config </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#settings class=md-nav__link> <span class=md-ellipsis> Settings </span> </a> <nav class=md-nav aria-label=Settings> <ul class=md-nav__list> <li class=md-nav__item> <a href=#list-categories class=md-nav__link> <span class=md-ellipsis> List categories </span> </a> </li> <li class=md-nav__item> <a href=#get-a-category class=md-nav__link> <span class=md-ellipsis> Get a category </span> </a> </li> <li class=md-nav__item> <a href=#get-an-option class=md-nav__link> <span class=md-ellipsis> Get an option </span> </a> </li> <li class=md-nav__item> <a href=#change-an-option-value class=md-nav__link> <span class=md-ellipsis> Change an option value </span> </a> </li> <li class=md-nav__item> <a href=#delete-an-option class=md-nav__link> <span class=md-ellipsis> Delete an option </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#push-notifications class=md-nav__link> <span class=md-ellipsis> Push notifications </span> </a> </li> <li class=md-nav__item> <a href=#objects class=md-nav__link> <span class=md-ellipsis> Objects </span> </a> <nav class=md-nav aria-label=Objects> <ul class=md-nav__list> <li class=md-nav__item> <a href=#album-object class=md-nav__link> <span class=md-ellipsis> album object </span> </a> </li> <li class=md-nav__item> <a href=#artist-object class=md-nav__link> <span class=md-ellipsis> artist object </span> </a> </li> <li class=md-nav__item> <a href=#browse-info-object class=md-nav__link> <span class=md-ellipsis> browse-info object </span> </a> </li> <li class=md-nav__item> <a href=#category-object class=md-nav__link> <span class=md-ellipsis> category object </span> </a> </li> <li class=md-nav__item> <a href=#directory-object class=md-nav__link> <span class=md-ellipsis> directory object </span> </a> </li> <li class=md-nav__item> <a href=#option-object class=md-nav__link> <span class=md-ellipsis> option object </span> </a> </li> <li class=md-nav__item> <a href=#paging-object class=md-nav__link> <span class=md-ellipsis> paging object </span> </a> </li> <li class=md-nav__item> <a href=#playlist-object class=md-nav__link> <span class=md-ellipsis> playlist object </span> </a> </li> <li class=md-nav__item> <a href=#queue-item-object class=md-nav__link> <span class=md-ellipsis> queue item object </span> </a> </li> <li class=md-nav__item> <a href=#track-object class=md-nav__link> <span class=md-ellipsis> track object </span> </a> </li> <li class=md-nav__item> <a href=#artwork-urls class=md-nav__link> <span class=md-ellipsis> Artwork urls </span> </a> </li> </ul> </nav> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component=sidebar data-md-type=toc> <div class=md-sidebar__scrollwrap> <div class=md-sidebar__inner> <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> <label class=md-nav__title for=__toc> <span class="md-nav__icon md-icon"></span> Table of contents </label> <ul class=md-nav__list data-md-component=toc data-md-scrollfix> <li class=md-nav__item> <a href=#player class=md-nav__link> <span class=md-ellipsis> Player </span> </a> <nav class=md-nav aria-label=Player> <ul class=md-nav__list> <li class=md-nav__item> <a href=#get-player-status class=md-nav__link> <span class=md-ellipsis> Get player status </span> </a> </li> <li class=md-nav__item> <a href=#control-playback class=md-nav__link> <span class=md-ellipsis> Control playback </span> </a> </li> <li class=md-nav__item> <a href=#skip-tracks class=md-nav__link> <span class=md-ellipsis> Skip tracks </span> </a> </li> <li class=md-nav__item> <a href=#set-shuffle-mode class=md-nav__link> <span class=md-ellipsis> Set shuffle mode </span> </a> </li> <li class=md-nav__item> <a href=#set-consume-mode class=md-nav__link> <span class=md-ellipsis> Set consume mode </span> </a> </li> <li class=md-nav__item> <a href=#set-repeat-mode class=md-nav__link> <span class=md-ellipsis> Set repeat mode </span> </a> </li> <li class=md-nav__item> <a href=#set-volume class=md-nav__link> <span class=md-ellipsis> Set volume </span> </a> </li> <li class=md-nav__item> <a href=#seek class=md-nav__link> <span class=md-ellipsis> Seek </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#outputs class=md-nav__link> <span class=md-ellipsis> Outputs </span> </a> <nav class=md-nav aria-label=Outputs> <ul class=md-nav__list> <li class=md-nav__item> <a href=#get-a-list-of-available-outputs class=md-nav__link> <span class=md-ellipsis> Get a list of available outputs </span> </a> </li> <li class=md-nav__item> <a href=#set-enabled-outputs class=md-nav__link> <span class=md-ellipsis> Set enabled outputs </span> </a> </li> <li class=md-nav__item> <a href=#get-an-output class=md-nav__link> <span class=md-ellipsis> Get an output </span> </a> </li> <li class=md-nav__item> <a href=#change-an-output class=md-nav__link> <span class=md-ellipsis> Change an output </span> </a> </li> <li class=md-nav__item> <a href=#toggle-an-output class=md-nav__link> <span class=md-ellipsis> Toggle an output </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#queue class=md-nav__link> <span class=md-ellipsis> Queue </span> </a> <nav class=md-nav aria-label=Queue> <ul class=md-nav__list> <li class=md-nav__item> <a href=#list-queue-items class=md-nav__link> <span class=md-ellipsis> List queue items </span> </a> </li> <li class=md-nav__item> <a href=#clearing-the-queue class=md-nav__link> <span class=md-ellipsis> Clearing the queue </span> </a> </li> <li class=md-nav__item> <a href=#adding-items-to-the-queue class=md-nav__link> <span class=md-ellipsis> Adding items to the queue </span> </a> </li> <li class=md-nav__item> <a href=#updating-a-queue-item class=md-nav__link> <span class=md-ellipsis> Updating a queue item </span> </a> </li> <li class=md-nav__item> <a href=#removing-a-queue-item class=md-nav__link> <span class=md-ellipsis> Removing a queue item </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#library class=md-nav__link> <span class=md-ellipsis> Library </span> </a> <nav class=md-nav aria-label=Library> <ul class=md-nav__list> <li class=md-nav__item> <a href=#library-information class=md-nav__link> <span class=md-ellipsis> Library information </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists class=md-nav__link> <span class=md-ellipsis> List playlists </span> </a> </li> <li class=md-nav__item> <a href=#get-a-playlist class=md-nav__link> <span class=md-ellipsis> Get a playlist </span> </a> </li> <li class=md-nav__item> <a href=#update-a-playlist class=md-nav__link> <span class=md-ellipsis> Update a playlist </span> </a> </li> <li class=md-nav__item> <a href=#delete-a-playlist class=md-nav__link> <span class=md-ellipsis> Delete a playlist </span> </a> </li> <li class=md-nav__item> <a href=#list-playlist-tracks class=md-nav__link> <span class=md-ellipsis> List playlist tracks </span> </a> </li> <li class=md-nav__item> <a href=#update-playlist-tracks class=md-nav__link> <span class=md-ellipsis> Update playlist tracks </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists-in-a-playlist-folder class=md-nav__link> <span class=md-ellipsis> List playlists in a playlist folder </span> </a> </li> <li class=md-nav__item> <a href=#list-artists class=md-nav__link> <span class=md-ellipsis> List artists </span> </a> </li> <li class=md-nav__item> <a href=#get-an-artist class=md-nav__link> <span class=md-ellipsis> Get an artist </span> </a> </li> <li class=md-nav__item> <a href=#list-artist-albums class=md-nav__link> <span class=md-ellipsis> List artist albums </span> </a> </li> <li class=md-nav__item> <a href=#list-albums class=md-nav__link> <span class=md-ellipsis> List albums </span> </a> </li> <li class=md-nav__item> <a href=#get-an-album class=md-nav__link> <span class=md-ellipsis> Get an album </span> </a> </li> <li class=md-nav__item> <a href=#list-album-tracks class=md-nav__link> <span class=md-ellipsis> List album tracks </span> </a> </li> <li class=md-nav__item> <a href=#get-a-track class=md-nav__link> <span class=md-ellipsis> Get a track </span> </a> </li> <li class=md-nav__item> <a href=#list-playlists-for-a-track class=md-nav__link> <span class=md-ellipsis> List playlists for a track </span> </a> </li> <li class=md-nav__item> <a href=#update-track-properties class=md-nav__link> <span class=md-ellipsis> Update track properties </span> </a> </li> <li class=md-nav__item> <a href=#list-genres class=md-nav__link> <span class=md-ellipsis> List genres </span> </a> </li> <li class=md-nav__item> <a href=#list-albums-for-genre class=md-nav__link> <span class=md-ellipsis> List albums for genre </span> </a> </li> <li class=md-nav__item> <a href=#get-count-of-tracks-artists-and-albums class=md-nav__link> <span class=md-ellipsis> Get count of tracks, artists and albums </span> </a> </li> <li class=md-nav__item> <a href=#list-local-directories class=md-nav__link> <span class=md-ellipsis> List local directories </span> </a> </li> <li class=md-nav__item> <a href=#add-an-item-to-the-library class=md-nav__link> <span class=md-ellipsis> Add an item to the library </span> </a> </li> <li class=md-nav__item> <a href=#trigger-rescan class=md-nav__link> <span class=md-ellipsis> Trigger rescan </span> </a> </li> <li class=md-nav__item> <a href=#trigger-metadata-rescan class=md-nav__link> <span class=md-ellipsis> Trigger metadata rescan </span> </a> </li> <li class=md-nav__item> <a href=#backup-db class=md-nav__link> <span class=md-ellipsis> Backup DB </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#search class=md-nav__link> <span class=md-ellipsis> Search </span> </a> <nav class=md-nav aria-label=Search> <ul class=md-nav__list> <li class=md-nav__item> <a href=#search-by-search-term class=md-nav__link> <span class=md-ellipsis> Search by search term </span> </a> </li> <li class=md-nav__item> <a href=#search-by-query-language class=md-nav__link> <span class=md-ellipsis> Search by query language </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#server-info class=md-nav__link> <span class=md-ellipsis> Server info </span> </a> <nav class=md-nav aria-label="Server info"> <ul class=md-nav__list> <li class=md-nav__item> <a href=#config class=md-nav__link> <span class=md-ellipsis> Config </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#settings class=md-nav__link> <span class=md-ellipsis> Settings </span> </a> <nav class=md-nav aria-label=Settings> <ul class=md-nav__list> <li class=md-nav__item> <a href=#list-categories class=md-nav__link> <span class=md-ellipsis> List categories </span> </a> </li> <li class=md-nav__item> <a href=#get-a-category class=md-nav__link> <span class=md-ellipsis> Get a category </span> </a> </li> <li class=md-nav__item> <a href=#get-an-option class=md-nav__link> <span class=md-ellipsis> Get an option </span> </a> </li> <li class=md-nav__item> <a href=#change-an-option-value class=md-nav__link> <span class=md-ellipsis> Change an option value </span> </a> </li> <li class=md-nav__item> <a href=#delete-an-option class=md-nav__link> <span class=md-ellipsis> Delete an option </span> </a> </li> </ul> </nav> </li> <li class=md-nav__item> <a href=#push-notifications class=md-nav__link> <span class=md-ellipsis> Push notifications </span> </a> </li> <li class=md-nav__item> <a href=#objects class=md-nav__link> <span class=md-ellipsis> Objects </span> </a> <nav class=md-nav aria-label=Objects> <ul class=md-nav__list> <li class=md-nav__item> <a href=#album-object class=md-nav__link> <span class=md-ellipsis> album object </span> </a> </li> <li class=md-nav__item> <a href=#artist-object class=md-nav__link> <span class=md-ellipsis> artist object </span> </a> </li> <li class=md-nav__item> <a href=#browse-info-object class=md-nav__link> <span class=md-ellipsis> browse-info object </span> </a> </li> <li class=md-nav__item> <a href=#category-object class=md-nav__link> <span class=md-ellipsis> category object </span> </a> </li> <li class=md-nav__item> <a href=#directory-object class=md-nav__link> <span class=md-ellipsis> directory object </span> </a> </li> <li class=md-nav__item> <a href=#option-object class=md-nav__link> <span class=md-ellipsis> option object </span> </a> </li> <li class=md-nav__item> <a href=#paging-object class=md-nav__link> <span class=md-ellipsis> paging object </span> </a> </li> <li class=md-nav__item> <a href=#playlist-object class=md-nav__link> <span class=md-ellipsis> playlist object </span> </a> </li> <li class=md-nav__item> <a href=#queue-item-object class=md-nav__link> <span class=md-ellipsis> queue item object </span> </a> </li> <li class=md-nav__item> <a href=#track-object class=md-nav__link> <span class=md-ellipsis> track object </span> </a> </li> <li class=md-nav__item> <a href=#artwork-urls class=md-nav__link> <span class=md-ellipsis> Artwork urls </span> </a> </li> </ul> </nav> </li> </ul> </nav> </div> </div> </div> <div class=md-content data-md-component=content> <article class="md-content__inner md-typeset"> <h1 id=api-endpoint-reference>API Endpoint Reference<a class=headerlink href=#api-endpoint-reference title="Permanent link">¶</a></h1> <p>Available API endpoints:</p> <ul> <li><a href=#player>Player</a>: control playback, volume, shuffle/repeat modes</li> <li><a href=#outputs>Outputs</a>: list available outputs and enable/disable outputs</li> <li><a href=#queue>Queue</a>: list, add or modify the current queue</li> <li><a href=#library>Library</a>: list playlists, artists, albums and tracks from your library or trigger library rescan</li> <li><a href=#search>Search</a>: search for playlists, artists, albums and tracks</li> <li><a href=#server-info>Server info</a>: get server information</li> <li><a href=#settings>Settings</a>: list and change settings for the player web interface</li> <li><a href=#push-notifications>Push notifications</a>: receive push notifications</li> </ul> <p>JSON-Object model:</p> <ul> <li><a href=#album-object>Album</a></li> <li><a href=#artist-object>Artist</a></li> <li><a href=#browse-info-object>Browse Info</a></li> <li><a href=#category-object>Category</a></li> <li><a href=#directory-object>Directory</a></li> <li><a href=#option-object>Option</a></li> <li><a href=#paging-object>Paging</a></li> <li><a href=#playlist-object>Playlist</a></li> <li><a href=#queue-item-object>Queue item</a></li> <li><a href=#track-object>Track</a></li> </ul> <h2 id=player>Player<a class=headerlink href=#player title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#get-player-status>/api/player</a></td> <td>Get player status</td> </tr> <tr> <td>PUT</td> <td><a href=#control-playback>/api/player/play, /api/player/pause, /api/player/stop, /api/player/toggle</a></td> <td>Start, pause or stop playback</td> </tr> <tr> <td>PUT</td> <td><a href=#skip-tracks>/api/player/next, /api/player/previous</a></td> <td>Skip forward or backward</td> </tr> <tr> <td>PUT</td> <td><a href=#set-shuffle-mode>/api/player/shuffle</a></td> <td>Set shuffle mode</td> </tr> <tr> <td>PUT</td> <td><a href=#set-consume-mode>/api/player/consume</a></td> <td>Set consume mode</td> </tr> <tr> <td>PUT</td> <td><a href=#set-repeat-mode>/api/player/repeat</a></td> <td>Set repeat mode</td> </tr> <tr> <td>PUT</td> <td><a href=#set-volume>/api/player/volume</a></td> <td>Set master volume or volume for a specific output</td> </tr> <tr> <td>PUT</td> <td><a href=#seek>/api/player/seek</a></td> <td>Seek to a position in the currently playing track</td> </tr> </tbody> </table> <h3 id=get-player-status>Get player status<a class=headerlink href=#get-player-status title="Permanent link">¶</a></h3> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-0-1 name=__codelineno-0-1 href=#__codelineno-0-1></a><span class=err>GET /api/player</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>state</td> <td>string</td> <td><code>play</code>, <code>pause</code> or <code>stop</code></td> </tr> <tr> <td>repeat</td> <td>string</td> <td><code>off</code>, <code>all</code> or <code>single</code></td> </tr> <tr> <td>consume</td> <td>boolean</td> <td><code>true</code> if consume mode is enabled</td> </tr> <tr> <td>shuffle</td> <td>boolean</td> <td><code>true</code> if shuffle mode is enabled</td> </tr> <tr> <td>volume</td> <td>integer</td> <td>Master volume in percent (0 - 100)</td> </tr> <tr> <td>item_id</td> <td>integer</td> <td>The current playing queue item <code>id</code></td> </tr> <tr> <td>item_length_ms</td> <td>integer</td> <td>Total length in milliseconds of the current queue item</td> </tr> <tr> <td>item_progress_ms</td> <td>integer</td> <td>Progress into the current queue item in milliseconds</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-1-1 name=__codelineno-1-1 href=#__codelineno-1-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/player"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-2-1 name=__codelineno-2-1 href=#__codelineno-2-1></a><span class=p>{</span>
|
|
<a id=__codelineno-2-2 name=__codelineno-2-2 href=#__codelineno-2-2></a><span class=w> </span><span class=nt>"state"</span><span class=p>:</span><span class=w> </span><span class=s2>"pause"</span><span class=p>,</span>
|
|
<a id=__codelineno-2-3 name=__codelineno-2-3 href=#__codelineno-2-3></a><span class=w> </span><span class=nt>"repeat"</span><span class=p>:</span><span class=w> </span><span class=s2>"off"</span><span class=p>,</span>
|
|
<a id=__codelineno-2-4 name=__codelineno-2-4 href=#__codelineno-2-4></a><span class=w> </span><span class=nt>"consume"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-2-5 name=__codelineno-2-5 href=#__codelineno-2-5></a><span class=w> </span><span class=nt>"shuffle"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-2-6 name=__codelineno-2-6 href=#__codelineno-2-6></a><span class=w> </span><span class=nt>"volume"</span><span class=p>:</span><span class=w> </span><span class=mi>50</span><span class=p>,</span>
|
|
<a id=__codelineno-2-7 name=__codelineno-2-7 href=#__codelineno-2-7></a><span class=w> </span><span class=nt>"item_id"</span><span class=p>:</span><span class=w> </span><span class=mi>269</span><span class=p>,</span>
|
|
<a id=__codelineno-2-8 name=__codelineno-2-8 href=#__codelineno-2-8></a><span class=w> </span><span class=nt>"item_length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>278093</span><span class=p>,</span>
|
|
<a id=__codelineno-2-9 name=__codelineno-2-9 href=#__codelineno-2-9></a><span class=w> </span><span class=nt>"item_progress_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>3674</span>
|
|
<a id=__codelineno-2-10 name=__codelineno-2-10 href=#__codelineno-2-10></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=control-playback>Control playback<a class=headerlink href=#control-playback title="Permanent link">¶</a></h3> <p>Start or resume, pause, stop playback.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-3-1 name=__codelineno-3-1 href=#__codelineno-3-1></a><span class=err>PUT /api/player/play</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-4-1 name=__codelineno-4-1 href=#__codelineno-4-1></a><span class=err>PUT /api/player/pause</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-5-1 name=__codelineno-5-1 href=#__codelineno-5-1></a><span class=err>PUT /api/player/stop</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-6-1 name=__codelineno-6-1 href=#__codelineno-6-1></a><span class=err>PUT /api/player/toggle</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-7-1 name=__codelineno-7-1 href=#__codelineno-7-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/play"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-8-1 name=__codelineno-8-1 href=#__codelineno-8-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/pause"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-9-1 name=__codelineno-9-1 href=#__codelineno-9-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/stop"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-10-1 name=__codelineno-10-1 href=#__codelineno-10-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/toggle"</span>
|
|
</code></pre></div> <h3 id=skip-tracks>Skip tracks<a class=headerlink href=#skip-tracks title="Permanent link">¶</a></h3> <p>Skip forward or backward</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-11-1 name=__codelineno-11-1 href=#__codelineno-11-1></a><span class=err>PUT /api/player/next</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-12-1 name=__codelineno-12-1 href=#__codelineno-12-1></a><span class=err>PUT /api/player/previous</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-13-1 name=__codelineno-13-1 href=#__codelineno-13-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/next"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-14-1 name=__codelineno-14-1 href=#__codelineno-14-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/previous"</span>
|
|
</code></pre></div> <h3 id=set-shuffle-mode>Set shuffle mode<a class=headerlink href=#set-shuffle-mode title="Permanent link">¶</a></h3> <p>Enable or disable shuffle mode</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-15-1 name=__codelineno-15-1 href=#__codelineno-15-1></a><span class=err>PUT /api/player/shuffle</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>state</td> <td>The new shuffle state, should be either <code>true</code> or <code>false</code></td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-16-1 name=__codelineno-16-1 href=#__codelineno-16-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/shuffle?state=true"</span>
|
|
</code></pre></div> <h3 id=set-consume-mode>Set consume mode<a class=headerlink href=#set-consume-mode title="Permanent link">¶</a></h3> <p>Enable or disable consume mode</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-17-1 name=__codelineno-17-1 href=#__codelineno-17-1></a><span class=err>PUT /api/player/consume</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>state</td> <td>The new consume state, should be either <code>true</code> or <code>false</code></td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-18-1 name=__codelineno-18-1 href=#__codelineno-18-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/consume?state=true"</span>
|
|
</code></pre></div> <h3 id=set-repeat-mode>Set repeat mode<a class=headerlink href=#set-repeat-mode title="Permanent link">¶</a></h3> <p>Change repeat mode</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-19-1 name=__codelineno-19-1 href=#__codelineno-19-1></a><span class=err>PUT /api/player/repeat</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>state</td> <td>The new repeat mode, should be either <code>off</code>, <code>all</code> or <code>single</code></td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-20-1 name=__codelineno-20-1 href=#__codelineno-20-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/repeat?state=all"</span>
|
|
</code></pre></div> <h3 id=set-volume>Set volume<a class=headerlink href=#set-volume title="Permanent link">¶</a></h3> <p>Change master volume or volume of a specific output.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-21-1 name=__codelineno-21-1 href=#__codelineno-21-1></a><span class=err>PUT /api/player/volume</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>volume</td> <td>The new volume (0 - 100)</td> </tr> <tr> <td>step</td> <td>The increase or decrease volume by the given amount (-100 - 100)</td> </tr> <tr> <td>output_id</td> <td><em>(Optional)</em> If an output id is given, only the volume of this output will be changed. If parameter is omitted, the master volume will be changed.</td> </tr> </tbody> </table> <p>Either <code>volume</code> or <code>step</code> must be present as query parameter</p> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-22-1 name=__codelineno-22-1 href=#__codelineno-22-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/volume?volume=50"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-23-1 name=__codelineno-23-1 href=#__codelineno-23-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/volume?step=-5"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-24-1 name=__codelineno-24-1 href=#__codelineno-24-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/volume?volume=50&output_id=0"</span>
|
|
</code></pre></div> <h3 id=seek>Seek<a class=headerlink href=#seek title="Permanent link">¶</a></h3> <p>Seek to a position in the currently playing track.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-25-1 name=__codelineno-25-1 href=#__codelineno-25-1></a><span class=err>PUT /api/player/seek</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>position_ms</td> <td>The new position in milliseconds to seek to</td> </tr> <tr> <td>seek_ms</td> <td>A relative amount of milliseconds to seek to</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <p>Seek to position:</p> <div class=highlight><pre><span></span><code><a id=__codelineno-26-1 name=__codelineno-26-1 href=#__codelineno-26-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/seek?position_ms=2000"</span>
|
|
</code></pre></div> <p>Relative seeking (skip 30 seconds backwards):</p> <div class=highlight><pre><span></span><code><a id=__codelineno-27-1 name=__codelineno-27-1 href=#__codelineno-27-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/player/seek?seek_ms=-30000"</span>
|
|
</code></pre></div> <h2 id=outputs>Outputs<a class=headerlink href=#outputs title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#get-a-list-of-available-outputs>/api/outputs</a></td> <td>Get a list of available outputs</td> </tr> <tr> <td>PUT</td> <td><a href=#set-enabled-outputs>/api/outputs/set</a></td> <td>Set enabled outputs</td> </tr> <tr> <td>GET</td> <td><a href=#get-an-output>/api/outputs/{id}</a></td> <td>Get an output</td> </tr> <tr> <td>PUT</td> <td><a href=#change-an-output>/api/outputs/{id}</a></td> <td>Change an output setting</td> </tr> <tr> <td>PUT</td> <td><a href=#toggle-an-output>/api/outputs/{id}/toggle</a></td> <td>Enable or disable an output, depending on the current state</td> </tr> </tbody> </table> <h3 id=get-a-list-of-available-outputs>Get a list of available outputs<a class=headerlink href=#get-a-list-of-available-outputs title="Permanent link">¶</a></h3> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-28-1 name=__codelineno-28-1 href=#__codelineno-28-1></a><span class=err>GET /api/outputs</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>outputs</td> <td>array</td> <td>Array of <code>output</code> objects</td> </tr> </tbody> </table> <p><strong><code>output</code> object</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>Output id</td> </tr> <tr> <td>name</td> <td>string</td> <td>Output name</td> </tr> <tr> <td>type</td> <td>string</td> <td>Type of the output: <code>AirPlay</code>, <code>Chromecast</code>, <code>ALSA</code>, <code>Pulseaudio</code>, <code>fifo</code></td> </tr> <tr> <td>selected</td> <td>boolean</td> <td><code>true</code> if output is enabled</td> </tr> <tr> <td>has_password</td> <td>boolean</td> <td><code>true</code> if output is password protected</td> </tr> <tr> <td>requires_auth</td> <td>boolean</td> <td><code>true</code> if output requires authentication</td> </tr> <tr> <td>needs_auth_key</td> <td>boolean</td> <td><code>true</code> if output requires an authorization key (device verification)</td> </tr> <tr> <td>volume</td> <td>integer</td> <td>Volume in percent (0 - 100)</td> </tr> <tr> <td>format</td> <td>string</td> <td>Stream format</td> </tr> <tr> <td>supported_formats</td> <td>array</td> <td>Array of formats supported by output</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-29-1 name=__codelineno-29-1 href=#__codelineno-29-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/outputs"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-30-1 name=__codelineno-30-1 href=#__codelineno-30-1></a><span class=p>{</span>
|
|
<a id=__codelineno-30-2 name=__codelineno-30-2 href=#__codelineno-30-2></a><span class=w> </span><span class=nt>"outputs"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-30-3 name=__codelineno-30-3 href=#__codelineno-30-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-30-4 name=__codelineno-30-4 href=#__codelineno-30-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"123456789012345"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-5 name=__codelineno-30-5 href=#__codelineno-30-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"kitchen"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-6 name=__codelineno-30-6 href=#__codelineno-30-6></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=s2>"AirPlay"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-7 name=__codelineno-30-7 href=#__codelineno-30-7></a><span class=w> </span><span class=nt>"selected"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=p>,</span>
|
|
<a id=__codelineno-30-8 name=__codelineno-30-8 href=#__codelineno-30-8></a><span class=w> </span><span class=nt>"has_password"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-9 name=__codelineno-30-9 href=#__codelineno-30-9></a><span class=w> </span><span class=nt>"requires_auth"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-10 name=__codelineno-30-10 href=#__codelineno-30-10></a><span class=w> </span><span class=nt>"needs_auth_key"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-11 name=__codelineno-30-11 href=#__codelineno-30-11></a><span class=w> </span><span class=nt>"volume"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-30-12 name=__codelineno-30-12 href=#__codelineno-30-12></a><span class=w> </span><span class=nt>"format"</span><span class=p>:</span><span class=w> </span><span class=s2>"alac"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-13 name=__codelineno-30-13 href=#__codelineno-30-13></a><span class=w> </span><span class=nt>"supported_formats"</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=w> </span><span class=s2>"alac"</span><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-30-14 name=__codelineno-30-14 href=#__codelineno-30-14></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-30-15 name=__codelineno-30-15 href=#__codelineno-30-15></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-30-16 name=__codelineno-30-16 href=#__codelineno-30-16></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"0"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-17 name=__codelineno-30-17 href=#__codelineno-30-17></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Computer"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-18 name=__codelineno-30-18 href=#__codelineno-30-18></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=s2>"ALSA"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-19 name=__codelineno-30-19 href=#__codelineno-30-19></a><span class=w> </span><span class=nt>"selected"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=p>,</span>
|
|
<a id=__codelineno-30-20 name=__codelineno-30-20 href=#__codelineno-30-20></a><span class=w> </span><span class=nt>"has_password"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-21 name=__codelineno-30-21 href=#__codelineno-30-21></a><span class=w> </span><span class=nt>"requires_auth"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-22 name=__codelineno-30-22 href=#__codelineno-30-22></a><span class=w> </span><span class=nt>"needs_auth_key"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-23 name=__codelineno-30-23 href=#__codelineno-30-23></a><span class=w> </span><span class=nt>"volume"</span><span class=p>:</span><span class=w> </span><span class=mi>19</span><span class=p>,</span>
|
|
<a id=__codelineno-30-24 name=__codelineno-30-24 href=#__codelineno-30-24></a><span class=w> </span><span class=nt>"format"</span><span class=p>:</span><span class=w> </span><span class=s2>"pcm"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-25 name=__codelineno-30-25 href=#__codelineno-30-25></a><span class=w> </span><span class=nt>"supported_formats"</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=w> </span><span class=s2>"pcm"</span><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-30-26 name=__codelineno-30-26 href=#__codelineno-30-26></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-30-27 name=__codelineno-30-27 href=#__codelineno-30-27></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-30-28 name=__codelineno-30-28 href=#__codelineno-30-28></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"100"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-29 name=__codelineno-30-29 href=#__codelineno-30-29></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"daapd-fifo"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-30 name=__codelineno-30-30 href=#__codelineno-30-30></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=s2>"fifo"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-31 name=__codelineno-30-31 href=#__codelineno-30-31></a><span class=w> </span><span class=nt>"selected"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-32 name=__codelineno-30-32 href=#__codelineno-30-32></a><span class=w> </span><span class=nt>"has_password"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-33 name=__codelineno-30-33 href=#__codelineno-30-33></a><span class=w> </span><span class=nt>"requires_auth"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-34 name=__codelineno-30-34 href=#__codelineno-30-34></a><span class=w> </span><span class=nt>"needs_auth_key"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-30-35 name=__codelineno-30-35 href=#__codelineno-30-35></a><span class=w> </span><span class=nt>"volume"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-30-36 name=__codelineno-30-36 href=#__codelineno-30-36></a><span class=w> </span><span class=nt>"format"</span><span class=p>:</span><span class=w> </span><span class=s2>"pcm"</span><span class=p>,</span>
|
|
<a id=__codelineno-30-37 name=__codelineno-30-37 href=#__codelineno-30-37></a><span class=w> </span><span class=nt>"supported_formats"</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=w> </span><span class=s2>"pcm"</span><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-30-38 name=__codelineno-30-38 href=#__codelineno-30-38></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-30-39 name=__codelineno-30-39 href=#__codelineno-30-39></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-30-40 name=__codelineno-30-40 href=#__codelineno-30-40></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=set-enabled-outputs>Set enabled outputs<a class=headerlink href=#set-enabled-outputs title="Permanent link">¶</a></h3> <p>Set the enabled outputs by passing an array of output ids. The server enables all outputs with the given ids and disables the remaining outputs.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-31-1 name=__codelineno-31-1 href=#__codelineno-31-1></a><span class=err>PUT /api/outputs/set</span>
|
|
</code></pre></div> <p><strong>Body parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>outputs</td> <td>array</td> <td>Array of output ids</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-32-1 name=__codelineno-32-1 href=#__codelineno-32-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/outputs/set"</span><span class=w> </span>--data<span class=w> </span><span class=s2>"{\"outputs\":[\"198018693182577\",\"0\"]}"</span>
|
|
</code></pre></div> <h3 id=get-an-output>Get an output<a class=headerlink href=#get-an-output title="Permanent link">¶</a></h3> <p>Get an output</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-33-1 name=__codelineno-33-1 href=#__codelineno-33-1></a><span class=err>GET /api/outputs/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Output id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <strong><code>output</code> object</strong>.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-34-1 name=__codelineno-34-1 href=#__codelineno-34-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/outputs/0"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-35-1 name=__codelineno-35-1 href=#__codelineno-35-1></a><span class=p>{</span>
|
|
<a id=__codelineno-35-2 name=__codelineno-35-2 href=#__codelineno-35-2></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"0"</span><span class=p>,</span>
|
|
<a id=__codelineno-35-3 name=__codelineno-35-3 href=#__codelineno-35-3></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Computer"</span><span class=p>,</span>
|
|
<a id=__codelineno-35-4 name=__codelineno-35-4 href=#__codelineno-35-4></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=s2>"ALSA"</span><span class=p>,</span>
|
|
<a id=__codelineno-35-5 name=__codelineno-35-5 href=#__codelineno-35-5></a><span class=w> </span><span class=nt>"selected"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=p>,</span>
|
|
<a id=__codelineno-35-6 name=__codelineno-35-6 href=#__codelineno-35-6></a><span class=w> </span><span class=nt>"has_password"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-35-7 name=__codelineno-35-7 href=#__codelineno-35-7></a><span class=w> </span><span class=nt>"requires_auth"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-35-8 name=__codelineno-35-8 href=#__codelineno-35-8></a><span class=w> </span><span class=nt>"needs_auth_key"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-35-9 name=__codelineno-35-9 href=#__codelineno-35-9></a><span class=w> </span><span class=nt>"volume"</span><span class=p>:</span><span class=w> </span><span class=mi>3</span>
|
|
<a id=__codelineno-35-10 name=__codelineno-35-10 href=#__codelineno-35-10></a><span class=w> </span><span class=nt>"format"</span><span class=p>:</span><span class=w> </span><span class=s2>"pcm"</span><span class=p>,</span>
|
|
<a id=__codelineno-35-11 name=__codelineno-35-11 href=#__codelineno-35-11></a><span class=w> </span><span class=nt>"supported_formats"</span><span class=p>:</span><span class=w> </span><span class=p>[</span><span class=w> </span><span class=s2>"pcm"</span><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-35-12 name=__codelineno-35-12 href=#__codelineno-35-12></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=change-an-output>Change an output<a class=headerlink href=#change-an-output title="Permanent link">¶</a></h3> <p>Enable or disable an output and change its volume.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-36-1 name=__codelineno-36-1 href=#__codelineno-36-1></a><span class=err>PUT /api/outputs/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Output id</td> </tr> </tbody> </table> <p><strong>Body parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>selected</td> <td>boolean</td> <td><em>(Optional)</em> <code>true</code> to enable and <code>false</code> to disable the output</td> </tr> <tr> <td>volume</td> <td>integer</td> <td><em>(Optional)</em> Volume in percent (0 - 100)</td> </tr> <tr> <td>pin</td> <td>string</td> <td><em>(Optional)</em> PIN for device verification</td> </tr> <tr> <td>format</td> <td>string</td> <td><em>(Optional)</em> Stream format</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-37-1 name=__codelineno-37-1 href=#__codelineno-37-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/outputs/0"</span><span class=w> </span>--data<span class=w> </span><span class=s2>"{\"selected\":true, \"volume\": 50}"</span>
|
|
</code></pre></div> <h3 id=toggle-an-output>Toggle an output<a class=headerlink href=#toggle-an-output title="Permanent link">¶</a></h3> <p>Enable or disable an output, depending on its current state</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-38-1 name=__codelineno-38-1 href=#__codelineno-38-1></a><span class=err>PUT /api/outputs/{id}/toggle</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Output id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-39-1 name=__codelineno-39-1 href=#__codelineno-39-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/outputs/0/toggle"</span>
|
|
</code></pre></div> <h2 id=queue>Queue<a class=headerlink href=#queue title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#list-queue-items>/api/queue</a></td> <td>Get a list of queue items</td> </tr> <tr> <td>PUT</td> <td><a href=#clearing-the-queue>/api/queue/clear</a></td> <td>Remove all items from the queue</td> </tr> <tr> <td>POST</td> <td><a href=#adding-items-to-the-queue>/api/queue/items/add</a></td> <td>Add items to the queue</td> </tr> <tr> <td>PUT</td> <td><a href=#updating-a-queue-item>/api/queue/items/{id}|now_playing</a></td> <td>Updating a queue item in the queue</td> </tr> <tr> <td>DELETE</td> <td><a href=#removing-a-queue-item>/api/queue/items/{id}</a></td> <td>Remove a queue item from the queue</td> </tr> </tbody> </table> <h3 id=list-queue-items>List queue items<a class=headerlink href=#list-queue-items title="Permanent link">¶</a></h3> <p>Lists the items in the current queue</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-40-1 name=__codelineno-40-1 href=#__codelineno-40-1></a><span class=err>GET /api/queue</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td><em>(Optional)</em> If a queue item id is given, only the item with the id will be returned. Use id=now_playing to get the currently playing item.</td> </tr> <tr> <td>start</td> <td><em>(Optional)</em> If a <code>start</code>and an <code>end</code> position is given, only the items from <code>start</code> (included) to <code>end</code> (excluded) will be returned. If only a <code>start</code> position is given, only the item at this position will be returned.</td> </tr> <tr> <td>end</td> <td><em>(Optional)</em> See <code>start</code> parameter</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>version</td> <td>integer</td> <td>Version number of the current queue</td> </tr> <tr> <td>count</td> <td>integer</td> <td>Number of items in the current queue</td> </tr> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#queue-item-object><code>queue item</code></a> objects</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-41-1 name=__codelineno-41-1 href=#__codelineno-41-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/queue"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-42-1 name=__codelineno-42-1 href=#__codelineno-42-1></a><span class=p>{</span>
|
|
<a id=__codelineno-42-2 name=__codelineno-42-2 href=#__codelineno-42-2></a><span class=w> </span><span class=nt>"version"</span><span class=p>:</span><span class=w> </span><span class=mi>833</span><span class=p>,</span>
|
|
<a id=__codelineno-42-3 name=__codelineno-42-3 href=#__codelineno-42-3></a><span class=w> </span><span class=nt>"count"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-42-4 name=__codelineno-42-4 href=#__codelineno-42-4></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-42-5 name=__codelineno-42-5 href=#__codelineno-42-5></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-42-6 name=__codelineno-42-6 href=#__codelineno-42-6></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>12122</span><span class=p>,</span>
|
|
<a id=__codelineno-42-7 name=__codelineno-42-7 href=#__codelineno-42-7></a><span class=w> </span><span class=nt>"position"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-42-8 name=__codelineno-42-8 href=#__codelineno-42-8></a><span class=w> </span><span class=nt>"track_id"</span><span class=p>:</span><span class=w> </span><span class=mi>10749</span><span class=p>,</span>
|
|
<a id=__codelineno-42-9 name=__codelineno-42-9 href=#__codelineno-42-9></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Angels"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-10 name=__codelineno-42-10 href=#__codelineno-42-10></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-11 name=__codelineno-42-11 href=#__codelineno-42-11></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-12 name=__codelineno-42-12 href=#__codelineno-42-12></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-13 name=__codelineno-42-13 href=#__codelineno-42-13></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-14 name=__codelineno-42-14 href=#__codelineno-42-14></a><span class=w> </span><span class=nt>"albumartist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-15 name=__codelineno-42-15 href=#__codelineno-42-15></a><span class=w> </span><span class=nt>"albumartist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-16 name=__codelineno-42-16 href=#__codelineno-42-16></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Indie Rock"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-17 name=__codelineno-42-17 href=#__codelineno-42-17></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2012</span><span class=p>,</span>
|
|
<a id=__codelineno-42-18 name=__codelineno-42-18 href=#__codelineno-42-18></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-42-19 name=__codelineno-42-19 href=#__codelineno-42-19></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-42-20 name=__codelineno-42-20 href=#__codelineno-42-20></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>171735</span><span class=p>,</span>
|
|
<a id=__codelineno-42-21 name=__codelineno-42-21 href=#__codelineno-42-21></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-22 name=__codelineno-42-22 href=#__codelineno-42-22></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-23 name=__codelineno-42-23 href=#__codelineno-42-23></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/The xx/Coexist/01 Angels.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-42-24 name=__codelineno-42-24 href=#__codelineno-42-24></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:10749"</span>
|
|
<a id=__codelineno-42-25 name=__codelineno-42-25 href=#__codelineno-42-25></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-42-26 name=__codelineno-42-26 href=#__codelineno-42-26></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-42-27 name=__codelineno-42-27 href=#__codelineno-42-27></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-42-28 name=__codelineno-42-28 href=#__codelineno-42-28></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=clearing-the-queue>Clearing the queue<a class=headerlink href=#clearing-the-queue title="Permanent link">¶</a></h3> <p>Remove all items form the current queue</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-43-1 name=__codelineno-43-1 href=#__codelineno-43-1></a><span class=err>PUT /api/queue/clear</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-44-1 name=__codelineno-44-1 href=#__codelineno-44-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/clear"</span>
|
|
</code></pre></div> <h3 id=adding-items-to-the-queue>Adding items to the queue<a class=headerlink href=#adding-items-to-the-queue title="Permanent link">¶</a></h3> <p>Add tracks, playlists artists or albums to the current queue</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-45-1 name=__codelineno-45-1 href=#__codelineno-45-1></a><span class=err>POST /api/queue/items/add</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>uris</td> <td>Comma separated list of resource identifiers (<code>track</code>, <code>playlist</code>, <code>artist</code> or <code>album</code> object <code>uri</code>)</td> </tr> <tr> <td>expression</td> <td>A smart playlist query expression identifying the tracks that will be added to the queue.</td> </tr> <tr> <td>position</td> <td><em>(Optional)</em> If a position is given, new items are inserted starting from this position into the queue.</td> </tr> <tr> <td>playback</td> <td><em>(Optional)</em> If the <code>playback</code> parameter is set to <code>start</code>, playback will be started after adding the new items.</td> </tr> <tr> <td>playback_from_position</td> <td><em>(Optional)</em> If the <code>playback</code> parameter is set to <code>start</code>, playback will be started with the queue item at the position given in <code>playback_from_position</code>.</td> </tr> <tr> <td>clear</td> <td><em>(Optional)</em> If the <code>clear</code> parameter is set to <code>true</code>, the queue will be cleared before adding the new items.</td> </tr> <tr> <td>shuffle</td> <td><em>(Optional)</em> If the <code>shuffle</code> parameter is set to <code>true</code>, the shuffle mode is activated. If it is set to something else, the shuffle mode is deactivated. To leave the shuffle mode untouched the parameter should be omitted.</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of tracks to add</td> </tr> </tbody> </table> <p>Either the <code>uris</code> or the <code>expression</code> parameter must be set. If both are set the <code>uris</code> parameter takes precedence and the <code>expression</code> parameter will be ignored.</p> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code.</p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>version</td> <td>integer</td> <td>Version number of the current queue</td> </tr> <tr> <td>count</td> <td>integer</td> <td>Number of tracks added to the queue</td> </tr> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#queue-item-object><code>queue item</code></a> objects added</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p>Add new items by uri:</p> <div class=highlight><pre><span></span><code><a id=__codelineno-46-1 name=__codelineno-46-1 href=#__codelineno-46-1></a>curl<span class=w> </span>-X<span class=w> </span>POST<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/add?uris=library:playlist:68,library:artist:2932599850102967727"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-47-1 name=__codelineno-47-1 href=#__codelineno-47-1></a><span class=p>{</span>
|
|
<a id=__codelineno-47-2 name=__codelineno-47-2 href=#__codelineno-47-2></a><span class=w> </span><span class=nt>"version"</span><span class=p>:</span><span class=w> </span><span class=mi>833</span><span class=p>,</span>
|
|
<a id=__codelineno-47-3 name=__codelineno-47-3 href=#__codelineno-47-3></a><span class=w> </span><span class=nt>"count"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-47-4 name=__codelineno-47-4 href=#__codelineno-47-4></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-47-5 name=__codelineno-47-5 href=#__codelineno-47-5></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-47-6 name=__codelineno-47-6 href=#__codelineno-47-6></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>12122</span><span class=p>,</span>
|
|
<a id=__codelineno-47-7 name=__codelineno-47-7 href=#__codelineno-47-7></a><span class=w> </span><span class=nt>"position"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-47-8 name=__codelineno-47-8 href=#__codelineno-47-8></a><span class=w> </span><span class=nt>"track_id"</span><span class=p>:</span><span class=w> </span><span class=mi>10749</span><span class=p>,</span>
|
|
<a id=__codelineno-47-9 name=__codelineno-47-9 href=#__codelineno-47-9></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Angels"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-10 name=__codelineno-47-10 href=#__codelineno-47-10></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-11 name=__codelineno-47-11 href=#__codelineno-47-11></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-12 name=__codelineno-47-12 href=#__codelineno-47-12></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-13 name=__codelineno-47-13 href=#__codelineno-47-13></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-14 name=__codelineno-47-14 href=#__codelineno-47-14></a><span class=w> </span><span class=nt>"albumartist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-15 name=__codelineno-47-15 href=#__codelineno-47-15></a><span class=w> </span><span class=nt>"albumartist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-16 name=__codelineno-47-16 href=#__codelineno-47-16></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Indie Rock"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-17 name=__codelineno-47-17 href=#__codelineno-47-17></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2012</span><span class=p>,</span>
|
|
<a id=__codelineno-47-18 name=__codelineno-47-18 href=#__codelineno-47-18></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-47-19 name=__codelineno-47-19 href=#__codelineno-47-19></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-47-20 name=__codelineno-47-20 href=#__codelineno-47-20></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>171735</span><span class=p>,</span>
|
|
<a id=__codelineno-47-21 name=__codelineno-47-21 href=#__codelineno-47-21></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-22 name=__codelineno-47-22 href=#__codelineno-47-22></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-23 name=__codelineno-47-23 href=#__codelineno-47-23></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/The xx/Coexist/01 Angels.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-47-24 name=__codelineno-47-24 href=#__codelineno-47-24></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:10749"</span>
|
|
<a id=__codelineno-47-25 name=__codelineno-47-25 href=#__codelineno-47-25></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-47-26 name=__codelineno-47-26 href=#__codelineno-47-26></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-47-27 name=__codelineno-47-27 href=#__codelineno-47-27></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-47-28 name=__codelineno-47-28 href=#__codelineno-47-28></a><span class=p>}</span>
|
|
</code></pre></div> <p>Add new items by query language:</p> <div class=highlight><pre><span></span><code><a id=__codelineno-48-1 name=__codelineno-48-1 href=#__codelineno-48-1></a>curl<span class=w> </span>-X<span class=w> </span>POST<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/add?expression=media_kind+is+music"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-49-1 name=__codelineno-49-1 href=#__codelineno-49-1></a><span class=p>{</span>
|
|
<a id=__codelineno-49-2 name=__codelineno-49-2 href=#__codelineno-49-2></a><span class=w> </span><span class=nt>"version"</span><span class=p>:</span><span class=w> </span><span class=mi>833</span><span class=p>,</span>
|
|
<a id=__codelineno-49-3 name=__codelineno-49-3 href=#__codelineno-49-3></a><span class=w> </span><span class=nt>"count"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-49-4 name=__codelineno-49-4 href=#__codelineno-49-4></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-49-5 name=__codelineno-49-5 href=#__codelineno-49-5></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-49-6 name=__codelineno-49-6 href=#__codelineno-49-6></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>12122</span><span class=p>,</span>
|
|
<a id=__codelineno-49-7 name=__codelineno-49-7 href=#__codelineno-49-7></a><span class=w> </span><span class=nt>"position"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-49-8 name=__codelineno-49-8 href=#__codelineno-49-8></a><span class=w> </span><span class=nt>"track_id"</span><span class=p>:</span><span class=w> </span><span class=mi>10749</span><span class=p>,</span>
|
|
<a id=__codelineno-49-9 name=__codelineno-49-9 href=#__codelineno-49-9></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Angels"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-10 name=__codelineno-49-10 href=#__codelineno-49-10></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-11 name=__codelineno-49-11 href=#__codelineno-49-11></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-12 name=__codelineno-49-12 href=#__codelineno-49-12></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-13 name=__codelineno-49-13 href=#__codelineno-49-13></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Coexist"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-14 name=__codelineno-49-14 href=#__codelineno-49-14></a><span class=w> </span><span class=nt>"albumartist"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-15 name=__codelineno-49-15 href=#__codelineno-49-15></a><span class=w> </span><span class=nt>"albumartist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-16 name=__codelineno-49-16 href=#__codelineno-49-16></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Indie Rock"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-17 name=__codelineno-49-17 href=#__codelineno-49-17></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2012</span><span class=p>,</span>
|
|
<a id=__codelineno-49-18 name=__codelineno-49-18 href=#__codelineno-49-18></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-49-19 name=__codelineno-49-19 href=#__codelineno-49-19></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-49-20 name=__codelineno-49-20 href=#__codelineno-49-20></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>171735</span><span class=p>,</span>
|
|
<a id=__codelineno-49-21 name=__codelineno-49-21 href=#__codelineno-49-21></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-22 name=__codelineno-49-22 href=#__codelineno-49-22></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-23 name=__codelineno-49-23 href=#__codelineno-49-23></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/The xx/Coexist/01 Angels.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-49-24 name=__codelineno-49-24 href=#__codelineno-49-24></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:10749"</span>
|
|
<a id=__codelineno-49-25 name=__codelineno-49-25 href=#__codelineno-49-25></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-49-26 name=__codelineno-49-26 href=#__codelineno-49-26></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-49-27 name=__codelineno-49-27 href=#__codelineno-49-27></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-49-28 name=__codelineno-49-28 href=#__codelineno-49-28></a><span class=p>}</span>
|
|
</code></pre></div> <p>Clear current queue, add 10 new random tracks of <code>genre</code> <em>Pop</em> and start playback</p> <div class=highlight><pre><span></span><code><a id=__codelineno-50-1 name=__codelineno-50-1 href=#__codelineno-50-1></a>curl<span class=w> </span>-X<span class=w> </span>POST<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/add?limit=10&clear=true&playback=start&expression=genre+is+%22Pop%22+order+by+random+desc"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-51-1 name=__codelineno-51-1 href=#__codelineno-51-1></a><span class=p>{</span>
|
|
<a id=__codelineno-51-2 name=__codelineno-51-2 href=#__codelineno-51-2></a><span class=w> </span><span class=nt>"count"</span><span class=p>:</span><span class=w> </span><span class=mi>10</span>
|
|
<a id=__codelineno-51-3 name=__codelineno-51-3 href=#__codelineno-51-3></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=updating-a-queue-item>Updating a queue item<a class=headerlink href=#updating-a-queue-item title="Permanent link">¶</a></h3> <p>Update or move a queue item in the current queue</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-52-1 name=__codelineno-52-1 href=#__codelineno-52-1></a><span class=err>PUT /api/queue/items/{id}</span>
|
|
</code></pre></div> <p>or</p> <div class=highlight><pre><span></span><code><a id=__codelineno-53-1 name=__codelineno-53-1 href=#__codelineno-53-1></a><span class=err>PUT /api/queue/items/now_playing</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Queue item id</td> </tr> </tbody> </table> <p>(or use now_playing to update the track currently playing)</p> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>new_position</td> <td>The new position for the queue item in the current queue.</td> </tr> <tr> <td>title</td> <td>New track title</td> </tr> <tr> <td>album</td> <td>New album title</td> </tr> <tr> <td>artist</td> <td>New artist</td> </tr> <tr> <td>album_artist</td> <td>New album artist</td> </tr> <tr> <td>composer</td> <td>New composer</td> </tr> <tr> <td>genre</td> <td>New genre</td> </tr> <tr> <td>artwork_url</td> <td>New URL to track artwork</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-54-1 name=__codelineno-54-1 href=#__codelineno-54-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/3?new_position=0"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-55-1 name=__codelineno-55-1 href=#__codelineno-55-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/3?title=Awesome%20title&artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-56-1 name=__codelineno-56-1 href=#__codelineno-56-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/now_playing?title=Awesome%20title&artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg"</span>
|
|
</code></pre></div> <h3 id=removing-a-queue-item>Removing a queue item<a class=headerlink href=#removing-a-queue-item title="Permanent link">¶</a></h3> <p>Remove a queue item from the current queue</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-57-1 name=__codelineno-57-1 href=#__codelineno-57-1></a><span class=err>DELETE /api/queue/items/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Queue item id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-58-1 name=__codelineno-58-1 href=#__codelineno-58-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/queue/items/2"</span>
|
|
</code></pre></div> <h2 id=library>Library<a class=headerlink href=#library title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#library-information>/api/library</a></td> <td>Get library information</td> </tr> <tr> <td>GET</td> <td><a href=#list-playlists>/api/library/playlists</a></td> <td>Get a list of playlists</td> </tr> <tr> <td>GET</td> <td><a href=#get-a-playlist>/api/library/playlists/{id}</a></td> <td>Get a playlist</td> </tr> <tr> <td>PUT</td> <td><a href=#update-a-playlist>/api/library/playlists/{id}</a></td> <td>Update a playlist attribute</td> </tr> <tr> <td>DELETE</td> <td><a href=#delete-a-playlist>/api/library/playlists/{id}</a></td> <td>Delete a playlist</td> </tr> <tr> <td>GET</td> <td><a href=#list-playlist-tracks>/api/library/playlists/{id}/tracks</a></td> <td>Get list of tracks for a playlist</td> </tr> <tr> <td>PUT</td> <td><a href=#update-playlist-tracks>/api/library/playlists/{id}/tracks</a></td> <td>Update play count of tracks for a playlist</td> </tr> <tr> <td>GET</td> <td><a href=#list-playlists-in-a-playlist-folder>/api/library/playlists/{id}/playlists</a></td> <td>Get list of playlists for a playlist folder</td> </tr> <tr> <td>GET</td> <td><a href=#list-artists>/api/library/artists</a></td> <td>Get a list of artists</td> </tr> <tr> <td>GET</td> <td><a href=#get-an-artist>/api/library/artists/{id}</a></td> <td>Get an artist</td> </tr> <tr> <td>GET</td> <td><a href=#list-artist-albums>/api/library/artists/{id}/albums</a></td> <td>Get list of albums for an artist</td> </tr> <tr> <td>GET</td> <td><a href=#list-albums>/api/library/albums</a></td> <td>Get a list of albums</td> </tr> <tr> <td>GET</td> <td><a href=#get-an-album>/api/library/albums/{id}</a></td> <td>Get an album</td> </tr> <tr> <td>GET</td> <td><a href=#list-album-tracks>/api/library/albums/{id}/tracks</a></td> <td>Get list of tracks for an album</td> </tr> <tr> <td>GET</td> <td><a href=#get-a-track>/api/library/tracks/{id}</a></td> <td>Get a track</td> </tr> <tr> <td>GET</td> <td><a href=#list-playlists-for-a-track>/api/library/tracks/{id}/playlists</a></td> <td>Get list of playlists for a track</td> </tr> <tr> <td>PUT</td> <td><a href=#update-track-properties>/api/library/tracks</a></td> <td>Update multiple track properties</td> </tr> <tr> <td>PUT</td> <td><a href=#update-track-properties>/api/library/tracks/{id}</a></td> <td>Update single track properties</td> </tr> <tr> <td>GET</td> <td><a href=#list-genres>/api/library/genres</a></td> <td>Get list of genres</td> </tr> <tr> <td>GET</td> <td><a href=#get-count-of-tracks-artists-and-albums>/api/library/count</a></td> <td>Get count of tracks, artists and albums</td> </tr> <tr> <td>GET</td> <td><a href=#list-local-directories>/api/library/files</a></td> <td>Get list of directories in the local library</td> </tr> <tr> <td>POST</td> <td><a href=#add-an-item-to-the-library>/api/library/add</a></td> <td>Add an item to the library</td> </tr> <tr> <td>PUT</td> <td><a href=#trigger-rescan>/api/update</a></td> <td>Trigger a library rescan</td> </tr> <tr> <td>PUT</td> <td><a href=#trigger-metadata-rescan>/api/rescan</a></td> <td>Trigger a library metadata rescan</td> </tr> <tr> <td>PUT</td> <td><a href=#backup-db>/api/library/backup</a></td> <td>Request library backup db</td> </tr> </tbody> </table> <h3 id=library-information>Library information<a class=headerlink href=#library-information title="Permanent link">¶</a></h3> <p>List some library stats</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-59-1 name=__codelineno-59-1 href=#__codelineno-59-1></a><span class=err>GET /api/library</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>songs</td> <td>integer</td> <td>Array of <a href=#playlist-object><code>playlist</code></a> objects</td> </tr> <tr> <td>db_playtime</td> <td>integer</td> <td>Total playtime of all songs in the library</td> </tr> <tr> <td>artists</td> <td>integer</td> <td>Number of album artists in the library</td> </tr> <tr> <td>albums</td> <td>integer</td> <td>Number of albums in the library</td> </tr> <tr> <td>started_at</td> <td>string</td> <td>Server startup time (timestamp in <code>ISO 8601</code> format)</td> </tr> <tr> <td>updated_at</td> <td>string</td> <td>Last library update (timestamp in <code>ISO 8601</code> format)</td> </tr> <tr> <td>updating</td> <td>boolean</td> <td><code>true</code> if library rescan is in progress</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-60-1 name=__codelineno-60-1 href=#__codelineno-60-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-61-1 name=__codelineno-61-1 href=#__codelineno-61-1></a><span class=p>{</span>
|
|
<a id=__codelineno-61-2 name=__codelineno-61-2 href=#__codelineno-61-2></a><span class=w> </span><span class=nt>"songs"</span><span class=p>:</span><span class=w> </span><span class=mi>217</span><span class=p>,</span>
|
|
<a id=__codelineno-61-3 name=__codelineno-61-3 href=#__codelineno-61-3></a><span class=w> </span><span class=nt>"db_playtime"</span><span class=p>:</span><span class=w> </span><span class=mi>66811</span><span class=p>,</span>
|
|
<a id=__codelineno-61-4 name=__codelineno-61-4 href=#__codelineno-61-4></a><span class=w> </span><span class=nt>"artists"</span><span class=p>:</span><span class=w> </span><span class=mi>9</span><span class=p>,</span>
|
|
<a id=__codelineno-61-5 name=__codelineno-61-5 href=#__codelineno-61-5></a><span class=w> </span><span class=nt>"albums"</span><span class=p>:</span><span class=w> </span><span class=mi>19</span><span class=p>,</span>
|
|
<a id=__codelineno-61-6 name=__codelineno-61-6 href=#__codelineno-61-6></a><span class=w> </span><span class=nt>"started_at"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-11-19T19:06:08Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-61-7 name=__codelineno-61-7 href=#__codelineno-61-7></a><span class=w> </span><span class=nt>"updated_at"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-11-19T19:06:16Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-61-8 name=__codelineno-61-8 href=#__codelineno-61-8></a><span class=w> </span><span class=nt>"updating"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span>
|
|
<a id=__codelineno-61-9 name=__codelineno-61-9 href=#__codelineno-61-9></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-playlists>List playlists<a class=headerlink href=#list-playlists title="Permanent link">¶</a></h3> <p>Lists all playlists in your library (does not return playlist folders)</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-62-1 name=__codelineno-62-1 href=#__codelineno-62-1></a><span class=err>GET /api/library/playlists</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first playlist to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of playlists to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#playlist-object><code>playlist</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of playlists in the library</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first playlist</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of playlists</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-63-1 name=__codelineno-63-1 href=#__codelineno-63-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-64-1 name=__codelineno-64-1 href=#__codelineno-64-1></a><span class=p>{</span>
|
|
<a id=__codelineno-64-2 name=__codelineno-64-2 href=#__codelineno-64-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-64-3 name=__codelineno-64-3 href=#__codelineno-64-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-64-4 name=__codelineno-64-4 href=#__codelineno-64-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-64-5 name=__codelineno-64-5 href=#__codelineno-64-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"radio"</span><span class=p>,</span>
|
|
<a id=__codelineno-64-6 name=__codelineno-64-6 href=#__codelineno-64-6></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/radio.m3u"</span><span class=p>,</span>
|
|
<a id=__codelineno-64-7 name=__codelineno-64-7 href=#__codelineno-64-7></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-64-8 name=__codelineno-64-8 href=#__codelineno-64-8></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:1"</span>
|
|
<a id=__codelineno-64-9 name=__codelineno-64-9 href=#__codelineno-64-9></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-64-10 name=__codelineno-64-10 href=#__codelineno-64-10></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-64-11 name=__codelineno-64-11 href=#__codelineno-64-11></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-64-12 name=__codelineno-64-12 href=#__codelineno-64-12></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-64-13 name=__codelineno-64-13 href=#__codelineno-64-13></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-64-14 name=__codelineno-64-14 href=#__codelineno-64-14></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-64-15 name=__codelineno-64-15 href=#__codelineno-64-15></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-a-playlist>Get a playlist<a class=headerlink href=#get-a-playlist title="Permanent link">¶</a></h3> <p>Get a specific playlists in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-65-1 name=__codelineno-65-1 href=#__codelineno-65-1></a><span class=err>GET /api/library/playlists/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <strong><a href=#playlist-object><code>playlist</code></a> object</strong>.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-66-1 name=__codelineno-66-1 href=#__codelineno-66-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/1"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-67-1 name=__codelineno-67-1 href=#__codelineno-67-1></a><span class=p>{</span>
|
|
<a id=__codelineno-67-2 name=__codelineno-67-2 href=#__codelineno-67-2></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-67-3 name=__codelineno-67-3 href=#__codelineno-67-3></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"radio"</span><span class=p>,</span>
|
|
<a id=__codelineno-67-4 name=__codelineno-67-4 href=#__codelineno-67-4></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/radio.m3u"</span><span class=p>,</span>
|
|
<a id=__codelineno-67-5 name=__codelineno-67-5 href=#__codelineno-67-5></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-67-6 name=__codelineno-67-6 href=#__codelineno-67-6></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:1"</span>
|
|
<a id=__codelineno-67-7 name=__codelineno-67-7 href=#__codelineno-67-7></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=update-a-playlist>Update a playlist<a class=headerlink href=#update-a-playlist title="Permanent link">¶</a></h3> <p>Update attributes of a specific playlists in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-68-1 name=__codelineno-68-1 href=#__codelineno-68-1></a><span class=err>PUT /api/library/playlists/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>query_limit</td> <td>For RSS feeds, this sets how many podcasts to retrieve</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-69-1 name=__codelineno-69-1 href=#__codelineno-69-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/25?query_limit=20"</span>
|
|
</code></pre></div> <h3 id=delete-a-playlist>Delete a playlist<a class=headerlink href=#delete-a-playlist title="Permanent link">¶</a></h3> <p>Delete a playlist, e.g. a RSS feed</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-70-1 name=__codelineno-70-1 href=#__codelineno-70-1></a><span class=err>DELETE /api/library/playlists/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-71-1 name=__codelineno-71-1 href=#__codelineno-71-1></a>curl<span class=w> </span>-X<span class=w> </span>DELETE<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/25"</span>
|
|
</code></pre></div> <h3 id=list-playlist-tracks>List playlist tracks<a class=headerlink href=#list-playlist-tracks title="Permanent link">¶</a></h3> <p>Lists the tracks in a playlists</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-72-1 name=__codelineno-72-1 href=#__codelineno-72-1></a><span class=err>GET /api/library/playlists/{id}/tracks</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first track to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of tracks to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#track-object><code>track</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of tracks in the playlist</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first track</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of tracks</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-73-1 name=__codelineno-73-1 href=#__codelineno-73-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/1/tracks"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-74-1 name=__codelineno-74-1 href=#__codelineno-74-1></a><span class=p>{</span>
|
|
<a id=__codelineno-74-2 name=__codelineno-74-2 href=#__codelineno-74-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-74-3 name=__codelineno-74-3 href=#__codelineno-74-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-74-4 name=__codelineno-74-4 href=#__codelineno-74-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>10766</span><span class=p>,</span>
|
|
<a id=__codelineno-74-5 name=__codelineno-74-5 href=#__codelineno-74-5></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-6 name=__codelineno-74-6 href=#__codelineno-74-6></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-7 name=__codelineno-74-7 href=#__codelineno-74-7></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-8 name=__codelineno-74-8 href=#__codelineno-74-8></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-9 name=__codelineno-74-9 href=#__codelineno-74-9></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-10 name=__codelineno-74-10 href=#__codelineno-74-10></a><span class=w> </span><span class=nt>"albumartist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-11 name=__codelineno-74-11 href=#__codelineno-74-11></a><span class=w> </span><span class=nt>"albumartist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-12 name=__codelineno-74-12 href=#__codelineno-74-12></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Electronica"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-13 name=__codelineno-74-13 href=#__codelineno-74-13></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2014</span><span class=p>,</span>
|
|
<a id=__codelineno-74-14 name=__codelineno-74-14 href=#__codelineno-74-14></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-74-15 name=__codelineno-74-15 href=#__codelineno-74-15></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-74-16 name=__codelineno-74-16 href=#__codelineno-74-16></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>223085</span><span class=p>,</span>
|
|
<a id=__codelineno-74-17 name=__codelineno-74-17 href=#__codelineno-74-17></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-74-18 name=__codelineno-74-18 href=#__codelineno-74-18></a><span class=w> </span><span class=nt>"skip_count"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-74-19 name=__codelineno-74-19 href=#__codelineno-74-19></a><span class=w> </span><span class=nt>"time_played"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-02-23T10:31:20Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-20 name=__codelineno-74-20 href=#__codelineno-74-20></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-21 name=__codelineno-74-21 href=#__codelineno-74-21></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-22 name=__codelineno-74-22 href=#__codelineno-74-22></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Heinrich/Solange wir tanzen/01 Solange wir tanzen.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-74-23 name=__codelineno-74-23 href=#__codelineno-74-23></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:10766"</span>
|
|
<a id=__codelineno-74-24 name=__codelineno-74-24 href=#__codelineno-74-24></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-74-25 name=__codelineno-74-25 href=#__codelineno-74-25></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-74-26 name=__codelineno-74-26 href=#__codelineno-74-26></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-74-27 name=__codelineno-74-27 href=#__codelineno-74-27></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-74-28 name=__codelineno-74-28 href=#__codelineno-74-28></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-74-29 name=__codelineno-74-29 href=#__codelineno-74-29></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-74-30 name=__codelineno-74-30 href=#__codelineno-74-30></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=update-playlist-tracks>Update playlist tracks<a class=headerlink href=#update-playlist-tracks title="Permanent link">¶</a></h3> <p>Updates the play count for tracks in a playlists</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-75-1 name=__codelineno-75-1 href=#__codelineno-75-1></a><span class=err>PUT /api/library/playlists/{id}/tracks</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>play_count</td> <td>Either <code>increment</code>, <code>played</code> or <code>reset</code>. <code>increment</code> will increment <code>play_count</code> and update <code>time_played</code>, <code>played</code> will be like <code>increment</code> but only where <code>play_count</code> is 0, <code>reset</code> will set <code>play_count</code> and <code>skip_count</code> to zero and delete <code>time_played</code> and <code>time_skipped</code></td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-76-1 name=__codelineno-76-1 href=#__codelineno-76-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/1/tracks?play_count=played"</span>
|
|
</code></pre></div> <h3 id=list-playlists-in-a-playlist-folder>List playlists in a playlist folder<a class=headerlink href=#list-playlists-in-a-playlist-folder title="Permanent link">¶</a></h3> <p>Lists the playlists in a playlist folder</p> <p><strong>Note</strong>: The root playlist folder has <code>id</code> 0.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-77-1 name=__codelineno-77-1 href=#__codelineno-77-1></a><span class=err>GET /api/library/playlists/{id}/playlists</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Playlist id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first playlist to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of playlist to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#playlist-object><code>playlist</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of playlists in the playlist folder</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first playlist</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of playlist</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-78-1 name=__codelineno-78-1 href=#__codelineno-78-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/playlists/0/tracks"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-79-1 name=__codelineno-79-1 href=#__codelineno-79-1></a><span class=p>{</span>
|
|
<a id=__codelineno-79-2 name=__codelineno-79-2 href=#__codelineno-79-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-79-3 name=__codelineno-79-3 href=#__codelineno-79-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-79-4 name=__codelineno-79-4 href=#__codelineno-79-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>11</span><span class=p>,</span>
|
|
<a id=__codelineno-79-5 name=__codelineno-79-5 href=#__codelineno-79-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Spotify"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-6 name=__codelineno-79-6 href=#__codelineno-79-6></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"spotify:playlistfolder"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-7 name=__codelineno-79-7 href=#__codelineno-79-7></a><span class=w> </span><span class=nt>"parent_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"0"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-8 name=__codelineno-79-8 href=#__codelineno-79-8></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-79-9 name=__codelineno-79-9 href=#__codelineno-79-9></a><span class=w> </span><span class=nt>"folder"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=p>,</span>
|
|
<a id=__codelineno-79-10 name=__codelineno-79-10 href=#__codelineno-79-10></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:11"</span>
|
|
<a id=__codelineno-79-11 name=__codelineno-79-11 href=#__codelineno-79-11></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-79-12 name=__codelineno-79-12 href=#__codelineno-79-12></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-79-13 name=__codelineno-79-13 href=#__codelineno-79-13></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>8</span><span class=p>,</span>
|
|
<a id=__codelineno-79-14 name=__codelineno-79-14 href=#__codelineno-79-14></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"bytefm"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-15 name=__codelineno-79-15 href=#__codelineno-79-15></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/srv/music/Playlists/bytefm.m3u"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-16 name=__codelineno-79-16 href=#__codelineno-79-16></a><span class=w> </span><span class=nt>"parent_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"0"</span><span class=p>,</span>
|
|
<a id=__codelineno-79-17 name=__codelineno-79-17 href=#__codelineno-79-17></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-79-18 name=__codelineno-79-18 href=#__codelineno-79-18></a><span class=w> </span><span class=nt>"folder"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-79-19 name=__codelineno-79-19 href=#__codelineno-79-19></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:8"</span>
|
|
<a id=__codelineno-79-20 name=__codelineno-79-20 href=#__codelineno-79-20></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-79-21 name=__codelineno-79-21 href=#__codelineno-79-21></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-79-22 name=__codelineno-79-22 href=#__codelineno-79-22></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-79-23 name=__codelineno-79-23 href=#__codelineno-79-23></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-79-24 name=__codelineno-79-24 href=#__codelineno-79-24></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-79-25 name=__codelineno-79-25 href=#__codelineno-79-25></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-artists>List artists<a class=headerlink href=#list-artists title="Permanent link">¶</a></h3> <p>Lists the artists in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-80-1 name=__codelineno-80-1 href=#__codelineno-80-1></a><span class=err>GET /api/library/artists</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first artist to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of artists to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#artist-object><code>artist</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of artists in the library</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first artist</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of artists</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-81-1 name=__codelineno-81-1 href=#__codelineno-81-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/artists"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-82-1 name=__codelineno-82-1 href=#__codelineno-82-1></a><span class=p>{</span>
|
|
<a id=__codelineno-82-2 name=__codelineno-82-2 href=#__codelineno-82-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-82-3 name=__codelineno-82-3 href=#__codelineno-82-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-82-4 name=__codelineno-82-4 href=#__codelineno-82-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"3815427709949443149"</span><span class=p>,</span>
|
|
<a id=__codelineno-82-5 name=__codelineno-82-5 href=#__codelineno-82-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"ABAY"</span><span class=p>,</span>
|
|
<a id=__codelineno-82-6 name=__codelineno-82-6 href=#__codelineno-82-6></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"ABAY"</span><span class=p>,</span>
|
|
<a id=__codelineno-82-7 name=__codelineno-82-7 href=#__codelineno-82-7></a><span class=w> </span><span class=nt>"album_count"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-82-8 name=__codelineno-82-8 href=#__codelineno-82-8></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>10</span><span class=p>,</span>
|
|
<a id=__codelineno-82-9 name=__codelineno-82-9 href=#__codelineno-82-9></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>2951554</span><span class=p>,</span>
|
|
<a id=__codelineno-82-10 name=__codelineno-82-10 href=#__codelineno-82-10></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:artist:3815427709949443149"</span>
|
|
<a id=__codelineno-82-11 name=__codelineno-82-11 href=#__codelineno-82-11></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-82-12 name=__codelineno-82-12 href=#__codelineno-82-12></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-82-13 name=__codelineno-82-13 href=#__codelineno-82-13></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-82-14 name=__codelineno-82-14 href=#__codelineno-82-14></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-82-15 name=__codelineno-82-15 href=#__codelineno-82-15></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-82-16 name=__codelineno-82-16 href=#__codelineno-82-16></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-82-17 name=__codelineno-82-17 href=#__codelineno-82-17></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-an-artist>Get an artist<a class=headerlink href=#get-an-artist title="Permanent link">¶</a></h3> <p>Get a specific artist in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-83-1 name=__codelineno-83-1 href=#__codelineno-83-1></a><span class=err>GET /api/library/artists/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Artist id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <strong><a href=#artist-object><code>artist</code></a> object</strong>.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-84-1 name=__codelineno-84-1 href=#__codelineno-84-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/artists/3815427709949443149"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-85-1 name=__codelineno-85-1 href=#__codelineno-85-1></a><span class=p>{</span>
|
|
<a id=__codelineno-85-2 name=__codelineno-85-2 href=#__codelineno-85-2></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"3815427709949443149"</span><span class=p>,</span>
|
|
<a id=__codelineno-85-3 name=__codelineno-85-3 href=#__codelineno-85-3></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"ABAY"</span><span class=p>,</span>
|
|
<a id=__codelineno-85-4 name=__codelineno-85-4 href=#__codelineno-85-4></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"ABAY"</span><span class=p>,</span>
|
|
<a id=__codelineno-85-5 name=__codelineno-85-5 href=#__codelineno-85-5></a><span class=w> </span><span class=nt>"album_count"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-85-6 name=__codelineno-85-6 href=#__codelineno-85-6></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>10</span><span class=p>,</span>
|
|
<a id=__codelineno-85-7 name=__codelineno-85-7 href=#__codelineno-85-7></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>2951554</span><span class=p>,</span>
|
|
<a id=__codelineno-85-8 name=__codelineno-85-8 href=#__codelineno-85-8></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:artist:3815427709949443149"</span>
|
|
<a id=__codelineno-85-9 name=__codelineno-85-9 href=#__codelineno-85-9></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-artist-albums>List artist albums<a class=headerlink href=#list-artist-albums title="Permanent link">¶</a></h3> <p>Lists the albums of an artist</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-86-1 name=__codelineno-86-1 href=#__codelineno-86-1></a><span class=err>GET /api/library/artists/{id}/albums</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Artist id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first album to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of albums to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#album-object><code>album</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of albums of this artist</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first album</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of albums</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-87-1 name=__codelineno-87-1 href=#__codelineno-87-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/artists/32561671101664759/albums"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-88-1 name=__codelineno-88-1 href=#__codelineno-88-1></a><span class=p>{</span>
|
|
<a id=__codelineno-88-2 name=__codelineno-88-2 href=#__codelineno-88-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-88-3 name=__codelineno-88-3 href=#__codelineno-88-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-88-4 name=__codelineno-88-4 href=#__codelineno-88-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8009851123233197743"</span><span class=p>,</span>
|
|
<a id=__codelineno-88-5 name=__codelineno-88-5 href=#__codelineno-88-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-88-6 name=__codelineno-88-6 href=#__codelineno-88-6></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-88-7 name=__codelineno-88-7 href=#__codelineno-88-7></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Nine Inch Nails"</span><span class=p>,</span>
|
|
<a id=__codelineno-88-8 name=__codelineno-88-8 href=#__codelineno-88-8></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"32561671101664759"</span><span class=p>,</span>
|
|
<a id=__codelineno-88-9 name=__codelineno-88-9 href=#__codelineno-88-9></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>5</span><span class=p>,</span>
|
|
<a id=__codelineno-88-10 name=__codelineno-88-10 href=#__codelineno-88-10></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>1634961</span><span class=p>,</span>
|
|
<a id=__codelineno-88-11 name=__codelineno-88-11 href=#__codelineno-88-11></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:8009851123233197743"</span>
|
|
<a id=__codelineno-88-12 name=__codelineno-88-12 href=#__codelineno-88-12></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-88-13 name=__codelineno-88-13 href=#__codelineno-88-13></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-88-14 name=__codelineno-88-14 href=#__codelineno-88-14></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-88-15 name=__codelineno-88-15 href=#__codelineno-88-15></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-88-16 name=__codelineno-88-16 href=#__codelineno-88-16></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-88-17 name=__codelineno-88-17 href=#__codelineno-88-17></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-88-18 name=__codelineno-88-18 href=#__codelineno-88-18></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-albums>List albums<a class=headerlink href=#list-albums title="Permanent link">¶</a></h3> <p>Lists the albums in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-89-1 name=__codelineno-89-1 href=#__codelineno-89-1></a><span class=err>GET /api/library/albums</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first album to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of albums to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#album-object><code>album</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of albums in the library</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first albums</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of albums</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-90-1 name=__codelineno-90-1 href=#__codelineno-90-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/albums"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-91-1 name=__codelineno-91-1 href=#__codelineno-91-1></a><span class=p>{</span>
|
|
<a id=__codelineno-91-2 name=__codelineno-91-2 href=#__codelineno-91-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-91-3 name=__codelineno-91-3 href=#__codelineno-91-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-91-4 name=__codelineno-91-4 href=#__codelineno-91-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8009851123233197743"</span><span class=p>,</span>
|
|
<a id=__codelineno-91-5 name=__codelineno-91-5 href=#__codelineno-91-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-91-6 name=__codelineno-91-6 href=#__codelineno-91-6></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-91-7 name=__codelineno-91-7 href=#__codelineno-91-7></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Nine Inch Nails"</span><span class=p>,</span>
|
|
<a id=__codelineno-91-8 name=__codelineno-91-8 href=#__codelineno-91-8></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"32561671101664759"</span><span class=p>,</span>
|
|
<a id=__codelineno-91-9 name=__codelineno-91-9 href=#__codelineno-91-9></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>5</span><span class=p>,</span>
|
|
<a id=__codelineno-91-10 name=__codelineno-91-10 href=#__codelineno-91-10></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>1634961</span><span class=p>,</span>
|
|
<a id=__codelineno-91-11 name=__codelineno-91-11 href=#__codelineno-91-11></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:8009851123233197743"</span>
|
|
<a id=__codelineno-91-12 name=__codelineno-91-12 href=#__codelineno-91-12></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-91-13 name=__codelineno-91-13 href=#__codelineno-91-13></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-91-14 name=__codelineno-91-14 href=#__codelineno-91-14></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-91-15 name=__codelineno-91-15 href=#__codelineno-91-15></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-91-16 name=__codelineno-91-16 href=#__codelineno-91-16></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-91-17 name=__codelineno-91-17 href=#__codelineno-91-17></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-91-18 name=__codelineno-91-18 href=#__codelineno-91-18></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-an-album>Get an album<a class=headerlink href=#get-an-album title="Permanent link">¶</a></h3> <p>Get a specific album in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-92-1 name=__codelineno-92-1 href=#__codelineno-92-1></a><span class=err>GET /api/library/albums/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Album id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <strong><a href=#album-object><code>album</code></a> object</strong>.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-93-1 name=__codelineno-93-1 href=#__codelineno-93-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/albums/8009851123233197743"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-94-1 name=__codelineno-94-1 href=#__codelineno-94-1></a><span class=p>{</span>
|
|
<a id=__codelineno-94-2 name=__codelineno-94-2 href=#__codelineno-94-2></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8009851123233197743"</span><span class=p>,</span>
|
|
<a id=__codelineno-94-3 name=__codelineno-94-3 href=#__codelineno-94-3></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-94-4 name=__codelineno-94-4 href=#__codelineno-94-4></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Add Violence"</span><span class=p>,</span>
|
|
<a id=__codelineno-94-5 name=__codelineno-94-5 href=#__codelineno-94-5></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Nine Inch Nails"</span><span class=p>,</span>
|
|
<a id=__codelineno-94-6 name=__codelineno-94-6 href=#__codelineno-94-6></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"32561671101664759"</span><span class=p>,</span>
|
|
<a id=__codelineno-94-7 name=__codelineno-94-7 href=#__codelineno-94-7></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>5</span><span class=p>,</span>
|
|
<a id=__codelineno-94-8 name=__codelineno-94-8 href=#__codelineno-94-8></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>1634961</span><span class=p>,</span>
|
|
<a id=__codelineno-94-9 name=__codelineno-94-9 href=#__codelineno-94-9></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:8009851123233197743"</span>
|
|
<a id=__codelineno-94-10 name=__codelineno-94-10 href=#__codelineno-94-10></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-album-tracks>List album tracks<a class=headerlink href=#list-album-tracks title="Permanent link">¶</a></h3> <p>Lists the tracks in an album</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-95-1 name=__codelineno-95-1 href=#__codelineno-95-1></a><span class=err>GET /api/library/albums/{id}/tracks</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Album id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first track to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of tracks to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#track-object><code>track</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of tracks</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first track</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of tracks</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-96-1 name=__codelineno-96-1 href=#__codelineno-96-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/albums/1/tracks"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-97-1 name=__codelineno-97-1 href=#__codelineno-97-1></a><span class=p>{</span>
|
|
<a id=__codelineno-97-2 name=__codelineno-97-2 href=#__codelineno-97-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-97-3 name=__codelineno-97-3 href=#__codelineno-97-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-97-4 name=__codelineno-97-4 href=#__codelineno-97-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>10766</span><span class=p>,</span>
|
|
<a id=__codelineno-97-5 name=__codelineno-97-5 href=#__codelineno-97-5></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-6 name=__codelineno-97-6 href=#__codelineno-97-6></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-7 name=__codelineno-97-7 href=#__codelineno-97-7></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-8 name=__codelineno-97-8 href=#__codelineno-97-8></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-9 name=__codelineno-97-9 href=#__codelineno-97-9></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Solange wir tanzen"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-10 name=__codelineno-97-10 href=#__codelineno-97-10></a><span class=w> </span><span class=nt>"albumartist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-11 name=__codelineno-97-11 href=#__codelineno-97-11></a><span class=w> </span><span class=nt>"albumartist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Heinrich"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-12 name=__codelineno-97-12 href=#__codelineno-97-12></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Electronica"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-13 name=__codelineno-97-13 href=#__codelineno-97-13></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2014</span><span class=p>,</span>
|
|
<a id=__codelineno-97-14 name=__codelineno-97-14 href=#__codelineno-97-14></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-97-15 name=__codelineno-97-15 href=#__codelineno-97-15></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-97-16 name=__codelineno-97-16 href=#__codelineno-97-16></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>223085</span><span class=p>,</span>
|
|
<a id=__codelineno-97-17 name=__codelineno-97-17 href=#__codelineno-97-17></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-97-18 name=__codelineno-97-18 href=#__codelineno-97-18></a><span class=w> </span><span class=nt>"last_time_played"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-02-23T10:31:20Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-19 name=__codelineno-97-19 href=#__codelineno-97-19></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-20 name=__codelineno-97-20 href=#__codelineno-97-20></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-21 name=__codelineno-97-21 href=#__codelineno-97-21></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Heinrich/Solange wir tanzen/01 Solange wir tanzen.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-97-22 name=__codelineno-97-22 href=#__codelineno-97-22></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:10766"</span>
|
|
<a id=__codelineno-97-23 name=__codelineno-97-23 href=#__codelineno-97-23></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-97-24 name=__codelineno-97-24 href=#__codelineno-97-24></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-97-25 name=__codelineno-97-25 href=#__codelineno-97-25></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-97-26 name=__codelineno-97-26 href=#__codelineno-97-26></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>20</span><span class=p>,</span>
|
|
<a id=__codelineno-97-27 name=__codelineno-97-27 href=#__codelineno-97-27></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-97-28 name=__codelineno-97-28 href=#__codelineno-97-28></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-97-29 name=__codelineno-97-29 href=#__codelineno-97-29></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-a-track>Get a track<a class=headerlink href=#get-a-track title="Permanent link">¶</a></h3> <p>Get a specific track in your library</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-98-1 name=__codelineno-98-1 href=#__codelineno-98-1></a><span class=err>GET /api/library/tracks/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Track id</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. With the response body holding the <strong><a href=#track-object><code>track</code></a> object</strong>.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-99-1 name=__codelineno-99-1 href=#__codelineno-99-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/tracks/1"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-100-1 name=__codelineno-100-1 href=#__codelineno-100-1></a><span class=p>{</span>
|
|
<a id=__codelineno-100-2 name=__codelineno-100-2 href=#__codelineno-100-2></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-100-3 name=__codelineno-100-3 href=#__codelineno-100-3></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Pardon Me"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-4 name=__codelineno-100-4 href=#__codelineno-100-4></a><span class=w> </span><span class=nt>"title_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Pardon Me"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-5 name=__codelineno-100-5 href=#__codelineno-100-5></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Incubus"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-6 name=__codelineno-100-6 href=#__codelineno-100-6></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Incubus"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-7 name=__codelineno-100-7 href=#__codelineno-100-7></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Make Yourself"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-8 name=__codelineno-100-8 href=#__codelineno-100-8></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Make Yourself"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-9 name=__codelineno-100-9 href=#__codelineno-100-9></a><span class=w> </span><span class=nt>"album_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"6683985628074308431"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-10 name=__codelineno-100-10 href=#__codelineno-100-10></a><span class=w> </span><span class=nt>"album_artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Incubus"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-11 name=__codelineno-100-11 href=#__codelineno-100-11></a><span class=w> </span><span class=nt>"album_artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Incubus"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-12 name=__codelineno-100-12 href=#__codelineno-100-12></a><span class=w> </span><span class=nt>"album_artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"4833612337650426236"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-13 name=__codelineno-100-13 href=#__codelineno-100-13></a><span class=w> </span><span class=nt>"composer"</span><span class=p>:</span><span class=w> </span><span class=s2>"Alex Katunich/Brandon Boyd/Chris Kilmore/Jose Antonio Pasillas II/Mike Einziger"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-14 name=__codelineno-100-14 href=#__codelineno-100-14></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Alternative Rock"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-15 name=__codelineno-100-15 href=#__codelineno-100-15></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2001</span><span class=p>,</span>
|
|
<a id=__codelineno-100-16 name=__codelineno-100-16 href=#__codelineno-100-16></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>12</span><span class=p>,</span>
|
|
<a id=__codelineno-100-17 name=__codelineno-100-17 href=#__codelineno-100-17></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-100-18 name=__codelineno-100-18 href=#__codelineno-100-18></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>223170</span><span class=p>,</span>
|
|
<a id=__codelineno-100-19 name=__codelineno-100-19 href=#__codelineno-100-19></a><span class=w> </span><span class=nt>"rating"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-100-20 name=__codelineno-100-20 href=#__codelineno-100-20></a><span class=w> </span><span class=nt>"usermark"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-100-21 name=__codelineno-100-21 href=#__codelineno-100-21></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-100-22 name=__codelineno-100-22 href=#__codelineno-100-22></a><span class=w> </span><span class=nt>"skip_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-100-23 name=__codelineno-100-23 href=#__codelineno-100-23></a><span class=w> </span><span class=nt>"time_added"</span><span class=p>:</span><span class=w> </span><span class=s2>"2019-01-20T11:58:29Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-24 name=__codelineno-100-24 href=#__codelineno-100-24></a><span class=w> </span><span class=nt>"date_released"</span><span class=p>:</span><span class=w> </span><span class=s2>"2001-05-27"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-25 name=__codelineno-100-25 href=#__codelineno-100-25></a><span class=w> </span><span class=nt>"seek_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-100-26 name=__codelineno-100-26 href=#__codelineno-100-26></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-27 name=__codelineno-100-27 href=#__codelineno-100-27></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-28 name=__codelineno-100-28 href=#__codelineno-100-28></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Incubus/Make Yourself/12 Pardon Me.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-29 name=__codelineno-100-29 href=#__codelineno-100-29></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:1"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-30 name=__codelineno-100-30 href=#__codelineno-100-30></a><span class=w> </span><span class=nt>"artwork_url"</span><span class=p>:</span><span class=w> </span><span class=s2>"/artwork/item/1"</span><span class=p>,</span>
|
|
<a id=__codelineno-100-31 name=__codelineno-100-31 href=#__codelineno-100-31></a><span class=w> </span><span class=nt>"lyrics"</span><span class=p>:</span><span class=w> </span><span class=s2>"[00:00:10] Let's start the music [...]"</span>
|
|
<a id=__codelineno-100-32 name=__codelineno-100-32 href=#__codelineno-100-32></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-playlists-for-a-track>List playlists for a track<a class=headerlink href=#list-playlists-for-a-track title="Permanent link">¶</a></h3> <p>Get the list of playlists that contain a track (does not return smart playlists)</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-101-1 name=__codelineno-101-1 href=#__codelineno-101-1></a><span class=err>GET /api/library/tracks/{id}/playlists</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Track id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first playlist to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of playlist to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#playlist-object><code>playlist</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of playlists</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first playlist</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of playlists</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-102-1 name=__codelineno-102-1 href=#__codelineno-102-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/tracks/27/playlists"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-103-1 name=__codelineno-103-1 href=#__codelineno-103-1></a><span class=p>{</span>
|
|
<a id=__codelineno-103-2 name=__codelineno-103-2 href=#__codelineno-103-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-103-3 name=__codelineno-103-3 href=#__codelineno-103-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-103-4 name=__codelineno-103-4 href=#__codelineno-103-4></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-103-5 name=__codelineno-103-5 href=#__codelineno-103-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"playlist"</span><span class=p>,</span>
|
|
<a id=__codelineno-103-6 name=__codelineno-103-6 href=#__codelineno-103-6></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/playlist.m3u"</span><span class=p>,</span>
|
|
<a id=__codelineno-103-7 name=__codelineno-103-7 href=#__codelineno-103-7></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=p>,</span>
|
|
<a id=__codelineno-103-8 name=__codelineno-103-8 href=#__codelineno-103-8></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:1"</span>
|
|
<a id=__codelineno-103-9 name=__codelineno-103-9 href=#__codelineno-103-9></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-103-10 name=__codelineno-103-10 href=#__codelineno-103-10></a><span class=w> </span><span class=err>...</span>
|
|
<a id=__codelineno-103-11 name=__codelineno-103-11 href=#__codelineno-103-11></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-103-12 name=__codelineno-103-12 href=#__codelineno-103-12></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-103-13 name=__codelineno-103-13 href=#__codelineno-103-13></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-103-14 name=__codelineno-103-14 href=#__codelineno-103-14></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-103-15 name=__codelineno-103-15 href=#__codelineno-103-15></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=update-track-properties>Update track properties<a class=headerlink href=#update-track-properties title="Permanent link">¶</a></h3> <p>Change properties of one or more tracks.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-104-1 name=__codelineno-104-1 href=#__codelineno-104-1></a><span class=err>PUT /api/library/tracks</span>
|
|
</code></pre></div> <p><strong>Body parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>tracks</td> <td>array</td> <td>Array of track objects</td> </tr> </tbody> </table> <p>See query parameters for update of a single track for a list of properties that can be modified.</p> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-105-1 name=__codelineno-105-1 href=#__codelineno-105-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span>-d<span class=w> </span><span class=s1>'{ "tracks": [ { "id": 1, "rating": 100, "usermark": 4 }, { "id": 2, "usermark": 3 } ] }'</span><span class=w> </span><span class=s2>"http://localhost:3689/api/library/tracks"</span>
|
|
</code></pre></div> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-106-1 name=__codelineno-106-1 href=#__codelineno-106-1></a><span class=err>PUT /api/library/tracks/{id}</span>
|
|
</code></pre></div> <p><strong>Path parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>Track id</td> </tr> </tbody> </table> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>rating</td> <td>The new rating (0 - 100)</td> </tr> <tr> <td>play_count</td> <td>Either <code>increment</code> or <code>reset</code> or the new count. <code>increment</code> will increment <code>play_count</code> and update <code>time_played</code>, <code>reset</code> will set <code>play_count</code> and <code>skip_count</code> to zero and delete <code>time_played</code> and <code>time_skipped</code></td> </tr> <tr> <td>skip_count</td> <td>The new skip count</td> </tr> <tr> <td>usermark</td> <td>The new usermark (>= 0)</td> </tr> <tr> <td>time_played</td> <td>Modify last played timestamp</td> </tr> <tr> <td>time_skipped</td> <td>Modify last skipped timestamp</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-107-1 name=__codelineno-107-1 href=#__codelineno-107-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/library/tracks/1?rating=100"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-108-1 name=__codelineno-108-1 href=#__codelineno-108-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/library/tracks/1?play_count=increment"</span>
|
|
</code></pre></div> <h3 id=list-genres>List genres<a class=headerlink href=#list-genres title="Permanent link">¶</a></h3> <p>Get list of genres</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-109-1 name=__codelineno-109-1 href=#__codelineno-109-1></a><span class=err>GET /api/library/genres</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#browse-info-object><code>browse-info</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of genres in the library</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first genre</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of genres</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-110-1 name=__codelineno-110-1 href=#__codelineno-110-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/genres"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-111-1 name=__codelineno-111-1 href=#__codelineno-111-1></a><span class=p>{</span>
|
|
<a id=__codelineno-111-2 name=__codelineno-111-2 href=#__codelineno-111-2></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-111-3 name=__codelineno-111-3 href=#__codelineno-111-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-111-4 name=__codelineno-111-4 href=#__codelineno-111-4></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Classical"</span>
|
|
<a id=__codelineno-111-5 name=__codelineno-111-5 href=#__codelineno-111-5></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-111-6 name=__codelineno-111-6 href=#__codelineno-111-6></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-111-7 name=__codelineno-111-7 href=#__codelineno-111-7></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Drum & Bass"</span>
|
|
<a id=__codelineno-111-8 name=__codelineno-111-8 href=#__codelineno-111-8></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-111-9 name=__codelineno-111-9 href=#__codelineno-111-9></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-111-10 name=__codelineno-111-10 href=#__codelineno-111-10></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Pop"</span>
|
|
<a id=__codelineno-111-11 name=__codelineno-111-11 href=#__codelineno-111-11></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-111-12 name=__codelineno-111-12 href=#__codelineno-111-12></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-111-13 name=__codelineno-111-13 href=#__codelineno-111-13></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Rock/Pop"</span>
|
|
<a id=__codelineno-111-14 name=__codelineno-111-14 href=#__codelineno-111-14></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-111-15 name=__codelineno-111-15 href=#__codelineno-111-15></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-111-16 name=__codelineno-111-16 href=#__codelineno-111-16></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"'90s Alternative"</span>
|
|
<a id=__codelineno-111-17 name=__codelineno-111-17 href=#__codelineno-111-17></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-111-18 name=__codelineno-111-18 href=#__codelineno-111-18></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-111-19 name=__codelineno-111-19 href=#__codelineno-111-19></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>5</span><span class=p>,</span>
|
|
<a id=__codelineno-111-20 name=__codelineno-111-20 href=#__codelineno-111-20></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-111-21 name=__codelineno-111-21 href=#__codelineno-111-21></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-111-22 name=__codelineno-111-22 href=#__codelineno-111-22></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-albums-for-genre>List albums for genre<a class=headerlink href=#list-albums-for-genre title="Permanent link">¶</a></h3> <p>Lists the albums in a genre</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-112-1 name=__codelineno-112-1 href=#__codelineno-112-1></a><span class=err>GET api/search?type=albums&expression=genre+is+\"{genre name}\""</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>genre</td> <td>genre name (uri encoded and html esc seq for chars: '/&)</td> </tr> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first album to return</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of albums to return</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of <a href=#album-object><code>album</code></a> objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of albums in the library</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first albums</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of albums</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-113-1 name=__codelineno-113-1 href=#__codelineno-113-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=albums&expression=genre+is+\"Pop\""</span>
|
|
<a id=__codelineno-113-2 name=__codelineno-113-2 href=#__codelineno-113-2></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=albums&expression=genre+is+\"Rock%2FPop\""</span><span class=w> </span><span class=c1># Rock/Pop</span>
|
|
<a id=__codelineno-113-3 name=__codelineno-113-3 href=#__codelineno-113-3></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=albums&expression=genre+is+\"Drum%20%26%20Bass\""</span><span class=w> </span><span class=c1># Drum & Bass</span>
|
|
<a id=__codelineno-113-4 name=__codelineno-113-4 href=#__codelineno-113-4></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=albums&expression=genre+is+\"%2790s%20Alternative\""</span><span class=w> </span><span class=c1># '90 Alternative</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-114-1 name=__codelineno-114-1 href=#__codelineno-114-1></a><span class=p>{</span>
|
|
<a id=__codelineno-114-2 name=__codelineno-114-2 href=#__codelineno-114-2></a><span class=w> </span><span class=nt>"albums"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-114-3 name=__codelineno-114-3 href=#__codelineno-114-3></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-114-4 name=__codelineno-114-4 href=#__codelineno-114-4></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-114-5 name=__codelineno-114-5 href=#__codelineno-114-5></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"320189328729146437"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-6 name=__codelineno-114-6 href=#__codelineno-114-6></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Best Ever"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-7 name=__codelineno-114-7 href=#__codelineno-114-7></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Best Ever"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-8 name=__codelineno-114-8 href=#__codelineno-114-8></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"ABC"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-9 name=__codelineno-114-9 href=#__codelineno-114-9></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8760559201889050080"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-10 name=__codelineno-114-10 href=#__codelineno-114-10></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-114-11 name=__codelineno-114-11 href=#__codelineno-114-11></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>3631</span><span class=p>,</span>
|
|
<a id=__codelineno-114-12 name=__codelineno-114-12 href=#__codelineno-114-12></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:320189328729146437"</span>
|
|
<a id=__codelineno-114-13 name=__codelineno-114-13 href=#__codelineno-114-13></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-114-14 name=__codelineno-114-14 href=#__codelineno-114-14></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-114-15 name=__codelineno-114-15 href=#__codelineno-114-15></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"7964595866631625723"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-16 name=__codelineno-114-16 href=#__codelineno-114-16></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Greatest Hits"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-17 name=__codelineno-114-17 href=#__codelineno-114-17></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Greatest Hits"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-18 name=__codelineno-114-18 href=#__codelineno-114-18></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Marvin Gaye"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-19 name=__codelineno-114-19 href=#__codelineno-114-19></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"5261930703203735930"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-20 name=__codelineno-114-20 href=#__codelineno-114-20></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-114-21 name=__codelineno-114-21 href=#__codelineno-114-21></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>7262</span><span class=p>,</span>
|
|
<a id=__codelineno-114-22 name=__codelineno-114-22 href=#__codelineno-114-22></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:7964595866631625723"</span>
|
|
<a id=__codelineno-114-23 name=__codelineno-114-23 href=#__codelineno-114-23></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-114-24 name=__codelineno-114-24 href=#__codelineno-114-24></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-114-25 name=__codelineno-114-25 href=#__codelineno-114-25></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"3844610748145176456"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-26 name=__codelineno-114-26 href=#__codelineno-114-26></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"The Very Best of Etta"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-27 name=__codelineno-114-27 href=#__codelineno-114-27></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Very Best of Etta"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-28 name=__codelineno-114-28 href=#__codelineno-114-28></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Etta James"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-29 name=__codelineno-114-29 href=#__codelineno-114-29></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"2627182178555864595"</span><span class=p>,</span>
|
|
<a id=__codelineno-114-30 name=__codelineno-114-30 href=#__codelineno-114-30></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-114-31 name=__codelineno-114-31 href=#__codelineno-114-31></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>177926</span><span class=p>,</span>
|
|
<a id=__codelineno-114-32 name=__codelineno-114-32 href=#__codelineno-114-32></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:3844610748145176456"</span>
|
|
<a id=__codelineno-114-33 name=__codelineno-114-33 href=#__codelineno-114-33></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-114-34 name=__codelineno-114-34 href=#__codelineno-114-34></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-114-35 name=__codelineno-114-35 href=#__codelineno-114-35></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>3</span><span class=p>,</span>
|
|
<a id=__codelineno-114-36 name=__codelineno-114-36 href=#__codelineno-114-36></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-114-37 name=__codelineno-114-37 href=#__codelineno-114-37></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-114-38 name=__codelineno-114-38 href=#__codelineno-114-38></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-114-39 name=__codelineno-114-39 href=#__codelineno-114-39></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-count-of-tracks-artists-and-albums>Get count of tracks, artists and albums<a class=headerlink href=#get-count-of-tracks-artists-and-albums title="Permanent link">¶</a></h3> <p>Get information about the number of tracks, artists and albums and the total playtime</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-115-1 name=__codelineno-115-1 href=#__codelineno-115-1></a><span class=err>GET /api/library/count</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>expression</td> <td><em>(Optional)</em> The smart playlist query expression, if this parameter is omitted returns the information for the whole library</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>tracks</td> <td>integer</td> <td>Number of tracks matching the expression</td> </tr> <tr> <td>artists</td> <td>integer</td> <td>Number of artists matching the expression</td> </tr> <tr> <td>albums</td> <td>integer</td> <td>Number of albums matching the expression</td> </tr> <tr> <td>db_playtime</td> <td>integer</td> <td>Total playtime in milliseconds of all tracks matching the expression</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-116-1 name=__codelineno-116-1 href=#__codelineno-116-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/count?expression=data_kind+is+file"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-117-1 name=__codelineno-117-1 href=#__codelineno-117-1></a><span class=p>{</span>
|
|
<a id=__codelineno-117-2 name=__codelineno-117-2 href=#__codelineno-117-2></a><span class=w> </span><span class=nt>"tracks"</span><span class=p>:</span><span class=w> </span><span class=mi>6811</span><span class=p>,</span>
|
|
<a id=__codelineno-117-3 name=__codelineno-117-3 href=#__codelineno-117-3></a><span class=w> </span><span class=nt>"artists"</span><span class=p>:</span><span class=w> </span><span class=mi>355</span><span class=p>,</span>
|
|
<a id=__codelineno-117-4 name=__codelineno-117-4 href=#__codelineno-117-4></a><span class=w> </span><span class=nt>"albums"</span><span class=p>:</span><span class=w> </span><span class=mi>646</span><span class=p>,</span>
|
|
<a id=__codelineno-117-5 name=__codelineno-117-5 href=#__codelineno-117-5></a><span class=w> </span><span class=nt>"db_playtime"</span><span class=p>:</span><span class=w> </span><span class=mi>1590767</span>
|
|
<a id=__codelineno-117-6 name=__codelineno-117-6 href=#__codelineno-117-6></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=list-local-directories>List local directories<a class=headerlink href=#list-local-directories title="Permanent link">¶</a></h3> <p>List the local directories and the directory contents (tracks and playlists)</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-118-1 name=__codelineno-118-1 href=#__codelineno-118-1></a><span class=err>GET /api/library/files</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>directory</td> <td><em>(Optional)</em> A path to a directory in your local library.</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>directories</td> <td>array</td> <td>Array of <a href=#directory-object><code>directory</code></a> objects containing the sub directories</td> </tr> <tr> <td>tracks</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#track-object><code>track</code></a> objects that matches the <code>directory</code></td> </tr> <tr> <td>playlists</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#playlist-object><code>playlist</code></a> objects that matches the <code>directory</code></td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-119-1 name=__codelineno-119-1 href=#__codelineno-119-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/library/files?directory=/music/srv"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-120-1 name=__codelineno-120-1 href=#__codelineno-120-1></a><span class=p>{</span>
|
|
<a id=__codelineno-120-2 name=__codelineno-120-2 href=#__codelineno-120-2></a><span class=w> </span><span class=nt>"directories"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-120-3 name=__codelineno-120-3 href=#__codelineno-120-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-4 name=__codelineno-120-4 href=#__codelineno-120-4></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Audiobooks"</span>
|
|
<a id=__codelineno-120-5 name=__codelineno-120-5 href=#__codelineno-120-5></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-120-6 name=__codelineno-120-6 href=#__codelineno-120-6></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-7 name=__codelineno-120-7 href=#__codelineno-120-7></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Music"</span>
|
|
<a id=__codelineno-120-8 name=__codelineno-120-8 href=#__codelineno-120-8></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-120-9 name=__codelineno-120-9 href=#__codelineno-120-9></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-10 name=__codelineno-120-10 href=#__codelineno-120-10></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Playlists"</span>
|
|
<a id=__codelineno-120-11 name=__codelineno-120-11 href=#__codelineno-120-11></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-120-12 name=__codelineno-120-12 href=#__codelineno-120-12></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-13 name=__codelineno-120-13 href=#__codelineno-120-13></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Podcasts"</span>
|
|
<a id=__codelineno-120-14 name=__codelineno-120-14 href=#__codelineno-120-14></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-120-15 name=__codelineno-120-15 href=#__codelineno-120-15></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-120-16 name=__codelineno-120-16 href=#__codelineno-120-16></a><span class=w> </span><span class=nt>"tracks"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-17 name=__codelineno-120-17 href=#__codelineno-120-17></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-120-18 name=__codelineno-120-18 href=#__codelineno-120-18></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-19 name=__codelineno-120-19 href=#__codelineno-120-19></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-120-20 name=__codelineno-120-20 href=#__codelineno-120-20></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"input.pipe"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-21 name=__codelineno-120-21 href=#__codelineno-120-21></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown artist"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-22 name=__codelineno-120-22 href=#__codelineno-120-22></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown artist"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-23 name=__codelineno-120-23 href=#__codelineno-120-23></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown album"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-24 name=__codelineno-120-24 href=#__codelineno-120-24></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown album"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-25 name=__codelineno-120-25 href=#__codelineno-120-25></a><span class=w> </span><span class=nt>"album_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"4201163758598356043"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-26 name=__codelineno-120-26 href=#__codelineno-120-26></a><span class=w> </span><span class=nt>"album_artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown artist"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-27 name=__codelineno-120-27 href=#__codelineno-120-27></a><span class=w> </span><span class=nt>"album_artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown artist"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-28 name=__codelineno-120-28 href=#__codelineno-120-28></a><span class=w> </span><span class=nt>"album_artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"4187901437947843388"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-29 name=__codelineno-120-29 href=#__codelineno-120-29></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Unknown genre"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-30 name=__codelineno-120-30 href=#__codelineno-120-30></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-31 name=__codelineno-120-31 href=#__codelineno-120-31></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-32 name=__codelineno-120-32 href=#__codelineno-120-32></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-33 name=__codelineno-120-33 href=#__codelineno-120-33></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-34 name=__codelineno-120-34 href=#__codelineno-120-34></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-35 name=__codelineno-120-35 href=#__codelineno-120-35></a><span class=w> </span><span class=nt>"skip_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-36 name=__codelineno-120-36 href=#__codelineno-120-36></a><span class=w> </span><span class=nt>"time_added"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-11-24T08:41:35Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-37 name=__codelineno-120-37 href=#__codelineno-120-37></a><span class=w> </span><span class=nt>"seek_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-38 name=__codelineno-120-38 href=#__codelineno-120-38></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-39 name=__codelineno-120-39 href=#__codelineno-120-39></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"pipe"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-40 name=__codelineno-120-40 href=#__codelineno-120-40></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/input.pipe"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-41 name=__codelineno-120-41 href=#__codelineno-120-41></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:1"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-42 name=__codelineno-120-42 href=#__codelineno-120-42></a><span class=w> </span><span class=nt>"artwork_url"</span><span class=p>:</span><span class=w> </span><span class=s2>"/artwork/item/1"</span>
|
|
<a id=__codelineno-120-43 name=__codelineno-120-43 href=#__codelineno-120-43></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-120-44 name=__codelineno-120-44 href=#__codelineno-120-44></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-120-45 name=__codelineno-120-45 href=#__codelineno-120-45></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-120-46 name=__codelineno-120-46 href=#__codelineno-120-46></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-47 name=__codelineno-120-47 href=#__codelineno-120-47></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-120-48 name=__codelineno-120-48 href=#__codelineno-120-48></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-120-49 name=__codelineno-120-49 href=#__codelineno-120-49></a><span class=w> </span><span class=nt>"playlists"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-50 name=__codelineno-120-50 href=#__codelineno-120-50></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-120-51 name=__codelineno-120-51 href=#__codelineno-120-51></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-120-52 name=__codelineno-120-52 href=#__codelineno-120-52></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>8</span><span class=p>,</span>
|
|
<a id=__codelineno-120-53 name=__codelineno-120-53 href=#__codelineno-120-53></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"radio"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-54 name=__codelineno-120-54 href=#__codelineno-120-54></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/radio.m3u"</span><span class=p>,</span>
|
|
<a id=__codelineno-120-55 name=__codelineno-120-55 href=#__codelineno-120-55></a><span class=w> </span><span class=nt>"smart_playlist"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=p>,</span>
|
|
<a id=__codelineno-120-56 name=__codelineno-120-56 href=#__codelineno-120-56></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:playlist:8"</span>
|
|
<a id=__codelineno-120-57 name=__codelineno-120-57 href=#__codelineno-120-57></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-120-58 name=__codelineno-120-58 href=#__codelineno-120-58></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-120-59 name=__codelineno-120-59 href=#__codelineno-120-59></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-120-60 name=__codelineno-120-60 href=#__codelineno-120-60></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-120-61 name=__codelineno-120-61 href=#__codelineno-120-61></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>-1</span>
|
|
<a id=__codelineno-120-62 name=__codelineno-120-62 href=#__codelineno-120-62></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-120-63 name=__codelineno-120-63 href=#__codelineno-120-63></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=add-an-item-to-the-library>Add an item to the library<a class=headerlink href=#add-an-item-to-the-library title="Permanent link">¶</a></h3> <p>This endpoint currently only supports adding RSS feeds.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-121-1 name=__codelineno-121-1 href=#__codelineno-121-1></a><span class=err>POST /api/library/add</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>url</td> <td>URL of the RSS to add</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-122-1 name=__codelineno-122-1 href=#__codelineno-122-1></a>curl<span class=w> </span>-X<span class=w> </span>POST<span class=w> </span><span class=s2>"http://localhost:3689/api/library/add?url=http%3A%2F%2Fmyurl.com%2Flink.rss"</span>
|
|
</code></pre></div> <h3 id=trigger-rescan>Trigger rescan<a class=headerlink href=#trigger-rescan title="Permanent link">¶</a></h3> <p>Trigger a library rescan</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-123-1 name=__codelineno-123-1 href=#__codelineno-123-1></a><span class=err>PUT /api/update</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-124-1 name=__codelineno-124-1 href=#__codelineno-124-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/update"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-125-1 name=__codelineno-125-1 href=#__codelineno-125-1></a><span class=p>{</span>
|
|
<a id=__codelineno-125-2 name=__codelineno-125-2 href=#__codelineno-125-2></a><span class=w> </span><span class=nt>"songs"</span><span class=p>:</span><span class=w> </span><span class=mi>217</span><span class=p>,</span>
|
|
<a id=__codelineno-125-3 name=__codelineno-125-3 href=#__codelineno-125-3></a><span class=w> </span><span class=nt>"db_playtime"</span><span class=p>:</span><span class=w> </span><span class=mi>66811</span><span class=p>,</span>
|
|
<a id=__codelineno-125-4 name=__codelineno-125-4 href=#__codelineno-125-4></a><span class=w> </span><span class=nt>"artists"</span><span class=p>:</span><span class=w> </span><span class=mi>9</span><span class=p>,</span>
|
|
<a id=__codelineno-125-5 name=__codelineno-125-5 href=#__codelineno-125-5></a><span class=w> </span><span class=nt>"albums"</span><span class=p>:</span><span class=w> </span><span class=mi>19</span><span class=p>,</span>
|
|
<a id=__codelineno-125-6 name=__codelineno-125-6 href=#__codelineno-125-6></a><span class=w> </span><span class=nt>"started_at"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-11-19T19:06:08Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-125-7 name=__codelineno-125-7 href=#__codelineno-125-7></a><span class=w> </span><span class=nt>"updated_at"</span><span class=p>:</span><span class=w> </span><span class=s2>"2018-11-19T19:06:16Z"</span><span class=p>,</span>
|
|
<a id=__codelineno-125-8 name=__codelineno-125-8 href=#__codelineno-125-8></a><span class=w> </span><span class=nt>"updating"</span><span class=p>:</span><span class=w> </span><span class=kc>false</span>
|
|
<a id=__codelineno-125-9 name=__codelineno-125-9 href=#__codelineno-125-9></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=trigger-metadata-rescan>Trigger metadata rescan<a class=headerlink href=#trigger-metadata-rescan title="Permanent link">¶</a></h3> <p>Trigger a library metadata rescan even if files have not been updated. Maintenance method.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-126-1 name=__codelineno-126-1 href=#__codelineno-126-1></a><span class=err>PUT /api/rescan</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-127-1 name=__codelineno-127-1 href=#__codelineno-127-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/rescan"</span>
|
|
</code></pre></div> <h3 id=backup-db>Backup DB<a class=headerlink href=#backup-db title="Permanent link">¶</a></h3> <p>Request a library backup - configuration must be enabled and point to a valid writable path. Maintenance method.</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-128-1 name=__codelineno-128-1 href=#__codelineno-128-1></a><span class=err>PUT /api/library/backup</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>200 OK</code> success status response code. If backups are not enabled returns HTTP <code>503 Service Unavailable</code> response code. Otherwise a HTTP <code>500 Internal Server Error</code> response is returned.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-129-1 name=__codelineno-129-1 href=#__codelineno-129-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/library/backup"</span>
|
|
</code></pre></div> <h2 id=search>Search<a class=headerlink href=#search title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#search-by-search-term>/api/search</a></td> <td>Search for playlists, artists, albums, tracks, genres, composers by a simple search term</td> </tr> <tr> <td>GET</td> <td><a href=#search-by-query-language>/api/search</a></td> <td>Search by complex query expression</td> </tr> </tbody> </table> <h3 id=search-by-search-term>Search by search term<a class=headerlink href=#search-by-search-term title="Permanent link">¶</a></h3> <p>Search for playlists, artists, albums, tracks, genres, composers that include the given query in their title (case insensitive matching).</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-130-1 name=__codelineno-130-1 href=#__codelineno-130-1></a><span class=err>GET /api/search</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>query</td> <td>The search keyword</td> </tr> <tr> <td>type</td> <td>Comma separated list of the result types (<code>playlist</code>, <code>artist</code>, <code>album</code>, <code>track</code>, <code>genres</code>, <code>composers</code>)</td> </tr> <tr> <td>media_kind</td> <td><em>(Optional)</em> Filter results by media kind (<code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code>). Filter only applies to artist, album and track result types.</td> </tr> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first item to return for each type</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of items to return for each type</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>tracks</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#track-object><code>track</code></a> objects that match the <code>query</code></td> </tr> <tr> <td>artists</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#artist-object><code>artist</code></a> objects that match the <code>query</code></td> </tr> <tr> <td>albums</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#album-object><code>album</code></a> objects that match the <code>query</code></td> </tr> <tr> <td>playlists</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#playlist-object><code>playlist</code></a> objects that match the <code>query</code></td> </tr> <tr> <td>genres</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#browse-info-object><code>browse-info</code></a> objects that match the <code>query</code></td> </tr> <tr> <td>composers</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#browse-info-object><code>browse-info</code></a> objects that match the <code>query</code></td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p>Search for all tracks, artists, albums and playlists that contain "the" in their title and return the first two results for each type:</p> <div class=highlight><pre><span></span><code><a id=__codelineno-131-1 name=__codelineno-131-1 href=#__codelineno-131-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=tracks,artists,albums,playlists&query=the&offset=0&limit=2"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-132-1 name=__codelineno-132-1 href=#__codelineno-132-1></a><span class=p>{</span>
|
|
<a id=__codelineno-132-2 name=__codelineno-132-2 href=#__codelineno-132-2></a><span class=w> </span><span class=nt>"tracks"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-3 name=__codelineno-132-3 href=#__codelineno-132-3></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-132-4 name=__codelineno-132-4 href=#__codelineno-132-4></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-5 name=__codelineno-132-5 href=#__codelineno-132-5></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>35</span><span class=p>,</span>
|
|
<a id=__codelineno-132-6 name=__codelineno-132-6 href=#__codelineno-132-6></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Another Love"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-7 name=__codelineno-132-7 href=#__codelineno-132-7></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Tom Odell"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-8 name=__codelineno-132-8 href=#__codelineno-132-8></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Tom Odell"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-9 name=__codelineno-132-9 href=#__codelineno-132-9></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Es is was es is"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-10 name=__codelineno-132-10 href=#__codelineno-132-10></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Es is was es is"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-11 name=__codelineno-132-11 href=#__codelineno-132-11></a><span class=w> </span><span class=nt>"album_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"6494853621007413058"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-12 name=__codelineno-132-12 href=#__codelineno-132-12></a><span class=w> </span><span class=nt>"album_artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"Various artists"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-13 name=__codelineno-132-13 href=#__codelineno-132-13></a><span class=w> </span><span class=nt>"album_artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Various artists"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-14 name=__codelineno-132-14 href=#__codelineno-132-14></a><span class=w> </span><span class=nt>"album_artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8395563705718003786"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-15 name=__codelineno-132-15 href=#__codelineno-132-15></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Singer/Songwriter"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-16 name=__codelineno-132-16 href=#__codelineno-132-16></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2013</span><span class=p>,</span>
|
|
<a id=__codelineno-132-17 name=__codelineno-132-17 href=#__codelineno-132-17></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>7</span><span class=p>,</span>
|
|
<a id=__codelineno-132-18 name=__codelineno-132-18 href=#__codelineno-132-18></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-132-19 name=__codelineno-132-19 href=#__codelineno-132-19></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>251030</span><span class=p>,</span>
|
|
<a id=__codelineno-132-20 name=__codelineno-132-20 href=#__codelineno-132-20></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-21 name=__codelineno-132-21 href=#__codelineno-132-21></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-22 name=__codelineno-132-22 href=#__codelineno-132-22></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-23 name=__codelineno-132-23 href=#__codelineno-132-23></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Compilations/Es is was es is/07 Another Love.m4a"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-24 name=__codelineno-132-24 href=#__codelineno-132-24></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:35"</span>
|
|
<a id=__codelineno-132-25 name=__codelineno-132-25 href=#__codelineno-132-25></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-132-26 name=__codelineno-132-26 href=#__codelineno-132-26></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-27 name=__codelineno-132-27 href=#__codelineno-132-27></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=mi>215</span><span class=p>,</span>
|
|
<a id=__codelineno-132-28 name=__codelineno-132-28 href=#__codelineno-132-28></a><span class=w> </span><span class=nt>"title"</span><span class=p>:</span><span class=w> </span><span class=s2>"Away From the Sun"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-29 name=__codelineno-132-29 href=#__codelineno-132-29></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-30 name=__codelineno-132-30 href=#__codelineno-132-30></a><span class=w> </span><span class=nt>"artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-31 name=__codelineno-132-31 href=#__codelineno-132-31></a><span class=w> </span><span class=nt>"album"</span><span class=p>:</span><span class=w> </span><span class=s2>"Away From the Sun"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-32 name=__codelineno-132-32 href=#__codelineno-132-32></a><span class=w> </span><span class=nt>"album_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Away From the Sun"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-33 name=__codelineno-132-33 href=#__codelineno-132-33></a><span class=w> </span><span class=nt>"album_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8264078270267374619"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-34 name=__codelineno-132-34 href=#__codelineno-132-34></a><span class=w> </span><span class=nt>"album_artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-35 name=__codelineno-132-35 href=#__codelineno-132-35></a><span class=w> </span><span class=nt>"album_artist_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-36 name=__codelineno-132-36 href=#__codelineno-132-36></a><span class=w> </span><span class=nt>"album_artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"5030128490104968038"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-37 name=__codelineno-132-37 href=#__codelineno-132-37></a><span class=w> </span><span class=nt>"genre"</span><span class=p>:</span><span class=w> </span><span class=s2>"Rock"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-38 name=__codelineno-132-38 href=#__codelineno-132-38></a><span class=w> </span><span class=nt>"year"</span><span class=p>:</span><span class=w> </span><span class=mi>2002</span><span class=p>,</span>
|
|
<a id=__codelineno-132-39 name=__codelineno-132-39 href=#__codelineno-132-39></a><span class=w> </span><span class=nt>"track_number"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-132-40 name=__codelineno-132-40 href=#__codelineno-132-40></a><span class=w> </span><span class=nt>"disc_number"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-132-41 name=__codelineno-132-41 href=#__codelineno-132-41></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>233278</span><span class=p>,</span>
|
|
<a id=__codelineno-132-42 name=__codelineno-132-42 href=#__codelineno-132-42></a><span class=w> </span><span class=nt>"play_count"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-43 name=__codelineno-132-43 href=#__codelineno-132-43></a><span class=w> </span><span class=nt>"media_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"music"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-44 name=__codelineno-132-44 href=#__codelineno-132-44></a><span class=w> </span><span class=nt>"data_kind"</span><span class=p>:</span><span class=w> </span><span class=s2>"file"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-45 name=__codelineno-132-45 href=#__codelineno-132-45></a><span class=w> </span><span class=nt>"path"</span><span class=p>:</span><span class=w> </span><span class=s2>"/music/srv/Away From the Sun/02 Away From the Sun.mp3"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-46 name=__codelineno-132-46 href=#__codelineno-132-46></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:track:215"</span>
|
|
<a id=__codelineno-132-47 name=__codelineno-132-47 href=#__codelineno-132-47></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-132-48 name=__codelineno-132-48 href=#__codelineno-132-48></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-132-49 name=__codelineno-132-49 href=#__codelineno-132-49></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>14</span><span class=p>,</span>
|
|
<a id=__codelineno-132-50 name=__codelineno-132-50 href=#__codelineno-132-50></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-51 name=__codelineno-132-51 href=#__codelineno-132-51></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span>
|
|
<a id=__codelineno-132-52 name=__codelineno-132-52 href=#__codelineno-132-52></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-132-53 name=__codelineno-132-53 href=#__codelineno-132-53></a><span class=w> </span><span class=nt>"artists"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-54 name=__codelineno-132-54 href=#__codelineno-132-54></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-132-55 name=__codelineno-132-55 href=#__codelineno-132-55></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-56 name=__codelineno-132-56 href=#__codelineno-132-56></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8737690491750445895"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-57 name=__codelineno-132-57 href=#__codelineno-132-57></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"The xx"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-58 name=__codelineno-132-58 href=#__codelineno-132-58></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"xx, The"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-59 name=__codelineno-132-59 href=#__codelineno-132-59></a><span class=w> </span><span class=nt>"album_count"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-132-60 name=__codelineno-132-60 href=#__codelineno-132-60></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>25</span><span class=p>,</span>
|
|
<a id=__codelineno-132-61 name=__codelineno-132-61 href=#__codelineno-132-61></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>5229196</span><span class=p>,</span>
|
|
<a id=__codelineno-132-62 name=__codelineno-132-62 href=#__codelineno-132-62></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:artist:8737690491750445895"</span>
|
|
<a id=__codelineno-132-63 name=__codelineno-132-63 href=#__codelineno-132-63></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-132-64 name=__codelineno-132-64 href=#__codelineno-132-64></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-132-65 name=__codelineno-132-65 href=#__codelineno-132-65></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-132-66 name=__codelineno-132-66 href=#__codelineno-132-66></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-67 name=__codelineno-132-67 href=#__codelineno-132-67></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span>
|
|
<a id=__codelineno-132-68 name=__codelineno-132-68 href=#__codelineno-132-68></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-132-69 name=__codelineno-132-69 href=#__codelineno-132-69></a><span class=w> </span><span class=nt>"albums"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-70 name=__codelineno-132-70 href=#__codelineno-132-70></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-132-71 name=__codelineno-132-71 href=#__codelineno-132-71></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-72 name=__codelineno-132-72 href=#__codelineno-132-72></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"8264078270267374619"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-73 name=__codelineno-132-73 href=#__codelineno-132-73></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"Away From the Sun"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-74 name=__codelineno-132-74 href=#__codelineno-132-74></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Away From the Sun"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-75 name=__codelineno-132-75 href=#__codelineno-132-75></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-76 name=__codelineno-132-76 href=#__codelineno-132-76></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"5030128490104968038"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-77 name=__codelineno-132-77 href=#__codelineno-132-77></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>12</span><span class=p>,</span>
|
|
<a id=__codelineno-132-78 name=__codelineno-132-78 href=#__codelineno-132-78></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>2818174</span><span class=p>,</span>
|
|
<a id=__codelineno-132-79 name=__codelineno-132-79 href=#__codelineno-132-79></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:8264078270267374619"</span>
|
|
<a id=__codelineno-132-80 name=__codelineno-132-80 href=#__codelineno-132-80></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-132-81 name=__codelineno-132-81 href=#__codelineno-132-81></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-82 name=__codelineno-132-82 href=#__codelineno-132-82></a><span class=w> </span><span class=nt>"id"</span><span class=p>:</span><span class=w> </span><span class=s2>"6835720495312674468"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-83 name=__codelineno-132-83 href=#__codelineno-132-83></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"The Better Life"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-84 name=__codelineno-132-84 href=#__codelineno-132-84></a><span class=w> </span><span class=nt>"name_sort"</span><span class=p>:</span><span class=w> </span><span class=s2>"Better Life"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-85 name=__codelineno-132-85 href=#__codelineno-132-85></a><span class=w> </span><span class=nt>"artist"</span><span class=p>:</span><span class=w> </span><span class=s2>"3 Doors Down"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-86 name=__codelineno-132-86 href=#__codelineno-132-86></a><span class=w> </span><span class=nt>"artist_id"</span><span class=p>:</span><span class=w> </span><span class=s2>"5030128490104968038"</span><span class=p>,</span>
|
|
<a id=__codelineno-132-87 name=__codelineno-132-87 href=#__codelineno-132-87></a><span class=w> </span><span class=nt>"track_count"</span><span class=p>:</span><span class=w> </span><span class=mi>11</span><span class=p>,</span>
|
|
<a id=__codelineno-132-88 name=__codelineno-132-88 href=#__codelineno-132-88></a><span class=w> </span><span class=nt>"length_ms"</span><span class=p>:</span><span class=w> </span><span class=mi>2393332</span><span class=p>,</span>
|
|
<a id=__codelineno-132-89 name=__codelineno-132-89 href=#__codelineno-132-89></a><span class=w> </span><span class=nt>"uri"</span><span class=p>:</span><span class=w> </span><span class=s2>"library:album:6835720495312674468"</span>
|
|
<a id=__codelineno-132-90 name=__codelineno-132-90 href=#__codelineno-132-90></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-132-91 name=__codelineno-132-91 href=#__codelineno-132-91></a><span class=w> </span><span class=p>],</span>
|
|
<a id=__codelineno-132-92 name=__codelineno-132-92 href=#__codelineno-132-92></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>3</span><span class=p>,</span>
|
|
<a id=__codelineno-132-93 name=__codelineno-132-93 href=#__codelineno-132-93></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-94 name=__codelineno-132-94 href=#__codelineno-132-94></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span>
|
|
<a id=__codelineno-132-95 name=__codelineno-132-95 href=#__codelineno-132-95></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-132-96 name=__codelineno-132-96 href=#__codelineno-132-96></a><span class=w> </span><span class=nt>"playlists"</span><span class=p>:</span><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-132-97 name=__codelineno-132-97 href=#__codelineno-132-97></a><span class=w> </span><span class=nt>"items"</span><span class=p>:</span><span class=w> </span><span class=p>[],</span>
|
|
<a id=__codelineno-132-98 name=__codelineno-132-98 href=#__codelineno-132-98></a><span class=w> </span><span class=nt>"total"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-99 name=__codelineno-132-99 href=#__codelineno-132-99></a><span class=w> </span><span class=nt>"offset"</span><span class=p>:</span><span class=w> </span><span class=mi>0</span><span class=p>,</span>
|
|
<a id=__codelineno-132-100 name=__codelineno-132-100 href=#__codelineno-132-100></a><span class=w> </span><span class=nt>"limit"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span>
|
|
<a id=__codelineno-132-101 name=__codelineno-132-101 href=#__codelineno-132-101></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-132-102 name=__codelineno-132-102 href=#__codelineno-132-102></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=search-by-query-language>Search by query language<a class=headerlink href=#search-by-query-language title="Permanent link">¶</a></h3> <p>Search for artists, albums, tracks by a smart playlist query expression (see <a href=../smart-playlists/ >Smart Playlists</a> for the expression syntax).</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-133-1 name=__codelineno-133-1 href=#__codelineno-133-1></a><span class=err>GET /api/search</span>
|
|
</code></pre></div> <p><strong>Query parameters</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>expression</td> <td>The smart playlist query expression</td> </tr> <tr> <td>type</td> <td>Comma separated list of the result types (<code>artist</code>, <code>album</code>, <code>track</code></td> </tr> <tr> <td>offset</td> <td><em>(Optional)</em> Offset of the first item to return for each type</td> </tr> <tr> <td>limit</td> <td><em>(Optional)</em> Maximum number of items to return for each type</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>tracks</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#track-object><code>track</code></a> objects that matches the <code>query</code></td> </tr> <tr> <td>artists</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#artist-object><code>artist</code></a> objects that matches the <code>query</code></td> </tr> <tr> <td>albums</td> <td>object</td> <td><a href=#paging-object><code>paging</code></a> object containing <a href=#album-object><code>album</code></a> objects that matches the <code>query</code></td> </tr> </tbody> </table> <p><strong>Example</strong></p> <p>Search for music tracks ordered descending by the time added to the library and limit result to 2 items:</p> <div class=highlight><pre><span></span><code><a id=__codelineno-134-1 name=__codelineno-134-1 href=#__codelineno-134-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/search?type=tracks&expression=media_kind+is+music+order+by+time_added+desc&offset=0&limit=2"</span>
|
|
</code></pre></div> <h2 id=server-info>Server info<a class=headerlink href=#server-info title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#config>/api/config</a></td> <td>Get configuration information</td> </tr> </tbody> </table> <h3 id=config>Config<a class=headerlink href=#config title="Permanent link">¶</a></h3> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-135-1 name=__codelineno-135-1 href=#__codelineno-135-1></a><span class=err>GET /api/config</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>version</td> <td>string</td> <td>Server version</td> </tr> <tr> <td>websocket_port</td> <td>integer</td> <td>Port number for the <a href=#push-notifications>websocket</a> (or <code>0</code> if websocket is disabled)</td> </tr> <tr> <td>buildoptions</td> <td>array</td> <td>Array of strings indicating which features are supported by the server</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-136-1 name=__codelineno-136-1 href=#__codelineno-136-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/config"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-137-1 name=__codelineno-137-1 href=#__codelineno-137-1></a><span class=p>{</span>
|
|
<a id=__codelineno-137-2 name=__codelineno-137-2 href=#__codelineno-137-2></a><span class=w> </span><span class=nt>"websocket_port"</span><span class=p>:</span><span class=w> </span><span class=mi>3688</span><span class=p>,</span>
|
|
<a id=__codelineno-137-3 name=__codelineno-137-3 href=#__codelineno-137-3></a><span class=w> </span><span class=nt>"version"</span><span class=p>:</span><span class=w> </span><span class=s2>"25.0"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-4 name=__codelineno-137-4 href=#__codelineno-137-4></a><span class=w> </span><span class=nt>"buildoptions"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-137-5 name=__codelineno-137-5 href=#__codelineno-137-5></a><span class=w> </span><span class=s2>"ffmpeg"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-6 name=__codelineno-137-6 href=#__codelineno-137-6></a><span class=w> </span><span class=s2>"iTunes XML"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-7 name=__codelineno-137-7 href=#__codelineno-137-7></a><span class=w> </span><span class=s2>"Spotify"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-8 name=__codelineno-137-8 href=#__codelineno-137-8></a><span class=w> </span><span class=s2>"LastFM"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-9 name=__codelineno-137-9 href=#__codelineno-137-9></a><span class=w> </span><span class=s2>"MPD"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-10 name=__codelineno-137-10 href=#__codelineno-137-10></a><span class=w> </span><span class=s2>"Device verification"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-11 name=__codelineno-137-11 href=#__codelineno-137-11></a><span class=w> </span><span class=s2>"Websockets"</span><span class=p>,</span>
|
|
<a id=__codelineno-137-12 name=__codelineno-137-12 href=#__codelineno-137-12></a><span class=w> </span><span class=s2>"ALSA"</span>
|
|
<a id=__codelineno-137-13 name=__codelineno-137-13 href=#__codelineno-137-13></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-137-14 name=__codelineno-137-14 href=#__codelineno-137-14></a><span class=p>}</span>
|
|
</code></pre></div> <h2 id=settings>Settings<a class=headerlink href=#settings title="Permanent link">¶</a></h2> <table> <thead> <tr> <th>Method</th> <th>Endpoint</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>GET</td> <td><a href=#list-categories>/api/settings</a></td> <td>Get all available categories</td> </tr> <tr> <td>GET</td> <td><a href=#get-a-category>/api/settings/{category-name}</a></td> <td>Get all available options for a category</td> </tr> <tr> <td>GET</td> <td><a href=#get-an-option>/api/settings/{category-name}/{option-name}</a></td> <td>Get a single setting option</td> </tr> <tr> <td>PUT</td> <td><a href=#change-an-option-value>/api/settings/{category-name}/{option-name}</a></td> <td>Change the value of a setting option</td> </tr> <tr> <td>DELETE</td> <td><a href=#delete-an-option>/api/settings/{category-name}/{option-name}</a></td> <td>Reset a setting option to its default</td> </tr> </tbody> </table> <h3 id=list-categories>List categories<a class=headerlink href=#list-categories title="Permanent link">¶</a></h3> <p>List all settings categories with their options</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-138-1 name=__codelineno-138-1 href=#__codelineno-138-1></a><span class=err>GET /api/settings</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>categories</td> <td>array</td> <td>Array of settings <a href=#category-object>category</a> objects</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-139-1 name=__codelineno-139-1 href=#__codelineno-139-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/settings"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-140-1 name=__codelineno-140-1 href=#__codelineno-140-1></a><span class=p>{</span>
|
|
<a id=__codelineno-140-2 name=__codelineno-140-2 href=#__codelineno-140-2></a><span class=w> </span><span class=nt>"categories"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-140-3 name=__codelineno-140-3 href=#__codelineno-140-3></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-140-4 name=__codelineno-140-4 href=#__codelineno-140-4></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"webinterface"</span><span class=p>,</span>
|
|
<a id=__codelineno-140-5 name=__codelineno-140-5 href=#__codelineno-140-5></a><span class=w> </span><span class=nt>"options"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-140-6 name=__codelineno-140-6 href=#__codelineno-140-6></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-140-7 name=__codelineno-140-7 href=#__codelineno-140-7></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"show_composer_now_playing"</span><span class=p>,</span>
|
|
<a id=__codelineno-140-8 name=__codelineno-140-8 href=#__codelineno-140-8></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-140-9 name=__codelineno-140-9 href=#__codelineno-140-9></a><span class=w> </span><span class=nt>"value"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span>
|
|
<a id=__codelineno-140-10 name=__codelineno-140-10 href=#__codelineno-140-10></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-140-11 name=__codelineno-140-11 href=#__codelineno-140-11></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-140-12 name=__codelineno-140-12 href=#__codelineno-140-12></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"show_composer_for_genre"</span><span class=p>,</span>
|
|
<a id=__codelineno-140-13 name=__codelineno-140-13 href=#__codelineno-140-13></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-140-14 name=__codelineno-140-14 href=#__codelineno-140-14></a><span class=w> </span><span class=nt>"value"</span><span class=p>:</span><span class=w> </span><span class=s2>"classical"</span>
|
|
<a id=__codelineno-140-15 name=__codelineno-140-15 href=#__codelineno-140-15></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-140-16 name=__codelineno-140-16 href=#__codelineno-140-16></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-140-17 name=__codelineno-140-17 href=#__codelineno-140-17></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-140-18 name=__codelineno-140-18 href=#__codelineno-140-18></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-140-19 name=__codelineno-140-19 href=#__codelineno-140-19></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-a-category>Get a category<a class=headerlink href=#get-a-category title="Permanent link">¶</a></h3> <p>Get a settings category with their options</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-141-1 name=__codelineno-141-1 href=#__codelineno-141-1></a><span class=err>GET /api/settings/{category-name}</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>Returns a settings <a href=#category-object>category</a> object</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-142-1 name=__codelineno-142-1 href=#__codelineno-142-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/settings/webinterface"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-143-1 name=__codelineno-143-1 href=#__codelineno-143-1></a><span class=p>{</span>
|
|
<a id=__codelineno-143-2 name=__codelineno-143-2 href=#__codelineno-143-2></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"webinterface"</span><span class=p>,</span>
|
|
<a id=__codelineno-143-3 name=__codelineno-143-3 href=#__codelineno-143-3></a><span class=w> </span><span class=nt>"options"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-143-4 name=__codelineno-143-4 href=#__codelineno-143-4></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-143-5 name=__codelineno-143-5 href=#__codelineno-143-5></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"show_composer_now_playing"</span><span class=p>,</span>
|
|
<a id=__codelineno-143-6 name=__codelineno-143-6 href=#__codelineno-143-6></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-143-7 name=__codelineno-143-7 href=#__codelineno-143-7></a><span class=w> </span><span class=nt>"value"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span>
|
|
<a id=__codelineno-143-8 name=__codelineno-143-8 href=#__codelineno-143-8></a><span class=w> </span><span class=p>},</span>
|
|
<a id=__codelineno-143-9 name=__codelineno-143-9 href=#__codelineno-143-9></a><span class=w> </span><span class=p>{</span>
|
|
<a id=__codelineno-143-10 name=__codelineno-143-10 href=#__codelineno-143-10></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"show_composer_for_genre"</span><span class=p>,</span>
|
|
<a id=__codelineno-143-11 name=__codelineno-143-11 href=#__codelineno-143-11></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=mi>2</span><span class=p>,</span>
|
|
<a id=__codelineno-143-12 name=__codelineno-143-12 href=#__codelineno-143-12></a><span class=w> </span><span class=nt>"value"</span><span class=p>:</span><span class=w> </span><span class=s2>"classical"</span>
|
|
<a id=__codelineno-143-13 name=__codelineno-143-13 href=#__codelineno-143-13></a><span class=w> </span><span class=p>}</span>
|
|
<a id=__codelineno-143-14 name=__codelineno-143-14 href=#__codelineno-143-14></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-143-15 name=__codelineno-143-15 href=#__codelineno-143-15></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=get-an-option>Get an option<a class=headerlink href=#get-an-option title="Permanent link">¶</a></h3> <p>Get a single settings option</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-144-1 name=__codelineno-144-1 href=#__codelineno-144-1></a><span class=err>GET /api/settings/{category-name}/{option-name}</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>Returns a settings <a href=#option-object>option</a> object</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-145-1 name=__codelineno-145-1 href=#__codelineno-145-1></a>curl<span class=w> </span>-X<span class=w> </span>GET<span class=w> </span><span class=s2>"http://localhost:3689/api/settings/webinterface/show_composer_now_playing"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-146-1 name=__codelineno-146-1 href=#__codelineno-146-1></a><span class=p>{</span>
|
|
<a id=__codelineno-146-2 name=__codelineno-146-2 href=#__codelineno-146-2></a><span class=w> </span><span class=nt>"name"</span><span class=p>:</span><span class=w> </span><span class=s2>"show_composer_now_playing"</span><span class=p>,</span>
|
|
<a id=__codelineno-146-3 name=__codelineno-146-3 href=#__codelineno-146-3></a><span class=w> </span><span class=nt>"type"</span><span class=p>:</span><span class=w> </span><span class=mi>1</span><span class=p>,</span>
|
|
<a id=__codelineno-146-4 name=__codelineno-146-4 href=#__codelineno-146-4></a><span class=w> </span><span class=nt>"value"</span><span class=p>:</span><span class=w> </span><span class=kc>true</span>
|
|
<a id=__codelineno-146-5 name=__codelineno-146-5 href=#__codelineno-146-5></a><span class=p>}</span>
|
|
</code></pre></div> <h3 id=change-an-option-value>Change an option value<a class=headerlink href=#change-an-option-value title="Permanent link">¶</a></h3> <p>Get a single settings option</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-147-1 name=__codelineno-147-1 href=#__codelineno-147-1></a><span class=err>PUT /api/settings/{category-name}/{option-name}</span>
|
|
</code></pre></div> <p><strong>Request</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>Option name</td> </tr> <tr> <td>value</td> <td>(integer / boolean / string)</td> <td>New option value</td> </tr> </tbody> </table> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-148-1 name=__codelineno-148-1 href=#__codelineno-148-1></a>curl<span class=w> </span>-X<span class=w> </span>PUT<span class=w> </span><span class=s2>"http://localhost:3689/api/settings/webinterface/show_composer_now_playing"</span><span class=w> </span>--data<span class=w> </span><span class=s2>"{\"name\":\"show_composer_now_playing\",\"value\":true}"</span>
|
|
</code></pre></div> <h3 id=delete-an-option>Delete an option<a class=headerlink href=#delete-an-option title="Permanent link">¶</a></h3> <p>Delete a single settings option (thus resetting it to default)</p> <p><strong>Endpoint</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-149-1 name=__codelineno-149-1 href=#__codelineno-149-1></a><span class=err>DELETE /api/settings/{category-name}/{option-name}</span>
|
|
</code></pre></div> <p><strong>Response</strong></p> <p>On success returns the HTTP <code>204 No Content</code> success status response code.</p> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-150-1 name=__codelineno-150-1 href=#__codelineno-150-1></a>curl<span class=w> </span>-X<span class=w> </span>DELETE<span class=w> </span><span class=s2>"http://localhost:3689/api/settings/webinterface/show_composer_now_playing"</span>
|
|
</code></pre></div> <h2 id=push-notifications>Push notifications<a class=headerlink href=#push-notifications title="Permanent link">¶</a></h2> <p>If the server was built with websocket support it exposes a websocket at <code>localhost:3688</code> to inform clients of changes (e. g. player state or library updates). The port depends on the server configuration and can be read using the <a href=#config><code>/api/config</code></a> endpoint.</p> <p>After connecting to the websocket, the client should send a message containing the event types it is interested in. After that the server will send a message each time one of the events occurred.</p> <p><strong>Message</strong></p> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>notify</td> <td>array</td> <td>Array of event types</td> </tr> </tbody> </table> <p><strong>Event types</strong></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>update</td> <td>Library update started or finished</td> </tr> <tr> <td>database</td> <td>Library database changed (new/modified/deleted tracks)</td> </tr> <tr> <td>outputs</td> <td>An output was enabled or disabled</td> </tr> <tr> <td>player</td> <td>Player state changes</td> </tr> <tr> <td>options</td> <td>Playback option changes (shuffle, repeat, consume mode)</td> </tr> <tr> <td>volume</td> <td>Volume changes</td> </tr> <tr> <td>queue</td> <td>Queue changes</td> </tr> </tbody> </table> <p><strong>Example</strong></p> <div class=highlight><pre><span></span><code><a id=__codelineno-151-1 name=__codelineno-151-1 href=#__codelineno-151-1></a>curl<span class=w> </span>--include<span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-2 name=__codelineno-151-2 href=#__codelineno-151-2></a><span class=w> </span>--no-buffer<span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-3 name=__codelineno-151-3 href=#__codelineno-151-3></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Connection: Upgrade"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-4 name=__codelineno-151-4 href=#__codelineno-151-4></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Upgrade: websocket"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-5 name=__codelineno-151-5 href=#__codelineno-151-5></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Host: localhost:3688"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-6 name=__codelineno-151-6 href=#__codelineno-151-6></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Origin: http://localhost:3688"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-7 name=__codelineno-151-7 href=#__codelineno-151-7></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ=="</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-8 name=__codelineno-151-8 href=#__codelineno-151-8></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Sec-WebSocket-Version: 13"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-9 name=__codelineno-151-9 href=#__codelineno-151-9></a><span class=w> </span>--header<span class=w> </span><span class=s2>"Sec-WebSocket-Protocol: notify"</span><span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-10 name=__codelineno-151-10 href=#__codelineno-151-10></a><span class=w> </span>http://localhost:3688/<span class=w> </span><span class=se>\</span>
|
|
<a id=__codelineno-151-11 name=__codelineno-151-11 href=#__codelineno-151-11></a><span class=w> </span>--data<span class=w> </span><span class=s2>"{ \"notify\": [ \"player\" ] }"</span>
|
|
</code></pre></div> <div class=highlight><pre><span></span><code><a id=__codelineno-152-1 name=__codelineno-152-1 href=#__codelineno-152-1></a><span class=p>{</span><span class=w> </span>
|
|
<a id=__codelineno-152-2 name=__codelineno-152-2 href=#__codelineno-152-2></a><span class=w> </span><span class=nt>"notify"</span><span class=p>:</span><span class=w> </span><span class=p>[</span>
|
|
<a id=__codelineno-152-3 name=__codelineno-152-3 href=#__codelineno-152-3></a><span class=w> </span><span class=s2>"player"</span>
|
|
<a id=__codelineno-152-4 name=__codelineno-152-4 href=#__codelineno-152-4></a><span class=w> </span><span class=p>]</span>
|
|
<a id=__codelineno-152-5 name=__codelineno-152-5 href=#__codelineno-152-5></a><span class=p>}</span>
|
|
</code></pre></div> <h2 id=objects>Objects<a class=headerlink href=#objects title="Permanent link">¶</a></h2> <h3 id=album-object><code>album</code> object<a class=headerlink href=#album-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>Album id</td> </tr> <tr> <td>name</td> <td>string</td> <td>Album name</td> </tr> <tr> <td>name_sort</td> <td>string</td> <td>Album sort name</td> </tr> <tr> <td>artist_id</td> <td>string</td> <td>Album artist id</td> </tr> <tr> <td>artist</td> <td>string</td> <td>Album artist name</td> </tr> <tr> <td>track_count</td> <td>integer</td> <td>Number of tracks</td> </tr> <tr> <td>length_ms</td> <td>integer</td> <td>Total length of tracks in milliseconds</td> </tr> <tr> <td>uri</td> <td>string</td> <td>Resource identifier</td> </tr> <tr> <td>artwork_url</td> <td>string</td> <td><em>(optional)</em> <a href=#artwork-urls>Artwork url</a></td> </tr> </tbody> </table> <h3 id=artist-object><code>artist</code> object<a class=headerlink href=#artist-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>Artist id</td> </tr> <tr> <td>name</td> <td>string</td> <td>Artist name</td> </tr> <tr> <td>name_sort</td> <td>string</td> <td>Artist sort name</td> </tr> <tr> <td>album_count</td> <td>integer</td> <td>Number of albums</td> </tr> <tr> <td>track_count</td> <td>integer</td> <td>Number of tracks</td> </tr> <tr> <td>length_ms</td> <td>integer</td> <td>Total length of tracks in milliseconds</td> </tr> <tr> <td>uri</td> <td>string</td> <td>Resource identifier</td> </tr> <tr> <td>artwork_url</td> <td>string</td> <td><em>(optional)</em> <a href=#artwork-urls>Artwork url</a></td> </tr> </tbody> </table> <h3 id=browse-info-object><code>browse-info</code> object<a class=headerlink href=#browse-info-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>Name (depends on the type of the query)</td> </tr> <tr> <td>name_sort</td> <td>string</td> <td>Sort name</td> </tr> <tr> <td>artist_count</td> <td>integer</td> <td>Number of artists</td> </tr> <tr> <td>album_count</td> <td>integer</td> <td>Number of albums</td> </tr> <tr> <td>track_count</td> <td>integer</td> <td>Number of tracks</td> </tr> <tr> <td>time_played</td> <td>string</td> <td>Timestamp in <code>ISO 8601</code> format</td> </tr> <tr> <td>time_added</td> <td>string</td> <td>Timestamp in <code>ISO 8601</code> format</td> </tr> </tbody> </table> <h3 id=category-object><code>category</code> object<a class=headerlink href=#category-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>Category name</td> </tr> <tr> <td>options</td> <td>array</td> <td>Array of option in this category</td> </tr> </tbody> </table> <h3 id=directory-object><code>directory</code> object<a class=headerlink href=#directory-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>path</td> <td>string</td> <td>Directory path</td> </tr> </tbody> </table> <h3 id=option-object><code>option</code> object<a class=headerlink href=#option-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>Option name</td> </tr> <tr> <td>type</td> <td>integer</td> <td>The type of the value for this option (<code>0</code>: integer, <code>1</code>: boolean, <code>2</code>: string)</td> </tr> <tr> <td>value</td> <td>(integer / boolean / string)</td> <td>Current value for this option</td> </tr> </tbody> </table> <h3 id=paging-object><code>paging</code> object<a class=headerlink href=#paging-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>items</td> <td>array</td> <td>Array of result objects</td> </tr> <tr> <td>total</td> <td>integer</td> <td>Total number of items</td> </tr> <tr> <td>offset</td> <td>integer</td> <td>Requested offset of the first item</td> </tr> <tr> <td>limit</td> <td>integer</td> <td>Requested maximum number of items</td> </tr> </tbody> </table> <h3 id=playlist-object><code>playlist</code> object<a class=headerlink href=#playlist-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>Playlist id</td> </tr> <tr> <td>name</td> <td>string</td> <td>Playlist name</td> </tr> <tr> <td>path</td> <td>string</td> <td>Path</td> </tr> <tr> <td>parent_id</td> <td>integer</td> <td>Playlist id of the parent (folder) playlist</td> </tr> <tr> <td>type</td> <td>string</td> <td>Type of this playlist: <code>special</code>, <code>folder</code>, <code>smart</code>, <code>plain</code></td> </tr> <tr> <td>smart_playlist</td> <td>boolean</td> <td><code>true</code> if playlist is a smart playlist</td> </tr> <tr> <td>folder</td> <td>boolean</td> <td><code>true</code> if it is a playlist folder</td> </tr> <tr> <td>uri</td> <td>string</td> <td>Resource identifier</td> </tr> </tbody> </table> <h3 id=queue-item-object><code>queue item</code> object<a class=headerlink href=#queue-item-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>string</td> <td>Item id</td> </tr> <tr> <td>position</td> <td>integer</td> <td>Position in the queue (starting with zero)</td> </tr> <tr> <td>track_id</td> <td>string</td> <td>Track id</td> </tr> <tr> <td>title</td> <td>string</td> <td>Title</td> </tr> <tr> <td>artist</td> <td>string</td> <td>Track artist name</td> </tr> <tr> <td>artist_sort</td> <td>string</td> <td>Track artist sort name</td> </tr> <tr> <td>album</td> <td>string</td> <td>Album name</td> </tr> <tr> <td>album_sort</td> <td>string</td> <td>Album sort name</td> </tr> <tr> <td>album_id</td> <td>string</td> <td>Album id</td> </tr> <tr> <td>album_artist</td> <td>string</td> <td>Album artist name</td> </tr> <tr> <td>album_artist_sort</td> <td>string</td> <td>Album artist sort name</td> </tr> <tr> <td>album_artist_id</td> <td>string</td> <td>Album artist id</td> </tr> <tr> <td>composer</td> <td>string</td> <td>Composer (optional)</td> </tr> <tr> <td>genre</td> <td>string</td> <td>Genre</td> </tr> <tr> <td>year</td> <td>integer</td> <td>Release year</td> </tr> <tr> <td>track_number</td> <td>integer</td> <td>Track number</td> </tr> <tr> <td>disc_number</td> <td>integer</td> <td>Disc number</td> </tr> <tr> <td>length_ms</td> <td>integer</td> <td>Track length in milliseconds</td> </tr> <tr> <td>media_kind</td> <td>string</td> <td>Media type of this track: <code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code></td> </tr> <tr> <td>data_kind</td> <td>string</td> <td>Data type of this track: <code>file</code>, <code>url</code>, <code>spotify</code>, <code>pipe</code></td> </tr> <tr> <td>path</td> <td>string</td> <td>Path</td> </tr> <tr> <td>uri</td> <td>string</td> <td>Resource identifier</td> </tr> <tr> <td>artwork_url</td> <td>string</td> <td><em>(optional)</em> <a href=#artwork-urls>Artwork url</a></td> </tr> <tr> <td>type</td> <td>string</td> <td>file (codec) type (ie mp3/flac/...)</td> </tr> <tr> <td>bitrate</td> <td>string</td> <td>file bitrate (ie 192/128/...)</td> </tr> <tr> <td>samplerate</td> <td>string</td> <td>file sample rate (ie 44100/48000/...)</td> </tr> <tr> <td>channel</td> <td>string</td> <td>file channel (ie mono/stereo/xx ch))</td> </tr> </tbody> </table> <h3 id=track-object><code>track</code> object<a class=headerlink href=#track-object title="Permanent link">¶</a></h3> <table> <thead> <tr> <th>Key</th> <th>Type</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>id</td> <td>integer</td> <td>Track id</td> </tr> <tr> <td>title</td> <td>string</td> <td>Title</td> </tr> <tr> <td>title_sort</td> <td>string</td> <td>Sort title</td> </tr> <tr> <td>artist</td> <td>string</td> <td>Track artist name</td> </tr> <tr> <td>artist_sort</td> <td>string</td> <td>Track artist sort name</td> </tr> <tr> <td>album</td> <td>string</td> <td>Album name</td> </tr> <tr> <td>album_sort</td> <td>string</td> <td>Album sort name</td> </tr> <tr> <td>album_id</td> <td>string</td> <td>Album id</td> </tr> <tr> <td>album_artist</td> <td>string</td> <td>Album artist name</td> </tr> <tr> <td>album_artist_sort</td> <td>string</td> <td>Album artist sort name</td> </tr> <tr> <td>album_artist_id</td> <td>string</td> <td>Album artist id</td> </tr> <tr> <td>composer</td> <td>string</td> <td>Track composer</td> </tr> <tr> <td>genre</td> <td>string</td> <td>Genre</td> </tr> <tr> <td>comment</td> <td>string</td> <td>Comment</td> </tr> <tr> <td>year</td> <td>integer</td> <td>Release year</td> </tr> <tr> <td>track_number</td> <td>integer</td> <td>Track number</td> </tr> <tr> <td>disc_number</td> <td>integer</td> <td>Disc number</td> </tr> <tr> <td>length_ms</td> <td>integer</td> <td>Track length in milliseconds</td> </tr> <tr> <td>rating</td> <td>integer</td> <td>Track rating (ranges from 0 to 100)</td> </tr> <tr> <td>play_count</td> <td>integer</td> <td>How many times the track was played</td> </tr> <tr> <td>skip_count</td> <td>integer</td> <td>How many times the track was skipped</td> </tr> <tr> <td>time_played</td> <td>string</td> <td>Timestamp in <code>ISO 8601</code> format</td> </tr> <tr> <td>time_skipped</td> <td>string</td> <td>Timestamp in <code>ISO 8601</code> format</td> </tr> <tr> <td>time_added</td> <td>string</td> <td>Timestamp in <code>ISO 8601</code> format</td> </tr> <tr> <td>date_released</td> <td>string</td> <td>Date in the format <code>yyyy-mm-dd</code></td> </tr> <tr> <td>seek_ms</td> <td>integer</td> <td>Resume point in milliseconds (available only for podcasts and audiobooks)</td> </tr> <tr> <td>media_kind</td> <td>string</td> <td>Media type of this track: <code>music</code>, <code>movie</code>, <code>podcast</code>, <code>audiobook</code>, <code>musicvideo</code>, <code>tvshow</code></td> </tr> <tr> <td>data_kind</td> <td>string</td> <td>Data type of this track: <code>file</code>, <code>url</code>, <code>spotify</code>, <code>pipe</code></td> </tr> <tr> <td>path</td> <td>string</td> <td>Path</td> </tr> <tr> <td>uri</td> <td>string</td> <td>Resource identifier</td> </tr> <tr> <td>artwork_url</td> <td>string</td> <td><em>(optional)</em> <a href=#artwork-urls>Artwork url</a></td> </tr> <tr> <td>usermark</td> <td>integer</td> <td>User review marking of track (ranges from 0)</td> </tr> <tr> <td>lyrics</td> <td>string</td> <td>The lyrics if found either as LRC or plain text</td> </tr> </tbody> </table> <h3 id=artwork-urls>Artwork urls<a class=headerlink href=#artwork-urls title="Permanent link">¶</a></h3> <p>Artwork urls in <code>queue item</code>, <code>artist</code>, <code>album</code> and <code>track</code> objects can be either relative urls or absolute urls to the artwork image. Absolute artwork urls are pointing to external artwork images (e. g. for radio streams that provide artwork metadata), while relative artwork urls are served from the server.</p> <p>It is possible to add the query parameters <code>maxwidth</code> and/or <code>maxheight</code> to relative artwork urls, in order to get a smaller image (the server only scales down never up).</p> <p>Note that even if a relative artwork url attribute is present, it is not guaranteed to exist.</p> </article> </div> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> <div class=md-social> <a href=https://github.com/owntone/owntone-server target=_blank rel=noopener title=github.com class=md-social__link> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 496 512"><!-- Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg> </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "..", "features": ["navigation.tabs", "navigation.top"], "search": "../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src=../assets/javascripts/bundle.88dd0f4e.min.js></script> <script src=../assets/extra.js></script> </body> </html> |