# Packages API

### How to get a package <a href="#get" id="get"></a>

With this endpoint, obtaining any package becomes attainable by using the package ID. All that's required is to send a request to the specified endpoint, and it will return you with the essential data about the package.

## Gets information about a package.

<mark style="color:blue;">`GET`</mark> `https://api.mcjoe21.com/v1/packages/get`

Get data of a package.

#### Query Parameters

| Name                                 | Type   | Description                         |
| ------------------------------------ | ------ | ----------------------------------- |
| id<mark style="color:red;">\*</mark> | String | ID of the package                   |
| part                                 | String | The item key that you want returned |

{% tabs %}
{% tab title="200  Returns package data object" %}

{% endtab %}
{% endtabs %}

Here is a demonstration illustrating the output you can expect when a request is sent to the **get** endpoint. This illustrative example serves to showcase the type of data that will be returned in response to your query.

<pre class="language-json"><code class="lang-json">{
  "data": {
    "manifest": {
      "name": text,
      "repo": url,
      "ver": number
    },
    "files": {
      text: {
        "name": text,
        "url": url,
<strong>        "hash": hash    
</strong><strong>        "size": filesize, 
</strong>        "modified": datetime
      }
    },
    "tags": array
  }
</code></pre>

### How to query package list <a href="#query" id="query"></a>

Are you unsure about the package ID for the download you're looking for? This method streamlines the identification process by utilizing keywords within the ID. Furthermore, it will provide you with an array of matching results.

## Query packages by keyword

<mark style="color:blue;">`GET`</mark> `https://api.mcjoe21.com/v1/packages/query`

#### Query Parameters

| Name                                | Type         | Description                                                                                                                                                          |
| ----------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| q<mark style="color:red;">\*</mark> | String       | The query string to search                                                                                                                                           |
| tag                                 | Strings List | List of tags to filter results                                                                                                                                       |
| format                              | String       | <p>Data format of response can be set as</p><p><mark style="background-color:blue;">xml</mark></p><p>or</p><p><mark style="background-color:yellow;">json</mark></p> |

{% tabs %}
{% tab title="200: OK Returns packages list object" %}

{% endtab %}
{% endtabs %}

Here is a demonstration illustrating the output you can expect when a request is sent to the **query** endpoint. This illustrative example serves to showcase the type of data that will be returned in response to your query.

```json
{
  "data": {
    "results": array
  }
}
```
