【问题标题】:Get GitHub Repository Insights via GitHub GraphQL API (v4)通过 GitHub GraphQL API (v4) 获取 GitHub Repository Insights
【发布时间】:2020-01-12 06:40:46
【问题描述】:

我想获取有关我的项目被查看、克隆的次数以及流量来自哪里(个人)的信息。

我目前可以通过单击存储库的Insights 按钮(通过网络界面)查看此Traffic 信息。

GitHub v4 GraphQL API 中是否有用于检索此信息的架构?

我得到的最接近的是以下; nodes 不包含任何统计数据:

{
  viewer {
    repositories(first: 100) {
      totalCount
      nodes {
        name
        description

      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}
// response


{
  "data": {
    "viewer": {
      "repositories": {
        "totalCount": 55,
        "nodes": [
          {
            "name": "Repo Name",
            "description": "Repo Description"
          },
          {
            ...
          }
      }
    }
  }
}

【问题讨论】:

  • 有人吗?有什么事吗?
  • 也在找同样的东西

标签: github graphql analytics github-api github-graphql


【解决方案1】:

目前无法使用 GraphQL API 检索交通信息(如 here 中所述)。
或者,您可以使用GitHub documentation 中所述的 REST API v3。

请注意,查看流量需要具有向所需存储库推送权限的令牌。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-26
    • 2018-03-10
    • 2021-12-28
    • 1970-01-01
    • 2018-08-21
    • 2023-03-08
    • 1970-01-01
    • 2019-12-06
    相关资源
    最近更新 更多