@rishiverma/leetcode-api-js
v1.0.0
Published
LeetCode, CodeChef, and GeeksforGeeks API client
Maintainers
Readme
LeetCode, CodeChef & GeeksforGeeks API
A comprehensive API wrapper for LeetCode, CodeChef, and GeeksforGeeks. You can use it as a standalone server or as an NPM package in your own Node.js applications.
Installation
npm install leetcode-gfg-codechef-apiUsage as a Package
import { leetcode, codechef, geeksforgeeks } from 'leetcode-gfg-codechef-api';
// LeetCode
const leetcodeProfile = await leetcode.getUserProfile('your_username');
console.log(leetcodeProfile);
// CodeChef
const codechefProfile = await codechef.scrapeUserProfile('your_username');
console.log(codechefProfile);
// GeeksforGeeks
const gfgProfile = await geeksforgeeks.getUserProfile('your_username');
console.log(gfgProfile);Usage as a Server
- Clone the repository
- Install dependencies:
npm install - Start the server:
npm start
The server will run on http://localhost:3000.
Features
- LeetCode: User profile, badges, solved problems, contest history, submissions, calendar, daily question, etc.
- CodeChef: User profile, ratings, rankings, contest history.
- GeeksforGeeks: User profile, stats, solved problems, contest history.
Rate Limiting
The server includes rate limiting (100 requests per 15 minutes) to prevent abuse.
