package
0.0.0-20240909090913-463067f1665d
Repository: https://github.com/hud0shnik/githubstatsapi.git
Documentation: pkg.go.dev

# README

๐Ÿ™ GithubStatsAPI v2 ๐Ÿ“ˆ

Overview

Difference

Version 2 use special structure for errors

apiError

FieldTypeDescription
successboolalways "false" for errors
errorstring

Version 2 has new structures (without "success" and "error") and HTTP response status codes (200, 404, 500 and 400)

Commits

Request

https://githubstatsapi.vercel.app/api/v2/commits
ParameterValue typeRequiredDescription
idstringYesusername
datestringNodate (like 2022-01-21)

Structures

UserCommits

FieldTypeDescription
datestringdate (like 2022-01-21)
usernamestring
commitsint
colorint

color is color of the cell. There are 5 colors in total: from gray (0) to bright green (4)

User

Request

https://githubstatsapi.vercel.app/api/v2/user
ParameterValue typeRequiredDescription
idstringYesusername
typestringNoresponse type (like "string")

Structures

UserInfo

FieldTypeDescription
usernamestring
namestring
followersstring
followingstring
repositoriesstring
packagesstring
starsstring
contributionsstring
statusstring
avatarstringavatar url

Repo

Request

https://githubstatsapi.vercel.app/api/v2/repo
ParameterValue typeRequiredDescription
usernamestringYesusername
reponamestringYesreponame
typestringNoresponse type (like "string")

Structures

RepoInfo

FieldTypeDescription
usernamestring
reponamestring
commitsstring
branchesstring
tagsstring
starsstring
watchingstring
forksstring

Samples

Request

https://githubstatsapi.vercel.app/api/v2/commits?id=hud0shnik&date=2023-04-28

Response

{
  "date": "2023-04-28",
  "username": "hud0shnik",
  "commits": 8,
  "color": 4
}

Request

https://githubstatsapi.vercel.app/api/v2/user?id=hud0shnik

Response

{
  "username": "hud0shnik",
  "name": "Danila Egorov",
  "followers": 62,
  "following": 0,
  "repositories": 31,
  "packages": 0,
  "stars": 9,
  "contributions": 0,
  "status": "Drawin'",
  "avatar": "https://avatars.githubusercontent.com/u/42404892?v=4"
}

Request

https://githubstatsapi.vercel.app/api/v2/repo?username=hud0shnik&reponame=osustatsapi

Response

{
  "username": "hud0shnik",
  "reponame": "osustatsapi",
  "commits": 690,
  "branches": 1,
  "tags": 0,
  "stars": 2,
  "watching": 1,
  "forks": 1
}

License - BSD 3-Clause

# Functions

ะ ะพัƒั‚ "/commits".
ะ ะพัƒั‚ "/repo".
ะ ะพัƒั‚ "/user".