Search…
Compiler API FAQ

What this service is?

JDoodle Compiler is an online API service to compile and execute Programs online via APIs, it supports Java, C/C++, PHP, Perl, Python, Ruby and many more languages.

What type of API it is?

It is a JSON based Rest API.

Can I call your API directly from a web page?

This APIs are meant for server to server call and protected with client ID and Client Secret, if you make call directly from web page then you have to expose your personal client ID and Secret in the page which is not secure and we request you not to do that. Best way is to direct the request from your webpage to your own server and call JDoodle API from your server.

Is web socket supported?

Web socket is not supported in our public offering. Available in unlimited/custom plans.

What is the request endpoint for compiler api?

https://api.jdoodle.com/v1/execute (only POST method supported with Content-Type: application/json)

What is the request endpoint to check my today's usage?

https://api.jdoodle.com/v1/credit-spent (only POST method supported with Content-Type: application/json)

What subscription options available?

We have got multiple plans including a Free plan, please refer compiler-api home page for current Plans.

Is plan costs are in USD?

All the cost mentioned is in USD.

Can I change from one plan to another plan?

Yes. if you are upgrading from lower volume plan to upper volume plan, your change will be immediate. if you are moving from upper volume plan to lower volume plan, your change will be effective from end of your current billing period

What is a billing period and when my credit card charged?

When you subscribe to a paid plan first time, you are paying for the plan and your billing period starts from that date, your credit card will be charged every month on that day. For example, if you subscribe for a paid plan on 5th November, your billing period is 5th of every month, and you will be charged on 5th of every month.

How cost calculated when I move from lower volume plan to upper volume plan and when I will be charged (upgrade)?

You are always charged only on your billing date, that is at the end of current billing period. if you move to upper volume plan, the cost is calculated on prorate basis and the additional cost for the current billing period will be included in the next payment. For example, if your billing period starts on 1st April and your current plan is $10 per Month, if you are moving to $20 plan on 16th of April. Your next bill will be calculated approximately like = (usage on current plan $10 on prorate from 1st to 15th) $5 + (usage on new plan $20 for 16th to 30th on prorate basis) $10 + (next billing period cost for 1st May to 31st May) $20 - (Amount you have already paid for 1st to 30th April) $10 = $25.

How cost calculated when I move from upper volume plan to lower volume plan (downgrade)?

When you are moving from upper volume plan to lower lower volume plan, the change is effective only from start of your next billing period, so you will be charged for new plan from start of new billing period. you can continue use your current plan until the end of current billing period, no refund provided.

What happens when I cancel my subscription?

if you are on Free plan, the cancellation will be processed immediately. if you are on Paid plan, your subscription will be cancelled at the end of your current billing period, you can use your plan until end of current billing period. no refund provided.

Can I reactivate my subscription?

If you cancelled, you can reactivate any time until the end of your current billing period. if end of billing period reached, you have to subscribe again.

Is My Credit Card Details safe?

We use Stripe for all Credit Card processing, we are not storing or handling your Credit Card details in our systems.

What are the Input Parameters for execute api call?

Parameter
Description
clientId
Client ID for your subscription
clientSecret
Client Secret for your subscription
script
program to compile and execute
stdin
StdIn
language
language of the script (refer the supported language list below)
versionIndex
version of the language to be used (refere the supportoed languages and versions in list below)

What are the Output Parameters for execute api call when the execution is successful?

Parameter
Description
output
Output of the program
statusCode
Status Code of the result
memory
Memory used by the program
cpuTime
CPU Time used by the program

What are the Output Parameters for execute api call when the execution failed?

Parameter
Description
error
error message
statusCode
Status Code of the result

What are the Input Parameters for "credit-spent" api call?

Parameter
Description
clientId
Client ID for your subscription
clientSecret
Client Secret for your subscription

What are the Output Parameters for "credit-spent" api call when the execution is successful?

Parameter
Description
used
No of credits used today

What are the Output Parameters for "credit-spent" api call when the execution failed?

Parameter
Description
error
error message
statusCode
Status Code of the result

What languages and versions supported?

Language (not passed in request)
Language Code (passed in request)
Version (not passed in request)
VersionIndex (this is what passed in request)
Java
java
JDK 1.8.0_66
0
JDK 9.0.1
1
JDK 10.0.1
2
JDK 11.0.4
3
C
c
GCC 5.3.0
0
Zapcc 5.0.0
1
GCC 7.2.0
2
GCC 8.1.0
3
GCC 9.1.0
4
C-99
c99
GCC 5.3.0
0
GCC 7.2.0
1
GCC 8.1.0
2
GCC 9.1.0
3
C++
cpp
GCC 5.3.0
0
Zapcc 5.0.0
1
GCC 7.2.0
2
GCC 8.1.0
3
GCC 9.1.0
4
C++ 14
cpp14
g++ 14 GCC 5.3.0
0
g++ 14 GCC 7.2.0
1
g++ 14 GCC 8.1.0
2
g++ 14 GCC 9.1.0
3
C++ 17
cpp17
g++ 17 GCC 9.10
0
PHP
php
5.6.16
0
7.1.11
1
7.2.5
2
7.3.10
3
Perl
perl
5.22.0
0
5.26.1
1
5.26.2
2
5.30.0
3
Python 2
python2
2.7.11
0
2.7.15
1
2.7.16
2
Python 3
python3
3.5.1
0
3.6.3
1
3.6.5
2
3.7.4
3
Ruby
ruby
2.2.4
0
2.4.2p198
1
2.5.1p57
2
2.6.5
3
GO Lang
go
1.5.2
0
1.9.2
1
1.10.2
2
1.13.1
3
Scala
scala
2.12.0
0
2.12.4
1
2.12.5
2
2.13.0
3
Bash Shell
bash
4.3.42
0
4.4.12
1
4.4.19
2
5.0.011
3
SQL
sql
SQLite 3.9.2
0
SQLite 3.21.0
1
SQLite 3.23.1
2
SQLite 3.29.0
3
Pascal
pascal
fpc 3.0.0
0
fpc-3.0.2
1
fpc-3.0.4
2
C#
csharp
mono 4.2.2
0
mono 5.0.0
1
mono 5.10.1
2
mono 6.0.0
3
VB.Net
vbn
mono 4.0.1
0
mono 4.6
1
mono 5.10.1
2
mono 6.0.0
3
Haskell
haskell
ghc 7.10.3
0
ghc 8.2.1
1
ghc 8.2.2
2
ghc 8.6.5
3
Objective C
objc
GCC 5.3.0
0
GCC 7.2.0
1
GCC 8.1.0
2
GCC 9.1.0
3
Swift
swift
2.2
0
3.1.1
1
4.1
2
5.1
3
Groovy
groovy
2.4.6 JVM: 1.7.0_99
0
2.4.12 JVM: 9.0.1
1
2.4.15 JVM: 10.0.1
2
2.5.8 JVM: 11.0.4
3
Fortran
fortran
GNU 5.3.0
0
GNU 7.2.0
1
GNU 8.1.0
2
GNU 9.1.0
3
Brainf**k
brainfuck
bfc-0.1
0
Lua
lua
5.3.2
0
5.3.4
1
5.3.5
2
TCL
tcl
8.6
0
8.6.7
1
8.6.8
2
8.6.9
3
Hack
hack
HipHop VM 3.13.0
0
RUST
rust
1.10.0
0
1.21.0
1
1.25.0
2
1.38.0
3
D
d
DMD64 D Compiler v2.071.1
0
DMD64 D Compiler v2.088
1
Ada
ada
GNATMAKE 6.1.1
0
GNATMAKE 7.2.0
1
GNATMAKE 8.1.0
2
GNATMAKE 9.1.0
3
R Language
r
3.3.1
0
3.4.2
1
3.5.0
2
3.6.1
3
FREE BASIC
freebasic
1.05.0
0
1.07.1
1
VERILOG
verilog
10.1
0
10.2
1
10.3
2
COBOL
cobol
GNU COBOL 2.0.0
0
GNU COBOL 2.2.0
1
GNU COBOL 3.0
2
Dart
dart
1.18.0
0
1.24.2
1
1.24.3
2
2.5.1
3
YaBasic
yabasic
2.769
0
2.84.1
1
Clojure
clojure
1.8.0
0
1.9.0
1
1.10.1
2
NodeJS
nodejs
6.3.1
0
9.2.0
1
10.1.0
2
12.11.1
3
Scheme
scheme
Gauche 0.9.4
0
Gauche 0.9.5
1
Gauche 0.9.8
2
Forth
forth
gforth 0.7.3
0
Prolog
prolog
GNU Prolog 1.4.4
0
GNU Prolog 1.4.5
1
Octave
octave
GNU 4.0.0
0
GNU 4.2.1
1
GNU 4.4.0
2
GNU 5.1.0
3
CoffeeScript
coffeescript
1.11.1
0
2.0.0
1
2.3.0
2
2.4.1
3
Icon
icon
9.4.3
0
9.5.1
1
F#
fsharp
4.1
0
4.5.0
1
Assembler - NASM
nasm
2.11.08
0
2.13.01
1
2.13.03
2
2.14.02
3
Assembler - GCC
gccasm
GCC 6.2.1
0
GCC 8.1.0
1
GCC 9.1.0
2
Intercal
intercal
0.30
0
Nemerle
nemerle
1.2.0.507
0
Ocaml
ocaml
4.03.0
0
4.08.1
1
Unlambda
unlambda
0.1.3
0
Picolisp
picolisp
3.1.11.1
0
17.11.14
1
18.5.11
2
18.9.5
3
SpiderMonkey
spidermonkey
38
0
45.0.2
1
Rhino JS
rhino
1.7.7.1
0
1.7.7.2
1
BC
bc
1.06.95
0
1.07.1
1
CLISP
clisp
GNU CLISP 2.49 - GNU C 5.2.0
0
GNU CLISP 2.49 - GNU C 6.2.1
1
GNU CLISP 2.49.93 - GNU 8.1.0
2
GNU CLISP 2.49.93 - GNU 9.1.0
3
Elixir
elixir
1.3.4
0
1.5.2
1
1.6.4
2
1.9.1
3
Factor
factor
8.25
0
8.28
1
8.29
2
8.31
3
Falcon
falcon
0.9.6.8 (Chimera)
0
Fantom
fantom
1.0.69
0
Nim
nim
0.15.0
0
0.17.2
1
0.18.0
2
Pike
pike
v8.0
0
v8.0.702
1
SmallTalk
smalltalk
GNU SmallTalk 3.2.92
0
OZ Mozart
mozart
2.0.0 (OZ 3)
0
LOLCODE
lolcode
0.10.5
0
Racket
racket
6.11
0
6.12
1
7.4
2
Kotlin
kotlin
1.1.51 (JRE 9.0.1+11)
0
1.2.40 (JRE 10.0.1)
1
1.3.50 (JRE 11.0.4)
2
Whitespace
whitespace
0.3
0
Erlang
erlang
22.1
0
J
jlang
9.01.10
0

Java Example for Execute API Call?

Below is a quick and dirty Java example, but please use your favorite rest API client and JSON Java libraries for clean code and for production use.
1
package com.jdoodle;
2
3
import java.io.BufferedReader;
4
import java.io.IOException;