https://api.github.com/repos/{owner}/{repo}https://api.github.com/repos/microsoft/vscodeGitHub 官方 REST API,owner 是用户名或组织,repo 是仓库名。例如 microsoft/vscode。
返回 stargazers_count(star 数)、forks_count、open_issues_count、language(主语言)、description、license、created_at、pushed_at(最后提交时间)。
未认证请求每小时 60 次,超了会返回 403 并提示 rate limit。做项目展示墙、更新监控时建议服务端缓存 10 分钟,或者带上自己的 token 走 Authorization 头。私有仓库只能带 token 访问。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
owner |
string | 必填 | microsoft | 用户名或组织名 |
repo |
string | 必填 | vscode | 仓库名 |
https://api.github.com/repos/{owner}/{repo}
此处将显示接口返回结果…
{
"full_name": "microsoft/vscode",
"description": "Visual Studio Code",
"stargazers_count": 168000,
"forks_count": 30500,
"language": "TypeScript",
"license": { "spdx_id": "MIT" }
}
—