API
GitHub File Contributors
Get a list of contributors of a GitHub file.
GET https://api.xuann.wang/api/github-file-contributors
Params | Type | Required | Description |
---|---|---|---|
user |
string | ✔ | GitHub username |
repo |
string | ✔ | Repository name |
tree |
string | ❌ | Branch or commit SHA, defaults to HEAD |
path |
string | ✔ | Path of the file |
Example https://api.xuann.wang/api/github-file-contributors?user=octocat&repo=Hello-World&path=/README
Response
[{"id":"251370","username":"Spaceghost"},{"id":"94719050","username":"Cameron423698"}]
The response is cached for 24 hours.
GitHub File Tree
Get a list of files of a GitHub repository.
GET https://api.xuann.wang/github-file-tree
Params | Type | Required | Description |
---|---|---|---|
user |
string | ✔ | GitHub username |
repo |
string | ✔ | Repository name |
tree |
string | ❌ | Branch or commit SHA, defaults to HEAD |
Example https://api.xuann.wang/github-file-tree?user=octocat&repo=Hello-World
Response
{"paths":["README"]}
The response is cached for 24 hours.
Environment variables
FIREBASE_PROJECT_ID
FIREBASE_CLIENT_EMAIL
FIREBASE_PRIVATE_KEY