Github User Stats API
We are creating blog services using this project Here
Issue
·
EndPoint Document
·
TILog Blog Project
Since the GitHub API only allows 5k requests per hour,
This Project Uses multiple tokens to bypass the Github requests limit.
git clone https://github.com/argon1025/Github-User-Stats-API.git
cd Github-User-Stats-API
npm install
cd Github-User-Stats-API
vi .env
// .env
SERVER_PORT=8484
SERVER_HOST=localhost
GITHUB_TOKEN_1=asdhj123hg12ghj12gjh21g31hj23
GITHUB_TOKEN_2=fgh87fgh687hfg687hfg786fgh867
Enter as many Github tokens as you have. GITHUB_TOKEN_${number}
npm run start:dev
Request User Stats data
curl -X 'GET' \
'http://localhost/stats/{username}' \
-H 'accept: */*'
{
"name": "Leeseongrok",
"totalPRs": 67,
"totalCommits": 1280,
"totalIssues": 108,
"totalStars": 5,
"contributedTo": 0
}
Request User Top language data
curl -X 'GET' \
'http://localhost:8484/stats/{username}/top-language' \
-H 'accept: */*'
{
"JavaScript": {
"name": "JavaScript",
"color": "#f1e05a",
"size": 389697
},
"TypeScript": {
"name": "TypeScript",
"color": "#2b7489",
"size": 147966
},
"Swift": {
"name": "Swift",
"color": "#ffac45",
"size": 74436
},
"Python": {
"name": "Python",
"color": "#3572A5",
"size": 30346
},
"Java": {
"name": "Java",
"color": "#b07219",
"size": 9330
},
}
Request All Repositories data
curl -X 'GET' \
'http://localhost:8484/repo/{username}' \
-H 'accept: */*'
{
"name": "Babelfish_API",
"nameWithOwner": "argon1025/Babelfish_API",
"isPrivate": false,
"isArchived": false,
"isTemplate": false,
"stargazers": {
"totalCount": 2
},
"description": "Babelfish_API",
"primaryLanguage": {
"color": "#f1e05a",
"id": "MDg6TGFuZ3VhZ2UxNDA=",
"name": "JavaScript"
},
"forkCount": 0
}
Request Repositories data
curl -X 'GET' \
'http://localhost:8484/repo/{username}?reponame={reponame}' \
-H 'accept: */*'
{
"name": "Babelfish_API",
"nameWithOwner": "argon1025/Babelfish_API",
"isPrivate": false,
"isArchived": false,
"isTemplate": false,
"stargazers": {
"totalCount": 2
},
"description": "Babelfish_API",
"primaryLanguage": {
"color": "#f1e05a",
"id": "MDg6TGFuZ3VhZ2UxNDA=",
"name": "JavaScript"
},
"forkCount": 0
}
Request pinned Repositories data
curl -X 'GET' \
'http://localhost:8484/repo/argon1025/pinned-repositories' \
-H 'accept: */*'
[
{
"id": "MDEwOlJlcG9zaXRvcnkzMzA1OTM1MDc=",
"name": "Babelfish_API",
"nameWithOwner": "argon1025/Babelfish_API",
"isPrivate": false,
"isArchived": false,
"isTemplate": false,
"stargazers": {
"totalCount": 2
},
"description": "Babelfish_API",
"primaryLanguage": {
"color": "#f1e05a",
"id": "MDg6TGFuZ3VhZ2UxNDA=",
"name": "JavaScript"
},
"forkCount": 0
},
{
"id": "MDEwOlJlcG9zaXRvcnkzMzI3NTY4NTM=",
"name": "babelfish",
"nameWithOwner": "argon1025/babelfish",
"isPrivate": false,
"isArchived": false,
"isTemplate": false,
"stargazers": {
"totalCount": 1
},
"description": "Babelfish Frontend project with React",
"primaryLanguage": {
"color": "#f1e05a",
"id": "MDg6TGFuZ3VhZ2UxNDA=",
"name": "JavaScript"
},
"forkCount": 0
}
]
inspired by this project here
Icons made by Freepik from www.flaticon.com