{% 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/<code class="code">searchQuery</code></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"
            },
            ...
        ],
        "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="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"
            },
            ...
        ],
        "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 12 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,
            "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="hot">
                                    <h2 class="card-title">Hot Songs</h2>
                                    <p>Returns the 12 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,
            "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="popular">
                                    <h2 class="card-title">Popular Songs <span class="badge badge-secondary">deprecated</span></h2>
                                    <p>Returns the 12 most popular songs of all time. 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/popular/<code class="code">offset</code></td>
                                        </tr>
                                    </table>

                                    <br />
                                    <div class="alert alert-secondary" role="alert">
                                        <h4 class="alert-heading">Deprecated</h4>
                                        This API-Endpoint will soon be removed and shouldn't been used anymore.
                                    </div>
                                    <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,
            "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="#hot">Hot Songs</a>
									<a href="#popular">Popular Songs <span class="badge badge-secondary">Deprecated</span></a>
								</div>
							</div>
						</div>
					</div>
{% endblock %}