Sometimes it is good to look at your contribution history on the platform you are involved in so much. It gives an idea about what you have done, what happened to your life during certain moments, etc… Github’s contribution history is great to see that it also allows you to select the year, but it forgets to provide a full retrospective history.
While I had been pondering how I should look for the previous years, I had known that the only way of doing it by an API call that Github provides. So, I’ve gone into the API docs to understand which API gives the need I was in; it turned out it was the Graphql API of Github hosted on
I knew the language I would use to write the API; it was
Scala. Henceforth, what you will see as the examples and code pieces will be the
Scala source code.
If we take a closer look at the Github API, it needs a token, that’s obvious, then a Grapql query that accepts a
year that you’re interested in:
And it creates a query string that consists of a given
username and a
year So, an
HTTP GET request is made with this query, and we get results for the given year, although year actually is a multiple-input that the user can provide. That naturally leads us to see what the URL looks like;
So, it asks Github’s API for given user’s contributions from 2008 until 2020. The result is an