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
Copy file name to clipboardExpand all lines: Readme.md
+49-7
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,25 @@
1
1
# CodeChefAPI
2
-
The codechef API is for educational purposes only. [Heroku deployment](https://codechef-api-education-only.herokuapp.com)
2
+
With CodeChef API you can get stats, contest details, all solved question links, and submission details for any user.
3
3
4
4
## Endpoints
5
-
1. user-stats/<user_name>
6
-
2. contest-details/<user_name>
7
-
3. solved/<user_name>
8
-
4. submission-details/<user_name>
5
+
1. user-stats
6
+
2. contest-details
7
+
3. solved
8
+
4. submission-details
9
9
10
10
### user-stats
11
11
Returns brief details about the user, such as the total number of contests participated, country, division, global rank, etc.
12
12
13
-
#### sample
13
+
#### sample code
14
+
```pycon
15
+
import requests
16
+
17
+
url = "https://domain.com/user-stats"
18
+
res = requests.post(url, headers={"username": "yash2003bisht"})
19
+
print(res.json())
20
+
```
21
+
22
+
#### sample response
14
23
```json lines
15
24
{
16
25
"codechef_pro_plan": "No Active Plan",
@@ -32,6 +41,17 @@ Returns brief details about the user, such as the total number of contests parti
32
41
33
42
### contest-details
34
43
Returns all details about user contests participated.
44
+
45
+
#### sample code
46
+
```pycon
47
+
import requests
48
+
49
+
url = "https://domain.com/contest-details"
50
+
res = requests.post(url, headers={"username": "yash2003bisht"})
51
+
print(res.json())
52
+
```
53
+
54
+
#### sample response
35
55
```json lines
36
56
{
37
57
"contest_details": [
@@ -64,6 +84,17 @@ Returns all details about user contests participated.
64
84
65
85
### solved
66
86
Returns a list of links containing all questions solved by user.
87
+
88
+
#### sample code
89
+
```pycon
90
+
import requests
91
+
92
+
url = "https://domain.com/solved"
93
+
res = requests.post(url, headers={"username": "yash2003bisht"})
94
+
print(res.json())
95
+
```
96
+
97
+
#### sample response
67
98
```json lines
68
99
{
69
100
"solved_links": [
@@ -75,6 +106,17 @@ Returns a list of links containing all questions solved by user.
75
106
76
107
### submission-details
77
108
Returns data from the submissions graph section.
109
+
110
+
#### sample code
111
+
```pycon
112
+
import requests
113
+
114
+
url = "https://domain.com/submission-details"
115
+
res = requests.post(url, headers={"username": "yash2003bisht"})
116
+
print(res.json())
117
+
```
118
+
119
+
#### sample response
78
120
```json lines
79
121
{
80
122
"compile_error": 1,
@@ -86,4 +128,4 @@ Returns data from the submissions graph section.
86
128
}
87
129
```
88
130
89
-
*Note*: The **submission-details**and **contest-details**endpoints may take longer to fetch the data, as the data are loaded dynamically, and we are using selenium to scrape it.
131
+
*Note*: **submission-details** endpoints may take a longer time to fetch data, as there is some animation in data that delays loading graph details, so we are using **selenium** to scrape it.
0 commit comments