{% extends 'apidocs/base.html.twig' %}

{% block title %}Discovery{% endblock %}

{% block content %}
					<div class="row justify-content-center">
						<div class="col-lg-7">
							<div class="content">
								<h1 class="content-title">
									Discovery
                                </h1>
                                
                                <div class="card" id="search">
                                    <h2 class="card-title">Search</h2>
                                    <p>Returns songs and users based on the <code class="code">searchQuery</code> provided.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/search</td>
                                        </tr>
                                        <tr>
                                            <th>JSON Body</th>
                                            <td>(string) searchQuery<br />
                                                (bool) diffEasy<br />
                                                (bool) diffNormal<br />
                                                (bool) diffHard<br />
                                                (bool) diffExpert<br />
                                                (bool) diffXD<br />
                                                (int) diffRatingFrom<br />
                                                (int) diffRatingTo</td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":{
        "users":[
            {
                "id":4,
                "username":"thatanimeweirdo",
                "isVerified":true,
                "isPatreon":null,
		        "pronouns": "they/them",
                "avatar":"https:\/\/spinsha.re\/uploads\/avatar\/5ef8cddb50106.png"
            },
            ...
        ],
        "songs":[
            {
                "id":1024,
                "title":"Keyboard Combos XD",
                "subtitle":"Charted in XD because WHY NOT",
                "artist":"Discord",
                "charter":"Raoul1808",
                "hasEasyDifficulty":false,
                "hasNormalDifficulty":false,
                "hasHardDifficulty":false,
                "hasExtremeDifficulty":false,
                "hasXDDifficulty":true,
                "easyDifficulty": 5,
                "normalDifficulty": 10,
                "hardDifficulty": 15,
                "expertDifficulty": 23,
                "XDDifficulty": 26,
                "updateHash": "d837d2adcdc19d215130cd92f27ae927",
                "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5f2d157f6e44a.jpg",
                "zip":"https:\/\/spinsha.re\/api\/song\/1024\/download"
            },
            ...
        ]
    }
}
</pre>
                                </div>
                                
                                <div class="card" id="searchAll">
                                    <h2 class="card-title">Search All</h2>
                                    <p>Returns all songs and users.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/searchAll</td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":{
        "users":[
            {
                "id":4,
                "username":"thatanimeweirdo",
                "isVerified":true,
                "isPatreon":null,
                "avatar":"https:\/\/spinsha.re\/uploads\/avatar\/5ef8cddb50106.png",
		        "pronouns": "they/them"
            },
            ...
        ],
        "songs":[
            {
                "id":1024,
                "title":"Keyboard Combos XD",
                "subtitle":"Charted in XD because WHY NOT",
                "artist":"Discord",
                "charter":"Raoul1808",
                "hasEasyDifficulty":false,
                "hasNormalDifficulty":false,
                "hasHardDifficulty":false,
                "hasExtremeDifficulty":false,
                "hasXDDifficulty":true,
                "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5f2d157f6e44a.jpg",
                "zip":"https:\/\/spinsha.re\/api\/song\/1024\/download"
            },
            ...
        ]
    }
}
</pre>
                                </div>
                                
                                <div class="card" id="new">
                                    <h2 class="card-title">New Songs</h2>
                                    <p>Returns the 10 newest songs. Use <code class="code">offset</code> for pagination.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/songs/new/<code class="code">offset</code></td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body (Success)</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":[
        {
            "id": 3,
            "title": "Isabelle Singing",
            "subtitle": "K.K. Bubblegum",
            "artist": "K.K. Slider",
            "charter": "Ellite",
            "hasEasyDifficulty": false,
            "hasNormalDifficulty": false,
            "hasHardDifficulty": true,
            "hasExtremeDifficulty": false,
            "hasXDDifficulty": false,
            "easyDifficulty": 5,
            "normalDifficulty": 10,
            "hardDifficulty": 15,
            "expertDifficulty": 23,
            "XDDifficulty": 26,
            "updateHash": "d837d2adcdc19d215130cd92f27ae927",
            "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5e8df6fb90bd7.jpg",
            "zip":"https:\/\/spinsha.re\/api\/song\/3\/download"
        },
        ...
    ]
}
</pre>

                                    <br />

                                    <strong>Output Body (Not Found)</strong>
<pre class="code">
{
    "version":1,
    "status":404,
    "data":[]
}
</pre>
                                </div>
                                
                                <div class="card" id="updated">
                                    <h2 class="card-title">Updated Songs</h2>
                                    <p>Returns 10 songs that were last updated. Use <code class="code">offset</code> for pagination.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/songs/updated/<code class="code">offset</code></td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body (Success)</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":[
        {
            "id": 3,
            "title": "Isabelle Singing",
            "subtitle": "K.K. Bubblegum",
            "artist": "K.K. Slider",
            "charter": "Ellite",
            "hasEasyDifficulty": false,
            "hasNormalDifficulty": false,
            "hasHardDifficulty": true,
            "hasExtremeDifficulty": false,
            "hasXDDifficulty": false,
            "easyDifficulty": 5,
            "normalDifficulty": 10,
            "hardDifficulty": 15,
            "expertDifficulty": 23,
            "XDDifficulty": 26,
            "updateHash": "d837d2adcdc19d215130cd92f27ae927",
            "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5e8df6fb90bd7.jpg",
            "zip":"https:\/\/spinsha.re\/api\/song\/3\/download"
        },
        ...
    ]
}
</pre>

                                    <br />

                                    <strong>Output Body (Not Found)</strong>
<pre class="code">
{
    "version":1,
    "status":404,
    "data":[]
}
</pre>
                                </div>
                                
                                <div class="card" id="hotThisWeek">
                                    <h2 class="card-title">Hot This Week Songs</h2>
                                    <p>Returns the 10 most popular songs from the last 7 days. Use <code class="code">offset</code> for pagination.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/songs/hot/<code class="code">offset</code></td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body (Success)</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":[
        {
            "id": 3,
            "title": "Isabelle Singing",
            "subtitle": "K.K. Bubblegum",
            "artist": "K.K. Slider",
            "charter": "Ellite",
            "hasEasyDifficulty": false,
            "hasNormalDifficulty": false,
            "hasHardDifficulty": true,
            "hasExtremeDifficulty": false,
            "hasXDDifficulty": false,
            "easyDifficulty": 5,
            "normalDifficulty": 10,
            "hardDifficulty": 15,
            "expertDifficulty": 23,
            "XDDifficulty": 26,
            "updateHash": "d837d2adcdc19d215130cd92f27ae927",
            "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5e8df6fb90bd7.jpg",
            "zip":"https:\/\/spinsha.re\/api\/song\/3\/download"
        },
        ...
    ]
}
</pre>

                                    <br />

                                    <strong>Output Body (Not Found)</strong>
<pre class="code">
{
    "version":1,
    "status":404,
    "data":[]
}
</pre>
                                </div>
                                
                                <div class="card" id="hotThisMonth">
                                    <h2 class="card-title">Hot This Month Songs</h2>
                                    <p>Returns the 10 most popular songs from the last month. Use <code class="code">offset</code> for pagination.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/songs/hotThisMonth/<code class="code">offset</code></td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body (Success)</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":[
        {
            "id": 3,
            "title": "Isabelle Singing",
            "subtitle": "K.K. Bubblegum",
            "artist": "K.K. Slider",
            "charter": "Ellite",
            "hasEasyDifficulty": false,
            "hasNormalDifficulty": false,
            "hasHardDifficulty": true,
            "hasExtremeDifficulty": false,
            "hasXDDifficulty": false,
            "easyDifficulty": 5,
            "normalDifficulty": 10,
            "hardDifficulty": 15,
            "expertDifficulty": 23,
            "XDDifficulty": 26,
            "updateHash": "d837d2adcdc19d215130cd92f27ae927",
            "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5e8df6fb90bd7.jpg",
            "zip":"https:\/\/spinsha.re\/api\/song\/3\/download"
        },
        ...
    ]
}
</pre>

                                    <br />

                                    <strong>Output Body (Not Found)</strong>
<pre class="code">
{
    "version":1,
    "status":404,
    "data":[]
}
</pre>
                                </div>
                                
							</div>
						</div>
						<div class="col-lg-3">
							<div class="content">
								<div class="on-this-page-nav">
									<div class="title">On this page</div>
									<a href="#search">Search</a>
									<a href="#searchAll">Search All</a>
									<a href="#new">New Songs</a>
									<a href="#updated">Updated Songs</a>
									<a href="#hotThisWeek">Hot This Week Songs</a>
									<a href="#hotThisMonth">Hot This Month Songs</a>
								</div>
							</div>
						</div>
					</div>
{% endblock %}