API FAQs
What is a credit?
JDoodle uses a credit system to manage daily API usage. Based on your subscription plan, a fixed number of credits are allocated each day. These credits expire at the end of the day and do not roll over; new credits are allocated daily.
Why am I getting a timeout response on my code?
This happens because the REST API has a limited timeout duration. If your program is too large or uses too many libraries, it might exceed this duration. To resolve this, use the WebSocket API, which has a longer timeout.
How can I resolve a CORS issue when testing my application locally?
CORS issues are common when calling APIs from the front end. To avoid this, host the API in your backend instead of calling it directly from the front end.
Can I enable internet access for my API calls?
You can enable internet access by setting the _internetEnabled_
field to _True_
. Note that this feature is only available for paid users with at least a $10 API plan and consumes two credits per REST call. Example:
{
"script": "public class MyClass { public static void main(String args[]) { int x=10; int y=25; int z=x+y; System.out.println(\"Sum of x+y = \" + z); } }",
"internetEnabled": True
}