Overview
HackerEarth is a developer assessment platform, and its API lets you compile and execute code in over 30 programming languages programmatically. You submit source code and input, and the API returns the output, execution time, and memory usage. It is useful for building coding playgrounds, online judges, or automated code evaluation tools.
Beginner Tip
Always check the compile_status field first before reading the output — a compilation error will have an empty run_status output. Use language codes like PYTHON3, C, JAVA exactly as listed in the docs.
Available Data
Example Response
{
"status": "success",
"data": {
"result": "Data from Hackerearth",
"description": "For compiling and running code in several languages",
"timestamp": "2025-01-15T10:00:00Z"
}
} Field Reference
compile_status Compilation result: OK if successful, or CE if there was a compilation error. run_status.status Execution result code: AC (accepted), TLE (time limit exceeded), MLE (memory limit exceeded), or RE (runtime error). run_status.output Standard output produced by the executed program. run_status.time_used Actual CPU time consumed by the program in seconds. run_status.memory_used Memory consumed by the program in kilobytes. Implementation Example
// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://www.hackerearth.com/docs/wiki/developers/v4/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Codeforces
⭐ Beginner's PickCodeforces is a competitive programming platform, and its API lets you retrieve contest data, user statistics, problem sets, and submission results programmatically.
Judge0 CE
⭐ Beginner's PickJudge0 CE is an open-source online code execution API that compiles and runs code in over 60 programming languages.
Mintlify
Mintlify is a documentation platform API that lets you programmatically generate and manage beautiful docs for your code projects.
KONTESTS
KONTESTS provides programmatic access to for upcoming and ongoing competitive coding contests via REST API.