{"id":15470332,"url":"https://github.com/piedcipher/hackerearth-api","last_synced_at":"2026-04-06T06:04:30.308Z","repository":{"id":56831896,"uuid":"219170167","full_name":"piedcipher/hackerearth-api","owner":"piedcipher","description":":candy: Simple and easy-to-use Dart wrapper for HackerEarth API (Compile \u0026 Run)","archived":false,"fork":false,"pushed_at":"2019-11-03T12:56:01.000Z","size":45,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T12:06:53.000Z","etag":null,"topics":["api","dart","dartlang","flutter","hackerearth","hackerearth-api","package","wrapper"],"latest_commit_sha":null,"homepage":"http://pub.dev/packages/hackerearth_api","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piedcipher.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-02T15:04:23.000Z","updated_at":"2025-04-06T21:25:20.000Z","dependencies_parsed_at":"2022-09-07T16:02:52.790Z","dependency_job_id":null,"html_url":"https://github.com/piedcipher/hackerearth-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piedcipher%2Fhackerearth-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piedcipher%2Fhackerearth-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piedcipher%2Fhackerearth-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piedcipher%2Fhackerearth-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piedcipher","download_url":"https://codeload.github.com/piedcipher/hackerearth-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237832,"owners_count":21397401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dart","dartlang","flutter","hackerearth","hackerearth-api","package","wrapper"],"created_at":"2024-10-02T02:04:07.498Z","updated_at":"2026-04-06T06:04:25.288Z","avatar_url":"https://github.com/piedcipher.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HackerEarth API\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/piedcipher/hackerearth-api/master/img/logo.png?token=ADGVHWMF4OJ634ZNAZ3DFB25X3GHU\" alt=\"logo\"\u003e\u003c/p\u003e\n\nSimple and easy-to-use Dart wrapper for [HackerEarth API](https://www.hackerearth.com/docs/wiki/developers/v3/) which provides endpoints for compiling and running code in several languages.\n\n## Usage\n\nA simple usage example:\n\n```dart\n// Import this package\nimport 'package:hackerearth_api/hackerearth_api.dart';\n\nvoid main() async {\n    \n    // Create instance and supply client_secret obtained from https://www.hackerearth.com/api/register/\n    HackerEarthApiWrapper hackerEarthApiWrapper = HackerEarthApiWrapper(\n        clientSecret: 'PUT_CLIENT_SECRET',\n    );\n\n    /**\n    Call makeRequest method and supply following arguments:\n    \n        compileAndRun:\n            - If it is true then code will be compiled and run.\n            - Otherwise code will be compiled. (Default will be false if nothing is supplied)\n\n        programmingLanguage:\n            - Language.C\n            - Language.CPP\n            - Language.CPP11\n            - Language.CLOJURE\n            - Language.CSHARP\n            - Language.GO\n            - Language.JAVA\n            - Language.JAVASCRIPT\n            - Language.JAVASCRIPT_NODE\n            - Language.HASKELL\n            - Language.OBJECTIVEC\n            - Language.PASCAL\n            - Language.PERL\n            - Language.PHP\n            - Language.PYTHON\n            - Language.R\n            - Language.RUBY\n            - Language.RUST\n            - Language.SCALA\n        \n        sourceCode:\n            - Add source code in a multiline string\n    */\n    Map\u003cString, dynamic\u003e response = await hackerEarthApiWrapper.makeRequest(\n        compileAndRun: false,\n        programmingLanguage: Language.PYTHON,\n        sourceCode:\n'''from itertools import permutations\nprint(\"Hello World!\")\nprint(list(permutations('123')))\nprint(list(map(lambda x: str(x) + ' is a number', range(5))))''',\n    );\n\n    /*\n    Sample Responses\n    ----------------\n    1) Successful compilation:\n        {\n            async: 0,\n            compile_status: OK,\n            web_link: https://code.hackerearth.com/d88c2di,\n            code_id: d88c2di,\n            id: d88c2di\n        }\n    \n    2) Unsuccessful compilation:\n        {\n            async: 0,\n            compile_status: File \"/hackerearth/PYTHON_d077_d572_cdb9_ee8c/s_6ae6_4578_a41d_ecc3.py\", line 4 print(list(map(lambda x: is a number,\n            web_link: https://code.hackerearth.com/0641ffD,\n            code_id: 0641ffD,\n            id: 0641ffD\n        }\n\n    3) Successful execution:\n        {\n            run_status: {\n                memory_used: 64,\n                time_limit: 5,\n                output_html: Hello\u0026nbsp;World!\u003cbr\u003e,\n                memory_limit: 262144,\n                time_used: 0.108346,\n                signal: OTHER,\n                status_detail: NA,\n                status: AC,\n                stderr: ,\n                output: Hello World!,\n                async: 0,\n                request_NOT_OK_reason: ,\n                request_OK: True\n            },\n            compile_status: OK,\n            web_link: https://code.hackerearth.com/2abc05e,\n            code_id: 2abc05e\n        }\n\n    4) Unsuccessful execution:\n        {\n            run_status: {\n                status: CE,\n                status_detail: Correct the compilation/syntax errors.\n            },\n            compile_status: File \"/hackerearth/PYTHON_2dda_30d1_0ad8_fef2/s_99dd_2250_d952_b026.py\", line 4 print(list(map(lambda x: is a number,\n            web_link: https://code.hackerearth.com/6b9837K,\n            code_id: 6b9837K\n        }\n    */\n    print(response);\n    print(hackerEarthApiWrapper.response); // same as above response variable\n\n    /*\n        1) Successful execution response log with emojis:\n            💾 Memory Limit: 262144\n            💾 Memory Used: 64\n            ⏲ Time Limit: 5\n            ⏲ Time Used: 0.108573\n            ✔️ Status: AC\n            🆗 Compile Status: OK\n            🔗 Web Link: https://code.hackerearth.com/e288deG\n            🧾 Output: \n            ----------\n            Hello World!\n            [('1', '2', '3'), ('1', '3', '2'), ('2', '1', '3'), ('2', '3', '1'), ('3', '1', '2'), ('3', '2', '1')]\n            ['0 is a number', '1 is a number', '2 is a number', '3 is a number', '4 is a number']\n\n        2) Successful execution response log without emojis:\n            Memory Limit: 262144\n            Memory Used: 64\n            Time Limit: 5\n            Time Used: 0.108573\n            Status: AC\n            Compile Status: OK\n            Web Link: https://code.hackerearth.com/e288deG\n            Output: \n            -------\n            Hello World!\n            [('1', '2', '3'), ('1', '3', '2'), ('2', '1', '3'), ('2', '3', '1'), ('3', '1', '2'), ('3', '2', '1')]\n            ['0 is a number', '1 is a number', '2 is a number', '3 is a number', '4 is a number']\n    */\n    String prettyLog = hackerEarthApiWrapper.responseLog(withEmoji: true);\n    print(prettyLog);\n}\n```\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/piedcipher/hackerearth_api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiedcipher%2Fhackerearth-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiedcipher%2Fhackerearth-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiedcipher%2Fhackerearth-api/lists"}