You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project provides a working Node.js API to interact with LeetCode's public GraphQL API, focusing on fetching submission calendars and other user statistics. The API simplifies querying LeetCode's data by providing structured endpoints.
6
+
7
+
## Features
8
+
9
+
- Fetch user profile information from LeetCode
10
+
- Retrieve submission statistics and calendar data
11
+
- Simplified GraphQL querying through a RESTful API
2. Access the API at `http://localhost:3000/yourLeetcodeUsername`
42
+
43
+
## API Endpoint
44
+
45
+
- **GET /:username** - Fetches the LeetCode profile and submission data for the specified username.
46
+
47
+
### Example Response
48
+
49
+
```json
43
50
{
44
51
"totalSolved": 43,
45
52
"totalSubmissions": [
46
53
{
47
-
"difficulty": "All",
48
-
"count": 58,
49
-
"submissions": 116
54
+
"difficulty": "All",
55
+
"count": 58,
56
+
"submissions": 116
50
57
},
51
58
{
52
-
"difficulty": "Easy",
53
-
"count": 15,
54
-
"submissions": 34
59
+
"difficulty": "Easy",
60
+
"count": 15,
61
+
"submissions": 34
55
62
},
56
63
{
57
-
"difficulty": "Medium",
58
-
"count": 33,
59
-
"submissions": 54
64
+
"difficulty": "Medium",
65
+
"count": 33,
66
+
"submissions": 54
60
67
},
61
68
{
62
-
"difficulty": "Hard",
63
-
"count": 10,
64
-
"submissions": 27
69
+
"difficulty": "Hard",
70
+
"count": 10,
71
+
"submissions": 27
65
72
}
66
73
],
67
74
"totalQuestions": 2738,
@@ -84,3 +91,26 @@ Response is like this:
84
91
}
85
92
}
86
93
```
94
+
## Project Structure
95
+
- `index.js` -Main server file that sets up the Express server and API routes.
96
+
- `leetcode.js` -Contains the logic for interacting with LeetCode's GraphQL API.
97
+
- `package.json` - Project metadata and dependencies.
98
+
99
+
## Demo
100
+
101
+
You can view a live demo of the project [here](https://leetcode-api-faisalshohag.vercel.app/). *(Please note that it may take a few seconds for the server to wake up.)*
102
+
103
+
## Contributing
104
+
105
+
Contributions are welcome! Please feel free to submit a pull request or open an issue to discuss improvements or bugs.
106
+
107
+
## License
108
+
109
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
0 commit comments