Logo

JDoodle API quickstart

JDoodle’s Compiler APIs let you add code execution to your platform. We support 88 programming languages and come in two forms:

  • REST APIs for simple code execution, and
  • WebSocket APIs for real-time, interactive coding.

Compiler APIs use a credit-based model and need authentication tokens, which you can get from the API dashboard. To use our compiler APIs, you just need an active JDoodle account. We also provide JDroid API, which allows you to use our coding AI for tasks like code generation, optimization, debugging, and translation.

Requirements to use Compiler APIs

To use our compiler APIs, you need:

  • You should have a JDoodle account to use our APIs.
  • Subscribe to our APIs through the API dashboard. To test API capabilities, you can use our daily free 20 credits.

How to use Compiler APIs?

To use our compiler APIs, you must first get an API key.

API key

The client ID and secret key are API keys required to make API calls to JDoodle. After subscribing to an API plan, you can access them through the API dashboard. Learn how to get your Client ID and secret key→

Sending a POST request

After you have your key, you can send a POST request to this endpoint:

https://api.jdoodle.com/v1/execute

If you wish to get an authentication token for a WebSocket API call, use this endpoint:

https://api.jdoodle.com/v1/auth-token

Include the following parameters in your request:

ParametersDescription
clientIdYour client
Standard input arguments languageLanguage of the script version
IndexThe version index of the selected language compile
OnlyThe program will only be compiled and not executed if set to
curl -X POST "https://api.jdoodle.com/v1/auth-token" \
-H "Content-Type: application/json" \
-d '{
  "clientId": "your_client_id_here",
  "clientSecret": "your_client_secret_here",
  "script": "print(\"Hello, World!\")",
  "stdin": "",
  "language": "python3",
  "versionIndex": "3",
  "compileOnly": False
}'

Output parameters

ParameterDescription
outputOutput of the program status
CodeStatus
Code of the result memoryMemory used by the program cpu
TimeC
PU Time used by the program compilationStatusOnly when the “compile
{
  "output": "Hello, World!\n",
  "statusCode": 200,
  "memory": "1024",
  "cpuTime": "0.01",
  "compilationStatus": 0
}

Contact support

Have questions? Here are a few things you can do:

Next Topic REST APIs →