Step 1: Find Data Source
GitHub was launched in April 2008, and the /events api was published in Feb 2011, so there is a big amount of both historical and realtime data.
1. Historical GitHub events
We can't fetch the historical data from GitHub /events api, but fortunately, they were archived by GH Archive.
GitHub provides 20+ event types, which range from new commits and fork events, to opening new tickets, commenting, and adding members to a project. These events are aggregated into hourly archives, which you can access with any HTTP client:
Query | Downloadable Files |
---|---|
Activity for 1/1/2015 @ 3PM UTC | https://data.gharchive.org/2015-01-01-15.json.gz |
Activity for 1/1/2015 | https://data.gharchive.org/2015-01-01-{0..23}.json.gz |
Activity for all of January 2015 | https://data.gharchive.org/2015-01-{01..31}-{0..23}.json.gz |
2. Realtime GitHub events
According to GitHub Events API Docs, the realtime /events api looks like this:
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/events
<TOKEN>
means personal access token
, it can be used in api requests or git clone/push
instead of password & 2FA code.
Creating a personal access token
You can learn how to generate one by reading: Creating a personal access token. Or just click this link to generate your personal access token quickly, before that you MUST SHOULD know:
Note: Save token to somewhere because you will never see it after closing the tab.
Note: Save token to somewhere because you will never see it after closing the tab.
Note: Save token to somewhere because you will never see it after closing the tab.

There is no need to grant any privilege to this token, that means, leave all checkbox UNCHECKED in the Select scopes
section.
In addition, zero privilege is safe enough.