# V1 (api.cider.sh/v1)

## MusicKit Token

<mark style="color:blue;">`GET`</mark> `https://api.cider.sh/v1`

Returns the current working MusicKit Token

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "token": ...,
    "error": ...
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    "status_string": ...,
    "status":        ...,
    "message":       ...
}
```

{% endtab %}
{% endtabs %}

## Returns the Apple Music config

<mark style="color:blue;">`GET`</mark> `https://api.cider.sh/v1/config`

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    // Apple music config. Too biug to paste here
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    "status_string": ...,
    "status":        ...,
    "message":       ...
}
```

{% endtab %}
{% endtabs %}

## Gets the image from POST /images

<mark style="color:blue;">`GET`</mark> `https://api.cider.sh/v1/image`

#### Path Parameters

| Name                                   | Type   | Description |
| -------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark> | String | File UUID   |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Image DATA
}
```

{% endtab %}
{% endtabs %}

## Gets the MXM Token

<mark style="color:blue;">`GET`</mark> `https://api.cider.sh/v1/mxm`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "token": ...
}
```

{% endtab %}
{% endtabs %}

## Upload iCloud artwork to the server temporarily&#x20;

<mark style="color:green;">`POST`</mark> `https://api.cider.sh/v1/images`

#### Request Body

| Name                                  | Type   | Description                   |
| ------------------------------------- | ------ | ----------------------------- |
| url<mark style="color:red;">\*</mark> | String | The url of the icloud artwork |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "url": ...
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    "status_string": ...,
    "status":        ...,
    "message":       ...
}
```

{% endtab %}
{% endtabs %}

## Gets the MXM Lyrics

<mark style="color:green;">`POST`</mark> `https://api.cider.sh/v1/lyrics`

#### Request Body

| Name                                     | Type   | Description                             |
| ---------------------------------------- | ------ | --------------------------------------- |
| mode                                     | Int    | Different mode for source               |
| richsyncQuery                            | Bool   | Determines whether richsync is returned |
| track                                    | String | Song Name                               |
| artist                                   | String | Artist Name                             |
| songID<mark style="color:red;">\*</mark> | String | Song ID                                 |
| source<mark style="color:red;">\*</mark> | String | mxm qq etc                              |
| lang                                     | String | en, jp, es etc                          |
| time                                     | Int    | unix time                               |

{% tabs %}
{% tab title="200: OK Returns MXM lyrics" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Converts a m3u8 file to a gif or an mp4

<mark style="color:green;">`POST`</mark> `https://api.cider.sh/v1/animated`

#### Request Body

| Name | Type   | Description                                |
| ---- | ------ | ------------------------------------------ |
| url  | String | url to the m3u8 file                       |
| data | String | base64 m3u8 file                           |
| mp4  | Bool   | tells the api you want a mp4 and not a gif |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "url": "https://api.cider.sh/animated/<file>.mp4"
}
```

{% endtab %}

{% tab title="200: OK " %}

```json
{
    "url": "https://api.cider.sh/animated/<file>.gif"
}
```

{% endtab %}
{% endtabs %}
