clist icon indicating copy to clipboard operation
clist copied to clipboard

Support questionFrontendId for leetcode.com

Open chinesedfan opened this issue 8 months ago • 0 comments

Now clist invokes https://leetcode.com/contest/api/info/{contestSlug}/ to get question_id, which is different with the id that we see in browsers.

For example, "1791. Find Center of Star Graph", question_id is 1916, but questionFrontendId is 1791.

FYI, I find it can be queried by GraphQL. Not sure whether it can be implemented by clist. You can also search in Github and find more examples.

// https://leetcode.com/graphql/, the request payload is,
{"query":"\n    query questionTitle($titleSlug: String!) {\n  question(titleSlug: $titleSlug) {\n    questionId\n    questionFrontendId\n    title\n    titleSlug\n    isPaidOnly\n    difficulty\n    likes\n    dislikes\n    categoryTitle\n  }\n}\n    ","variables":{"titleSlug":"find-center-of-star-graph"},"operationName":"questionTitle"}

chinesedfan avatar Jun 27 '24 09:06 chinesedfan