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

idnamelanguageType
javaJavaprogramming
pythonPythonprogramming
cCprogramming
cppC++programming
nodejsNodeJSprogramming
javascriptJavaScriptprogramming
groovyGroovyprogramming
jshellJShellprogramming
haskellHaskellprogramming
tclTclprogramming
luaLuaprogramming
adaAdaprogramming
commonlispCommonLispprogramming
dDprogramming
elixirElixirprogramming
erlangErlangprogramming
fsharpF#programming
fortranFortranprogramming
assemblyAssemblyprogramming
scalaScalaprogramming
phpPHPprogramming
python2Python2programming
csharpC#programming
perlPerlprogramming
rubyRubyprogramming
goGoprogramming
rRprogramming
racketRacketprogramming
ocamlOCamlprogramming
vbVisual Basic (VB.NET)programming
basicBasicprogramming
bashBashprogramming
clojureClojureprogramming
typescriptTypeScriptprogramming
cobolCobolprogramming
kotlinKotlinprogramming
pascalPascalprogramming
prologPrologprogramming
rustRustprogramming
swiftSwiftprogramming
objectivecObjective-Cprogramming
octaveOctaveprogramming
textTextprogramming
brainfkBrainFKprogramming
coffeescriptCoffeeScriptprogramming
ejsEJSprogramming
mysqlMySQLdatabase
oracleOracle Databasedatabase
postgresqlPostgreSQLdatabase
mongodbMongoDBdatabase
sqliteSQLitedatabase
redisRedisdatabase
mariadbMariaDBdatabase
plsqlOracle PL/SQLdatabase
sqlserverMicrosoft SQL Serverdatabase