# Archives

## Get available archives

<mark style="color:blue;">`GET`</mark> `https://sort-me.org/api//archives/getPublic`

:sa: [Localization applies](https://docs.sort-me.org/tricky/localization).

#### Query Parameters

| Name   | Type   | Description                                                                 |
| ------ | ------ | --------------------------------------------------------------------------- |
| query  | string | Text to search through archive descriptions                                 |
| offset | int    | <p>Pagination parameter.<br>Use <strong><code>id</code></strong> field.</p> |

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

```javascript
{
    "archives": [
        {
            "id": 19,
            "names": {
                "ru": "Полуфинал ICPC в Северной Евразии",
                "en": "Northern Eurasia ICPC Semi-Finals"
            },
            "org": {
                "ru": "Университет ИТМО и Комитет ICPC",
                "en": "ITMO University and ICPC Committee"
            },

            "seasons": 3,
            "seasons_info": {
                "ru": "с 2011 г.",
                "en": "2011 - Present"
            },

            "stats": { // can be not presented if you are not logged in
                "solved_problems": 4,
                "total_problems": 21
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get archive by ID

<mark style="color:blue;">`GET`</mark> `https://api.sort-me.org/api/archives/getByID`

:sa: [Localization applies](https://docs.sort-me.org/tricky/localization).

Get single archive by its id.

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

```json
{
    "id": 1,
    "names": {
        "en": "Northern Eurasia ICPC Semi-Finals",
        "ru": "Полуфинал ICPC в Северной Евразии"
    },
    "org": {
        "en": "ITMO University and ICPC Committee",
        "ru": "Университет ИТМО и Комитет ICPC"
    },
    "seasons_info": {
        "en": "2011 - Present",
        "ru": "с 2011 г."
    },
    "seasons": [
        {
            "codename": "2011-2012",
            "problems": [
                {
                    "id": 1,
                    "names": {
                        "en": "A+B",
                        "ru": "A+B"
                    },
                    "difficulty": 2,
                    "solved_by": 0,
                    "tags": [
                        1
                    ]
                }
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Arhive not found" %}

```json
{
    "error": "archive not found"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sort-me.org/api/archives.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
