> For the complete documentation index, see [llms.txt](https://docs.sort-me.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sort-me.org/api/websocket.md).

# Websocket

### /wss/listenSubmission

This method can track submission judging almost in real-time.

#### Query parameters

<table><thead><tr><th width="135">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>ID of submission you want to listen for.</td></tr><tr><td><code>token</code></td><td>Your access token.<br>Required here because WSS connections can't use headers.</td></tr><tr><td><code>language</code></td><td>Language required to get text verdict representation.<br>Required here because WSS connections can't use headers.</td></tr></tbody></table>

When connection is established, you will start receiving plaintext numbers:

<figure><img src="/files/76Aoek13f1XpSqTP4xJD" alt=""><figcaption><p>Websocket connection in Chrome DevTools</p></figcaption></figure>

Thats a test number on which submission is being judged right now. You can display it as live counter, just as in sort-me.org after submission.

<figure><img src="/files/6Z2wKc39z7oMLDgbfoEU" alt=""><figcaption></figcaption></figure>

When judging is done, you receive a JSON with results in the same connection:

```json
{
    "points": 100,
    "verdict": 1,
    "verdict_text": "Accepted",
    "worst_metrics": {
        "time": 25,
        "memory": 0
    },
    "subtasks": [
        {
            "points": 50,
            "worst_metrics": {
                "time": 25,
                "memory": 0
            }
        },
        {
            "points": 50,
            "worst_metrics": {
                "time": 19,
                "memory": 0
            }
        }
    ]
}
```
