API to run the code
Users can integrate the API from their backend servers and execute the code programatically.
Following is the cURL to call the /run
API to execute code
curl --location --request POST 'https://onecompiler.com/api/v1/run?access_token=your_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
"language": "python",
"stdin": "Peter",
"files": [
{
"name": "HelloWorld.py",
"content": "import sys\nname = sys.stdin.readline()\nprint('\''Hello '\''+ name)"
}
]
}'
Response:
{
"status": "success",
"exception": null,
"stdout": "Hello Peter\n",
"stderr": null,
"executionTime": 41,
"limitPerMonthRemaining": 74694
}
Note: Replace the your_access_token
with your account's access token. Reach out to [email protected] to get your acces token
API to get the list of supported languages
http://onecompiler.com/api/v1/languages
Following are the list of supported languages and their ids
id | name | languageType |
---|---|---|
java | Java | programming |
python | Python | programming |
c | C | programming |
cpp | C++ | programming |
nodejs | NodeJS | programming |
javascript | JavaScript | programming |
groovy | Groovy | programming |
jshell | JShell | programming |
haskell | Haskell | programming |
tcl | Tcl | programming |
lua | Lua | programming |
ada | Ada | programming |
commonlisp | CommonLisp | programming |
d | D | programming |
elixir | Elixir | programming |
erlang | Erlang | programming |
fsharp | F# | programming |
fortran | Fortran | programming |
assembly | Assembly | programming |
scala | Scala | programming |
php | PHP | programming |
python2 | Python2 | programming |
csharp | C# | programming |
perl | Perl | programming |
ruby | Ruby | programming |
go | Go | programming |
r | R | programming |
racket | Racket | programming |
ocaml | OCaml | programming |
vb | Visual Basic (VB.NET) | programming |
basic | Basic | programming |
bash | Bash | programming |
clojure | Clojure | programming |
typescript | TypeScript | programming |
cobol | Cobol | programming |
kotlin | Kotlin | programming |
pascal | Pascal | programming |
prolog | Prolog | programming |
rust | Rust | programming |
swift | Swift | programming |
objectivec | Objective-C | programming |
octave | Octave | programming |
text | Text | programming |
brainfk | BrainFK | programming |
coffeescript | CoffeeScript | programming |
ejs | EJS | programming |
mysql | MySQL | database |
oracle | Oracle Database | database |
postgresql | PostgreSQL | database |
mongodb | MongoDB | database |
sqlite | SQLite | database |
redis | Redis | database |
mariadb | MariaDB | database |
plsql | Oracle PL/SQL | database |
sqlserver | Microsoft SQL Server | database |