Jobe-compatible API
Jobe's REST API at https://api.onlinecompiler.io/api/jobe/index.php/restapi, for Moodle's CodeRunner question type: CodeRunner sends students' code here instead of to a Jobe server you install and maintain.
Set up CodeRunner
- Get a free API key at your dashboard.
- In Moodle, open Site administration > Plugins > Question types > CodeRunner.
- Set Jobe server to
https://api.onlinecompiler.io/api, with thehttps://(without it, CodeRunner uses http). - Set Jobe API key to your API key, save, and check an answer in any CodeRunner question.
/api/jobe/index.php/restapi/languages no key needed; a key that is sent is checked/api/jobe/index.php/restapi/runs/api/jobe/index.php/restapi/files/{id}/api/jobe/index.php/restapi/files/{id}The key goes in X-API-KEY, as CodeRunner sends it. Requests and responses keep Jobe's shape, and errors come back as a JSON string.
curl -X POST https://api.onlinecompiler.io/api/jobe/index.php/restapi/runs \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"run_spec": {
"language_id": "python3",
"sourcecode": "print(input()[::-1])",
"input": "hello\n",
"parameters": { "cputime": 3 }
}
}'Response (200)
{
"run_id": null,
"outcome": 15,
"cmpinfo": "",
"stdout": "olleh\n",
"stderr": ""
}Language ids
Jobe's own ids, which CodeRunner's built-in question types use, run on these compilers. A custom question type can name any of the other 38 ids as its sandbox language.
| language_id | Runs on |
|---|---|
| c | C (GCC 15) |
| cpp | C++ (G++ 15) |
| java | Java (OpenJDK 25) |
| nodejs | JavaScript (Node.js 24) |
| octave | Octave (11) |
| pascal | Pascal (Free Pascal 3.2) |
| php | PHP (8.5) |
| python3 | Python (3.14) |
Also: ada (Ada), bash (Bash), clojure (Clojure), cobol (COBOL), crystal (Crystal), csharp (C#), d (D), dart (Dart), duckdb (DuckDB), elixir (Elixir), erlang (Erlang), fortran (Fortran), freebasic (FreeBASIC), fsharp (F#), go (Go), groovy (Groovy), haskell (Haskell), julia (Julia), kotlin (Kotlin), lisp (Common Lisp), lua (Lua), nasm (Assembly), nim (Nim), objectivec (Objective-C), ocaml (OCaml), perl (Perl), powershell (PowerShell), prolog (Prolog), r (R), racket (Racket), ruby (Ruby), rust (Rust), scala (Scala), sqlite (SQL), swift (Swift), typescript (TypeScript), vbnet (Visual Basic), zig (Zig).
Outcomes and errors
- 15 the program ran and exited cleanly; 11 compile error, with the compiler's messages in
cmpinfo, which includes a syntax error in Python, Java or PHP as on Jobe; 12 runtime error (a non-zero exit or a signal); 13 time limit; 17 memory limit; 19 more than 16 processes at once, which CodeRunner shows as an illegal function call; 30 output over 64 KB; 20 an internal error on our side. - 21 (overload): your plan's per-minute, pending or at-once limit was reached, or the sandboxes were busy. Nothing ran and nothing was counted; the same run can be sent again shortly.
- HTTP 401: the monthly allowance of your account or key is spent, which CodeRunner reports as a submission limit. 403: the key is missing, unknown or not a REST API key. 404: a file in
file_listisn't stored, so CodeRunner uploads it and sends the run again. 400: a bad request, with the reason.
Differences from Jobe
- Every run is a fresh gVisor sandbox with no network access and our limits: 512 MB of memory and at most 16 processes.
parameters.cputimestops the run, 5 seconds when it is absent as on Jobe, capped at 30 seconds. Compiling does not count, and Java (1 s), Groovy (1.5 s) and F# (2.5 s) get a start-up allowance on top.memorylimit,numprocs,streamsizeanddisklimitare accepted and ignored.compileargs,linkargsandinterpreterargsare ignored: programs compile with our commands. C compiles in GCC 15's default dialect rather than Jobe's-std=c99, and without-Werror. Compiler warnings arrive instderr, and CodeRunner marks any stderr as an error, so warnings still fail an answer as they would on Jobe.runargsare refused with a 400: programs get no command-line arguments.sourcefilenameis ignored. A Java file takes its public class's name, so CodeRunner's Java templates, which put the student's class before the test harness, run as on Jobe.- Each language runs in a sandbox of its own, so a template that calls another language's compiler from Python does not work: the Python sandbox has no
gcc,javacorphp. That includes CodeRunner's built-inmultilanguagequestion type, which compiles the student's chosen language from a Python template. - A run's files follow the input file limits: up to 8 files and 1 MB, with plain names. Uploaded files are kept per account, up to the 200 most recently used and 50 MB.
- Each run counts as one run toward your monthly allowance. Listing languages and uploading or checking files are free.
Why use a hosted Jobe? See CodeRunner without a Jobe server.
Questions
- Do I still need a Jobe server?
- No. Set CodeRunner's Jobe server to https://api.onlinecompiler.io/api and its Jobe API key to your OnlineCompiler.io API key, and CodeRunner sends its runs here.
- Which question types work?
- CodeRunner's built-in types use Jobe's language ids (c, cpp, java, nodejs, octave, pascal, php and python3), and all of them are served. A custom question type can also use any of 38 more ids, such as go, rust and kotlin.
- What happens when a whole class checks answers at once?
- Runs beyond your plan's per-minute or at-once limits get Jobe's overload outcome, which CodeRunner shows as a sandbox overload; checking again a moment later works. For timed exams with large classes, see pricing or ask us for higher limits.