> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kernelmedia.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Libraries & Items

> Browse movie and TV libraries

## List libraries

```bash theme={null}
curl http://<server>:9014/libraries -H "Authorization: Bearer <jwt>"
```

```json theme={null}
{
  "libraries": [
    {"id": 1, "library_type": "movie", "name": "Movies", "location": "/media/movies"}
  ]
}
```

Only returns libraries this user has access to.

`GET /libraries`

***

## List items in a library

<ParamField query="search" type="string" />

<ParamField query="genre" type="string" />

<ParamField query="year" type="integer" />

<ParamField query="sort_column" default="date_added" type="string" />

<ParamField query="sort_dir" type="string" default="desc">`asc` or `desc`</ParamField>
<ParamField query="limit" type="integer" default="0">`0` returns everything</ParamField>

<ParamField query="offset" default="0" type="integer" />

<ParamField query="group" type="boolean">Group seasons/episodes and include version info</ParamField>

```bash theme={null}
curl "http://<server>:9014/library/1?sort_column=year&sort_dir=desc&limit=20" \
  -H "Authorization: Bearer <jwt>"
```

```json theme={null}
{
  "items": [{"id": 501, "title": "Example Movie", "year": 2024, "resolution": "1080p"}],
  "total_count": 134,
  "limit": 20,
  "offset": 0
}
```

Returns `403` if the signed-in user doesn't have access to this library.

`GET /library/{library_id}`, also `/series`, `/episodes`, `/search?q=`, `/filters`

***

## Get item detail

```bash theme={null}
curl http://<server>:9014/item/501 -H "Authorization: Bearer <jwt>"
```

```json theme={null}
{
  "id": 501,
  "title": "Example Movie",
  "available_versions": [{"item_id": 501, "resolution": "1080p", "video_codec": "h264"}],
  "selected_version_id": 501,
  "needs_downscale": false
}
```

`GET /item/{item_id}`, also `/children`, `/cast`, `/crew`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.