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
| Code | Description |
|---|---|
| E001 | Operation timed out |
| E002 | API quota exceeded |
| E003 | Invalid API key |
| E004 | API key missing |
| E005 | STDIN too long |
| E006 | Unsupported language |