GitHub Trending API
GitHub 趋势仓库:描述、语言、总星数与周期内新增星数
数据来源:GitHub
返回统一的 JSON 格式 { code, message, cached, stale, updatedAt, data },支持跨域,免注册每天可免费调用 100 次,注册后每天 10000 次。
获取GitHub Trending
GET /api/hot/github
请求参数
since:时间范围:daily / weekly / monthly,示例weeklylanguage:编程语言(留空为全部),示例javascriptlimit:返回条数上限(1~100,默认全部),示例10
返回字段
source(string):来源 id,固定为 githubtitle(string):榜单名称:未传 language 时为「GitHub Trending」,传了时为「GitHub Trending · 语言」(语言为请求参数 language 的原文)items(array):趋势仓库,按 GitHub Trending 页面顺序排列;该周期没有趋势仓库时为空数组items[].rank(number):排名,从 1 开始连续编号(已去掉广告、无标题等条目后重新编号,可能与上游页面上的名次不同)items[].title(string):仓库全名,格式 owner/repoitems[].url(string):仓库链接 https://github.com/owner/repoitems[].hot(number|null):所选周期内新增的星数:since=daily 为今日、weekly 为本周、monthly 为本月,与 extra.starsInPeriod 相同;页面上没有该数字时为 nullitems[].desc(string|null):仓库描述;仓库没有描述时为 null;已去除 HTML 标签并合并空白,超过 120 字时截断为前 120 字加 …items[].extra(object):该来源特有的附加信息,字段见下。值为空的字段直接省略(不会是 null);全部为空时整个 extra 不返回items[].extra.owner(string):仓库所有者(用户名或组织名)items[].extra.repo(string):仓库名items[].extra.language(string):主要编程语言,如 TypeScript、C++;GitHub 未标注语言时不返回items[].extra.stars(number):仓库总星数items[].extra.forks(number):仓库 fork 数items[].extra.starsInPeriod(number):所选周期内新增的星数,同 hot;页面上没有时不返回