1.0.2 • Published 4 months ago

leetcode-user-api v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

šŸš€ LeetCode User API - NPM Package

NPM Version

Downloads Contributions

šŸ” Fetch LeetCode user profile data using an easy-to-use Node.js package & CLI tool. Perfect for integrating LeetCode stats into your projects, bots, or dashboards! šŸ“Š


🌟 Features

āœ… Fetch user profile details from LeetCode
āœ… Get ranking, reputation, solved problems, and avatar
āœ… CLI support for quick terminal access
āœ… Zero configuration – Just install & use
āœ… Error handling for smooth API usage


šŸš€ Installation

Install as a Node.js Package

npm install leetcode-user-api

Install as a Global CLI

npm install -g leetcode-user-api

šŸ”„ Usage

1ļøāƒ£ Import & Use in JavaScript

const { getLeetCodeUser } = require("leetcode-user-api");

getLeetCodeUser("kamran534055")
  .then(console.log)
  .catch(console.error);

2ļøāƒ£ Use as CLI

leetcode-user kamran534055

āœ… Output:

{
  "username": "kamran534055",
  "realName": "Muhammad Kamran",
  "aboutMe": "N/A",
  "ranking": 2079378,
  "reputation": 0,
  "avatar": "https://assets.leetcode.com/users/kamran534055/avatar_1739624955.png",
  "problemsSolved": [
    {
      "difficulty": "All",
      "count": 40
    },
    {
      "difficulty": "Easy",
      "count": 21
    },
    {
      "difficulty": "Medium",
      "count": 18
    },
    {
      "difficulty": "Hard",
      "count": 1
    }
  ]
}

šŸ›  Error Handling

ErrorDescription
`Invalid username provided.`The username is missing or incorrect.
`User not found.`The user does not exist on LeetCode.
`Error fetching LeetCode data.`API request failed due to network issues.

šŸ’– Support & Contact

If you find this project helpful, please ⭐ star the repo and share it!
For any issues or feature requests, open an issue. šŸš€

šŸ’» Developed by Muhammad Kamran

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago