For compiling and running code in several languages.
HackerEarth API V4 provides endpoints for compiling and running code submissions in multiple programming languages, aimed at developers who want to integrate code execution into their own applications. Access requires registering a web application to obtain a client-specific client-secret, which is passed in request headers for authentication, along with a cap on the number of clients per user and the number of free requests.
The API supports only asynchronous code evaluation requests, consolidating what was previously a two-call process in v3 into a single endpoint that handles both compilation and execution. After a request is submitted, a temporary response is returned while the code is queued for processing; clients can poll a getStatus endpoint or supply a callback URL to receive compilation and execution results without polling. A reconciliation endpoint is also provided to retrieve the status of any previous code-evaluation request.
Requests are made via POST with a JSON body specifying the language, source code, optional input, memory limit (up to 262144 KB), time limit (up to 5 seconds), an optional context string for passing client-side identifiers, and an optional callback URL. Responses include status codes such as REQUEST_INITIATED, REQUEST_QUEUED, CODE_COMPILED, REQUEST_COMPLETED, and REQUEST_FAILED, along with execution details like memory used, time used, exit code, and program output.
V4 only supports asynchronous code evaluation, unlike v3 which supported both synchronous and asynchronous requests, and combines compilation and execution into a single API call instead of two.
You register your web application to receive a client-secret, which you pass in the request header under the key client-secret.
Yes, there is a cap on the number of free requests a user can make and the number of clients a user can register.
You can poll the getStatus endpoint or provide a callback URL to receive POST requests with compilation and execution results.
The maximum memory limit is 262144 KB (256 MB) and the maximum time limit is 5 seconds; values above these are capped automatically.
Show your product to thousands of developers
· 100k monthly pageviews
· 7k newsletter subscribers
Get access to Codeforces data.
For compiling and running code in several languages.
Run JMESPath queries on JSON data for filtering, transforming, and extracting results.
Online code execution system.
PHP syntax checker.
Validate Python code syntax.