Skip to content

Commit e702ae8

Browse files
author
nightcityblade
committed
docs: add compare API request and response examples
1 parent 84304c4 commit e702ae8

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,39 @@ pnpm run dev
171171

172172
---
173173

174+
---
175+
176+
## 📡 API Example
177+
178+
The compare endpoint accepts one or more `username` query parameters.
179+
180+
### Example request
181+
182+
```bash
183+
curl "http://localhost:3000/api/compare?username=octocat&username=torvalds"
184+
```
185+
186+
### Example response
187+
188+
```json
189+
{
190+
"success": true,
191+
"users": [
192+
{
193+
"username": "octocat",
194+
"name": "The Octocat",
195+
"avatarUrl": "https://avatars.githubusercontent.com/u/583231?v=4",
196+
"repoScore": 87,
197+
"prScore": 64,
198+
"contributionScore": 42,
199+
"finalScore": 73,
200+
"topRepos": [],
201+
"topPullRequests": []
202+
}
203+
]
204+
}
205+
```
206+
174207
## 🌍 Localization
175208

176209
* Supported languages: English 🇺🇸, Arabic 🇸🇦

0 commit comments

Comments
 (0)