Run code online
A secure and reliable cloud code execution API supporting online compilation and execution of Python, JavaScript, C/C++, Go, and more. Supports custom standard input (stdin), execution timeout limits, and controlled public-network allowlists. Ideal for coding practice platforms, online programming education, and chatbot code evaluation. · Coding practice and judging platforms, online programming education and IDE tools, chatbot code evaluation, code demo widgets for tech blogs · Run code online
code execution api, online compiler api, cloud sandbox api, coding practice api, run python online, code evaluation api
POST /execution/run - Run code online
Want to add a "run code online" feature to your programming learning site, coding practice platform, or chatbot? This endpoint gives you a secure, isolated cloud code execution environment.
Overview
Submit a piece of source code with its programming language (Python, JS, C/C++, Go, and more). The system compiles and runs it in a cloud sandbox, then returns the full standard output (stdout), standard error (stderr), execution time, and exit status.
Flexible input control
Use the stdin parameter to feed the program its standard input stream — perfect for test cases on algorithm problems.
Secure, controlled network policy
Code runs in a fully offline environment by default (offline mode). If user code needs to fetch external data, enable public mode and strictly limit the allowed public hosts (e.g. api.github.com) and ports, eliminating malicious network probing at the root.
Usage Notes
[!IMPORTANT]
An HTTP 200 response only means the cloud service received and finished the task — it does not mean the user's code ran successfully. Always rely on the status field in the response body (success means success; other values may be compileerror, runtimeerror, or timeout).
Size limits:
- Both the source code (code) and standard input (stdin) must not exceed 65536 bytes (UTF-8 encoded).
- The execution timeout can be set up to 30000 milliseconds (30 seconds).
About runtime packs (Packs):
For now, always pass an empty array []. Do not expose this field to end users for arbitrary input, or uncontrolled dependency loading failures may occur.