🚲Submissions

API Methods at /submissions route

Sumbit solution

POST https://api.sort-me.org/submit

πŸ”‘ Authorization required.

Submit solution to judging.

This method has low, context-adaptive rate limit, so it can't be described with some specific constants. If you encounter 429 (Too Many Requests) HTTP error, just retry after 30-60 secs.

Request Body

Name
Type
Description

problem_id*

int

ID of the task you trying to submit

environment*

string

Language code you are trying to submit

files*

[]file

Source code of your solution

contest_id

int

If you are submitting solution during contest, you need to specify its ID.

{
    id: 1337 // id of your new submission
}

Get default environments

GET https://api.sort-me.org/submissions/getAvailableLanguages

On Sort Me, environment is similar to language/compiler on other platforms - for example, GNU C++ 20 or Python 3.11.

With this method, you get default environments, with which you can submit most of publically available problems.

[
    {
        "id": 1,
        "name": "Python 3.11",
        : "python",
        "additional_files": true
        "files": {
            {
                "name": "solution.py",
                "type": "text",
                "placeholder": "a, b = map(int, input().split())"
            },
        },
    },
    {
        "name": "PyPy 3.9",
        "highlight": "python",
        "api": "pypy",
        "ext": "py"
    },
    {
        "name": "GNU C++20",
        "highlight": "cpp",
        "api": "c++",
        "ext": "cpp:cc:C"
    }
]

Get submissions

GET https://api.sort-me.org/submissions/get

πŸ—ƒοΈ Pagination applies.

This is universal method for receiving submissions of certain user, problem, contest, or from any intersection of this parameters.

However, submissions on Sort Me are not public, so access to submissions is a bit tricky. In general, you can get response, if you are trying to get:

– Your own submissions; – Submissions sent during contest where you are admin; – Submissions which solves problem you are admin of.

Query Parameters

Name
Type
Description

user_id

int

ID of user whose submissions you want to get. If specified, it must be your ID or ID of participant of contest from contest_id parameter. If not specified, get submissions of all users. You must be admin of contest from contest_id to do this.

problem_id

int

ID of the task you want to get submissions for.

If specified, at least one rule must be satisfied: – You are admin of the task

– You are requesting your own submissions – You are admin of the contest from contest_id parameter, and that contest contains this task. If not specified, get submissions for all tasks.

contest_id

int

ID of contest, submissions of which you want to get. If specified, you must be either admin of the contest or requesting only your own submissions (by providing your ID in user_id parameter) If not specified, get submissions sent not during contests.

offset

int

Pagination parameter. Use id field.

{
    "count": 19,
    "submissions": [
        {
            "id": 53459,       // Unique ID of submission
            
            "user": {
                "id": 578,
                "handle": "imachug",
                "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289g",
            },
            
            "task_id": 2025,
            "contest_id": 35,
            
            "worst_metrics": {
                "time": 961,     // Millisecconds
                "memory": 253,   // Megabytes
            },
            
            "submitted_at": 1665081384,  // Unixtime
            "environment": {
                "name": "GNU C++20",
            },
            
            "verdict": 1,
            "verdict_text": "Full solution",
            "total_points": 100
        }
    ]
}

Get submission by ID

GET https://api.sort-me.org/submissions/getByID

Query Parameters

Name
Type
Description

id*

int

ID of target submission.

Verdicts are set per problem, per subtask and per test. Here are all the types:

  • 0 - Judging. Solution is still judging.

  • 1 - Full solution (for problem and subtasks) or OK (for test).

  • 2 - Wrong Answer

  • 3 - Time limit exceeded

  • 4 - Runtime Error

  • 5 - Compilation Error

  • 6 - Compilation Time Limit Exceeded

  • 7 - Memory Limit Exceeded

  • 8 - Wrong Output Format

  • 9 - Checker Error

  • 11 - Judging Error

  • 12 - Malicious Code

  • 13 - Skipped

  • 20 - Partial Solution

{
    "id": 193478,

    "user": {
        "id": 1,
        "handle": "sadfun",
        "avatar": "https://pic.sort-me.org/bd62e50c-7cfa-40d8-9009-f4753d696289"
    },

    "environment": {
        "id": 1,
        "name": "Python 3.11",
        "highlight": "python"
    },

    "files": [
        {
            "name": "solution.py",
            "type": "text",

            "content": "a, b = map(int, input().split())\nprint(a + b)"
        }
    ],

    "submitted_at": 1633036128,

    "results": {
        "points": 100,

        "verdict": 1,
        "verdict_text": "Accepted",

        "worst_metrics": {
            "time": 10,
            "memory": 91
        },

        "subtasks": [
            {
                "points": 100,
                "worst_metrics": {
                    "time": 10,
                    "memory": 91
                },

                "tests": [
                    {
                        "n": 1,
                        "verdict": 1,
                        "verdict_text": "OK",
                        "worst_metrics": {
                            "time": 9,
                            "memory": 87
                        }
                    },
                    {
                        "n": 2,
                        "verdict": 1,
                        "verdict_text": "OK",
                        "worst_metrics": {
                            "time": 9,
                            "memory": 91
                        }
                    },
                    {
                        "n": 3,
                        "verdict": 1,
                        "verdict_text": "OK",
                        "worst_metrics": {
                            "time": 10,
                            "memory": 81
                        }
                    }
                ]
            }
        ]
    }
}

Last updated