skpandey885 / LeetCode-Query

A LeetCode Query API for TypeScript & JavaScript.

Home Page:https://JacobLinCool.github.io/LeetCode-Query/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LeetCode Query

The API to get user profiles, submissions, and problems on LeetCode, with highly customizable GraphQL API and Rate Limiter.

Features

Without Authentication

  • Get Public User Profile.
  • Get User's Recent Submissions. (Public, Max: 20)
  • Get User Contest Records. (thanks to @laporchen)
  • Get All Problem List, or with filter of difficulty and tags.
  • Get Problem Detail.
  • Get Daily Challenge.

Authenticated

  • Get All Submissions of The Authenticated User.
  • Get Submission Details, including the code and percentiles.

Other

  • Customable GraphQL Query API.
  • Customable Rate Limiter. (Default: 20 req / 10 sec)

Examples

Get An User's Public Profile

Includes recent submissions and posts.

import { LeetCode } from "leetcode-query";

const leetcode = new LeetCode();
const user = await leetcode.user("username");

Get All Of Your Submissions

import { LeetCode, Credential } from "leetcode-query";

const credential = new Credential();
await credential.init("YOUR-LEETCODE-SESSION-COOKIE");

const leetcode = new LeetCode(credential);
console.log((await leetcode.submissions(100, 0)));

Documentation

Documentation for this package is available on https://jacoblincool.github.io/LeetCode-Query/.

Links

About

A LeetCode Query API for TypeScript & JavaScript.

https://JacobLinCool.github.io/LeetCode-Query/

License:MIT License


Languages

Language:TypeScript 99.2%Language:JavaScript 0.7%Language:CSS 0.1%