GitHub 总榜
GitHub 全站热门仓库总榜单,按 Star 数降序排列,可指定查看数量
GET
https://api.tinyaii.cn/v1/github/top
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| count | int | 可选 | 返回数量(默认10,最大100) | 10 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| total_repos | int | 匹配的仓库总数 |
| count | int | 本次返回数量 |
| repos | array | 仓库列表 |
| repos[].rank | int | 排名 |
| repos[].name | string | 仓库全名(owner/name) |
| repos[].description | string | 仓库描述 |
| repos[].stars | int | Star 数 |
| repos[].forks | int | Fork 数 |
| repos[].language | string | 主要编程语言 |
| repos[].url | string | 仓库链接 |
| repos[].created_at | string | 创建时间 |
| repos[].updated_at | string | 更新时间 |
返回示例
{
"code": 200,
"data": {
"total_repos": 3000000,
"count": 3,
"repos": [
{
"rank": 1,
"name": "freeCodeCamp/freeCodeCamp",
"description": "freeCodeCamp.org's open source codebase",
"stars": 400000,
"forks": 37000,
"language": "TypeScript",
"url": "https://github.com/freeCodeCamp/freeCodeCamp"
}
]
}
}
调用示例
curl "https://api.tinyaii.cn/v1/github/top?count=10" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/github/top?count=10", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/github/top",
params={"count": "10"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。