Github Activity

Definition

Unlike Development Activity, which excludes some of the events, the GitHub Activity metric uses all events to compute the metric.

There are 3 github activity metrics available:

  • github_activity - Computed on-the-fly using the Github data. Because of this, the metric can compute data for any asset or any random Github organization that has public repositories like Google, Facebook, or any other organization.
  • github_activity_1d - Precomputed daily metric for each asset that is available on Santiment. This allows the metric to be aggregated when the value is needed for all assets at once.
  • ecosystem_github_activity - Precomputed for each ecosystem. An ecosystem github activity is defined as the sum of the github activities of all assets that belong to it. For example the ethereum ecosystem contains all the projects that build on the Ethereum blockchain or contribute to the blockchain in any other way.

Versions

github_activity has two versions:

VersionVersion nameDescription
1.0original:v1The default. Counts the unique GitHub events of an organization.
2.0modern:v1Removes the activity of bots, both official bot accounts and suspicious activity from personal accounts.

Version 2.0 is designed to measure the work done by people rather than by bots and automation:

  • Official bot accounts. Activity from accounts that identify as bots, such as Dependabot and other GitHub apps, is removed.

  • Unofficial bots. Some automation runs under regular, personal accounts, so its name does not show that it is a bot. Version 2.0 recognizes it by its behavior, looking at each account one UTC day at a time:

    • Removed. A person does not work around the clock or at a machine’s pace. If an account contributes code in 20 or more different hours of a day, or makes 100 or more code contributions within a single hour, all of its activity in that GitHub organization on that day is removed. For example, an account that makes 150 code contributions between 14:00 and 15:00 UTC is treated as a bot for that day, and its activity outside that busy hour is removed too.
    • Limited. An account below these limits can still be very busy in a single repository. Its code contributions in one repository count as at most 100 per day. For example, 400 code contributions in one repository on one day count as 100.

    Only development-related activity counts toward these checks. Activity such as deleting many branches in quick succession, forking or watching repositories, or commenting on issues never marks an account as a bot and never triggers the daily limit.

Pass the version in the version argument of getMetric. When it is omitted, version 1.0 is used. Both versions are free. Only github_activity has version 2.0; the precomputed, ecosystem and change metrics have only version 1.0.

{
getMetric(metric: "github_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-30d"
to: "utc_now"
interval: "1d"
)
}
}

See Development Activity Versions for the full description of version 2.0.


Access

Free Access


Data Type

Timeseries Data


Change Metrics

Change Metrics


Frequency


Latency

Development Activity Data Latency


Available Assets


SanAPI

Fetch the GitHub activity for an asset:

{
getMetric(metric: "github_activity") {
timeseriesDataJson(
slug: "santiment"
from: "2020-01-13T00:00:00Z"
to: "2020-01-18T00:00:00Z"
interval: "1d"
)
}
}

Fetch the github_activity for an arbitrary organization. You need to provide only the organization name to the parameter, not the whole URL. Github links look like this: https://github.com/<organization>/<repository>.

{
getMetric(metric: "github_activity") {
timeseriesDataJson(
selector: {organization: "google"}
from: "2020-01-13T00:00:00Z"
to: "2020-01-18T00:00:00Z"
interval: "1d"
)
}
}

Fetch the ecosystem_github_activity, combining the GitHub activities of all assets that contribute to that ecosystem:

{
getEcosystems(ecosystems: ["ethereum"]) {
timeseriesDataJson(
metric: "ecosystem_github_activity"
from: "2024-03-01T00:00:00Z"
to: "2024-03-10T00:00:00Z"
interval: "1d")
}
}

To check what assets are part of the ecosystem and what are their github links:

{
getEcosystems(ecosystems: ["ethereum"]) {
name
projects {
slug
githubLinks
}
}
}

Run in Explorer


GitHub Activity Change for Ethereum Repository Over 7 Days

{
getMetric(metric: "github_activity_change_30d") {
timeseriesDataJson(
slug: "ethereum"
from: "2024-01-01T00:00:00Z"
to: "2024-01-07T00:00:00Z"
interval: "1d"
)
}
}

Version 2.0 Queries

The queries below use version 2.0 (modern:v1). See Development Activity Versions for how it differs from version 1.0.

Compare version 1.0 and version 2.0 side by side. The difference shows how much of the activity comes from bots and suspicious activity:

{
original: getMetric(metric: "github_activity", version: "original:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-30d"
to: "utc_now"
interval: "1d"
)
}
modern: getMetric(metric: "github_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-30d"
to: "utc_now"
interval: "1d"
)
}
}

Compare dev_activity and github_activity in version 2.0. The difference is the activity that is not development work, such as issues, comments and stars. In version 2.0, github_activity is never lower than dev_activity:

{
dev: getMetric(metric: "dev_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-30d"
to: "utc_now"
interval: "1d"
)
}
github: getMetric(metric: "github_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-30d"
to: "utc_now"
interval: "1d"
)
}
}

Fetch the total version 2.0 GitHub activity over the last 90 days:

{
getMetric(metric: "github_activity", version: "modern:v1") {
aggregatedTimeseriesData(
slug: "ethereum"
from: "utc_now-90d"
to: "utc_now"
aggregation: SUM
)
}
}

Smooth the daily values with a 7-day moving average:

{
getMetric(metric: "github_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-90d"
to: "utc_now"
interval: "1d"
transform: {type: "moving_average", movingAverageBase: 7}
)
}
}

Fetch hourly values. The bot checks look at whole UTC days, so a day’s activity is removed or limited the same way with hourly intervals:

{
getMetric(metric: "github_activity", version: "modern:v1") {
timeseriesDataJson(
slug: "ethereum"
from: "utc_now-2d"
to: "utc_now"
interval: "1h"
)
}
}

Full List of Metrics

The full list of GitHub Activity metrics is:

Open Metrics List
  • ecosystem_github_activity
  • github_activity_change_30d