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

Need higher limits or something we don't cover yet? Contact us and we'll work it out.

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.

POST /api/runNo API key needed. Limit: 30 requests per minute per IP — over that you get an 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"
}
FieldDescription
languageLanguage slug — see the supported languages table below.
versionFree-form version label, echoed back in the response.
filesArray of { name, content }. The first file is treated as the entry point; extra files are appended as commented sections.
stdinOptional. Text piped to the program's standard input.
argsOptional array of CLI arguments, prepended to stdin for programs that read argv.
stdout / stderr / outputCaptured program output. output mirrors JDoodle's combined stream; stdout/stderr are split heuristically.
code0 on a clean run, 1 if a compile or runtime error was detected, null on infra errors.
errorPresent 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.)

languagenamecategory
javascriptJavaScriptpopular
pythonPythonpopular
javaJavapopular
cCpopular
c++C++popular
csharpC#popular
goGoprogramming
rustRustprogramming
rubyRubyprogramming
phpPHPpopular
typescriptTypeScriptprogramming
javascriptNode.jspopular
kotlinKotlinprogramming
swiftSwiftprogramming
bashBashprogramming
perlPerlprogramming
luaLuapopular
haskellHaskellprogramming
dartDartprogramming
scalaScalaprogramming
groovyGroovypopular
elixirElixirprogramming
clojureClojureprogramming
fsharp.netF#programming
fortranFortranprogramming
cobolCOBOLprogramming
pascalPascalprogramming
rRprogramming
erlangErlangprogramming
ocamlOCamlprogramming
dDprogramming
nasmAssemblypopular
prologPrologprogramming
sbclCommon Lispprogramming
basic.netVisual Basicprogramming
python2Python 2programming
freebasicFreeBASICprogramming
objcObjective-Cprogramming
tclTclprogramming
schemeSchemeprogramming
racketRacketprogramming
nimNimprogramming
coffeescriptCoffeeScriptprogramming
octaveOctaveprogramming
sqlite3MySQLdatabase
sqlite3SQLitedatabase
sqlite3Oracledatabase
sqlite3MariaDBdatabase
sqlite3SQL Serverdatabase
sqlite3QuestDBdatabase
sqlite3DuckDBdatabase
sqlite3Firebirddatabase
sqlite3ClickHousedatabase

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 parameterEffect
embed=1Turns on embed mode (required).
theme=dark | lightForces the editor theme.
picker=0Hides 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>