GitHub API获取用户/组织总数 [英] GitHub API get total number of users/organizations
问题描述
使用 GitHub API ,我如何计算截止到那时的用户/组织总数请求?
Using GitHub API, how can I count the total number of users/organizations at the time of the request?
Users and Organizations API responses do not contain last
Link header.
注意:由于推荐答案
您可以获取用户数&使用 GraphQL API v4
GraphQL API v4
{
user: search(type: USER, query: "type:user") {
userCount
}
org: search(type: USER, query: "type:org") {
userCount
}
}
{
"data": {
"user": {
"userCount": 24486303
},
"org": {
"userCount": 1629433
}
}
}
REST API v3
使用
type:user
的type:org
的搜索查询: https://api.github. com/search/users?q = type%3Aorg
REST API v3
- search query with
type:user
: https://api.github.com/search/users?q=type%3Auser - search query with
type:org
: https://api.github.com/search/users?q=type%3Aorg - : https://github.com/search?q=type%3Auser&type=Users&utf8=%E2%9C%93
- 对于组织机构: https://github.com/search?utf8=%E2%9C%93&q=type%3Aorg&type=Users
- for user : https://github.com/search?q=type%3Auser&type=Users&utf8=%E2%9C%93
- for org : https://github.com/search?utf8=%E2%9C%93&q=type%3Aorg&type=Users
结果为total_count
字段提供所需的值
The result gives total_count
field with the required value
它与您可以使用Github搜索找到的结果相匹配:
It matches the result you can find using Github search :
-
用户的
这篇关于GitHub API获取用户/组织总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!