← APIs

Code Execution API

Execute code programmatically with a single POST request. Multi-file projects, batch stdin, and detailed timing metrics.

Run code

curl --location --request POST 'http://localhost:3000/api/v1/run' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: your_api_key' \
--data-raw '{
  "language": "python",
  "stdin": "Peter",
  "files": [
    {
      "name": "main.py",
      "content": "import sys\nname = sys.stdin.readline()\nprint('Hello '+ name)"
    }
  ]
}'

Response

{
  "stdout": "Hello Peter\n",
  "stderr": null,
  "exception": null,
  "status": "success",
  "compilationTime": 0,
  "executionTime": 9,
  "memoryUsed": 9384
}

List languages

curl http://localhost:3000/api/v1/languages

Error codes

CodeDescription
E001Operation timed out
E002API quota exceeded
E003Invalid API key
E004API key missing
E005STDIN too long
E006Unsupported language