API is still under early stages of development, so feel free to contribute in the project.
An API which executes codes
Hosted here - "https://code-box.onrender.com/api/v1/"
This version is not scaled, you can access the scaled version here - "https://github.com/kushagra-goyal-14/CodeBox"
This endpoint allows you to execute your script and fetch output results.
Parameter | Description |
---|---|
"src" | Should contain the script that needs to be executed |
"stdin" | In case the script requires any kind of input for execution, leave empty if no input required |
"lang" | Language that the script is written in for example: java, cpp, etc. (Check language as a payload down below in next question) |
All the Languages are listed below .
Languages | Language as a payload |
---|---|
C++ | cpp |
Java | java |
Python | python3 |
C | c |
GoLang | go |
JS | javascript |
Sending a json post request to https://code-box.onrender.com/api/v1/submit
{
"src": "\n\n#include<bits/stdc++.h>\n\nusing namespace std ;\n\nint main()\n{ cout << \"Hello World \"<< endl ;}",
"stdin": "48\n95",
"lang": "cpp"
}
The output is a JSON object comprising only one parameter that is the output.
{
"message": "Successfully ran it",
"data": {
"output": "Hello World\n",
"error": ""
},
"err": {},
"success": true
}