CodeCompiler APIs
Bring code execution and the CodeCompiler editor into your own product. The execution API runs on JDoodle under the hood and covers the same 53+ programming languages available on the site — no separate account needed to try it.
Start building
Code Execution API
Send code and stdin from your backend, get back stdout, stderr and timing — no browser required. This is the same endpoint the online editor calls.
error: "Rate limited" response.Request
curl --location --request POST 'https://codecompiler.forgesparse.com/api/run' \
--header 'Content-Type: application/json' \
--data-raw '{
"language": "python",
"version": "3.10.0",
"files": [
{ "name": "main.py", "content": "print(\"Hello, \" + input())" }
],
"stdin": "Peter"
}'Response
{
"stdout": "Hello, Peter\n",
"stderr": "",
"output": "Hello, Peter\n",
"code": 0,
"signal": null,
"language": "python",
"version": "3.10.0"
}| Field | Description |
|---|---|
| language | Language slug — see the supported languages table below. |
| version | Free-form version label, echoed back in the response. |
| files | Array of { name, content }. The first file is treated as the entry point; extra files are appended as commented sections. |
| stdin | Optional. Text piped to the program's standard input. |
| args | Optional array of CLI arguments, prepended to stdin for programs that read argv. |
| stdout / stderr / output | Captured program output. output mirrors JDoodle's combined stream; stdout/stderr are split heuristically. |
| code | 0 on a clean run, 1 if a compile or runtime error was detected, null on infra errors. |
| error | Present only on failure — a short machine-readable label (see below). |
Error responses
Failures come back as HTTP 200 with an error label so you can branch on it without checking status codes:
Unsupported language
The language slug isn't mapped to a runtime yet.
Missing JDoodle credentials
Server-side configuration issue — not something callers can fix.
Invalid credentials
JDoodle rejected the configured API keys.
Daily limit exceeded
The shared execution quota was hit — retry later.
Timeout
Execution took longer than 20 seconds and was aborted.
Network error
Could not reach the execution backend — safe to retry.
Rate limited
More than 30 requests in a minute from your IP. Wait and retry.
Supported languages
53 languages currently run through this API. Send the value from the language column. The same list is available as JSON at GET /api/languages. (PostgreSQL, MongoDB, Redis and web languages run in the visitor's browser, so they aren't part of this API.)
| language | name | category |
|---|---|---|
| javascript | JavaScript | popular |
| python | Python | popular |
| java | Java | popular |
| c | C | popular |
| c++ | C++ | popular |
| csharp | C# | popular |
| go | Go | programming |
| rust | Rust | programming |
| ruby | Ruby | programming |
| php | PHP | popular |
| typescript | TypeScript | programming |
| javascript | Node.js | popular |
| kotlin | Kotlin | programming |
| swift | Swift | programming |
| bash | Bash | programming |
| perl | Perl | programming |
| lua | Lua | popular |
| haskell | Haskell | programming |
| dart | Dart | programming |
| scala | Scala | programming |
| groovy | Groovy | popular |
| elixir | Elixir | programming |
| clojure | Clojure | programming |
| fsharp.net | F# | programming |
| fortran | Fortran | programming |
| cobol | COBOL | programming |
| pascal | Pascal | programming |
| r | R | programming |
| erlang | Erlang | programming |
| ocaml | OCaml | programming |
| d | D | programming |
| nasm | Assembly | popular |
| prolog | Prolog | programming |
| sbcl | Common Lisp | programming |
| basic.net | Visual Basic | programming |
| python2 | Python 2 | programming |
| freebasic | FreeBASIC | programming |
| objc | Objective-C | programming |
| tcl | Tcl | programming |
| scheme | Scheme | programming |
| racket | Racket | programming |
| nim | Nim | programming |
| coffeescript | CoffeeScript | programming |
| octave | Octave | programming |
| sqlite3 | MySQL | database |
| sqlite3 | SQLite | database |
| sqlite3 | Oracle | database |
| sqlite3 | MariaDB | database |
| sqlite3 | SQL Server | database |
| sqlite3 | QuestDB | database |
| sqlite3 | DuckDB | database |
| sqlite3 | Firebird | database |
| sqlite3 | ClickHouse | database |
Embed Editor
Every language page on CodeCompiler is a clean, chrome-free editor — no site header or footer — so it drops straight into an iframe.
Embed any language
Add ?embed=1 to any language page. Embed mode hides the site header and documentation and shows a compact toolbar.
<iframe
src="https://codecompiler.forgesparse.com/python?embed=1"
width="100%"
height="450"
frameborder="0"
></iframe>Options
| Query parameter | Effect |
|---|---|
| embed=1 | Turns on embed mode (required). |
| theme=dark | light | Forces the editor theme. |
| picker=0 | Hides the language switcher, locking the embed to one language. |
| s=<id> | Loads saved/shared code. Use Share → Embed in the editor to get a ready-made iframe. |
Control it with postMessage
Your page can set the code, run it and read the result. The editor posts codecompiler:ready when it loads and codecompiler:result after every run.
<iframe id="cc" src="https://codecompiler.forgesparse.com/python?embed=1&picker=0" width="100%" height="450" frameborder="0"></iframe>
<script>
const cc = document.getElementById("cc").contentWindow;
window.addEventListener("message", (e) => {
if (e.origin !== "https://codecompiler.forgesparse.com") return;
if (e.data.type === "codecompiler:ready") {
cc.postMessage({ type: "codecompiler:setCode", code: "print(input())", stdin: "Hi!" }, "*");
cc.postMessage({ type: "codecompiler:run" }, "*");
}
if (e.data.type === "codecompiler:result") {
console.log(e.data.stdout, e.data.stderr, e.data.error);
}
});
</script>
