File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,6 +171,59 @@ pnpm run dev
171171
172172---
173173
174+ ## 📡 API Examples
175+
176+ ### Compare two developers
177+
178+ ** Request:**
179+ ``` bash
180+ GET /api/compare? username=torvalds& username=gvanrossum
181+ ```
182+
183+ ** Response:**
184+ ``` json
185+ {
186+ "success" : true ,
187+ "users" : [
188+ {
189+ "username" : " torvalds" ,
190+ "repoScore" : 9850 ,
191+ "prScore" : 120 ,
192+ "contributionScore" : 45 ,
193+ "finalScore" : 4552 ,
194+ "topRepos" : [
195+ { "name" : " linux" , "stars" : 180000 , "forks" : 52000 }
196+ ],
197+ "topPullRequests" : []
198+ },
199+ {
200+ "username" : " gvanrossum" ,
201+ "repoScore" : 4200 ,
202+ "prScore" : 980 ,
203+ "contributionScore" : 310 ,
204+ "finalScore" : 2370 ,
205+ "topRepos" : [
206+ { "name" : " cpython" , "stars" : 61000 , "forks" : 29000 }
207+ ],
208+ "topPullRequests" : [
209+ { "title" : " bpo-12345: fix typing module" , "repo" : " python/cpython" }
210+ ]
211+ }
212+ ]
213+ }
214+ ```
215+
216+ ### Error response (user not found)
217+
218+ ``` json
219+ {
220+ "success" : false ,
221+ "error" : " GitHub user not found"
222+ }
223+ ```
224+
225+ ---
226+
174227## 🌍 Localization
175228
176229* Supported languages: English 🇺🇸, Arabic 🇸🇦
You can’t perform that action at this time.
0 commit comments