A simple GitHub contributions API
Introducing my first API built on Next.js: a convenient way to access GitHub contributions via a public API. Simplifying the process, this API connects developers with their GitHub activity, enabling an easy display of your contribution history. Great for howing work and progress on personal websites.
Fetching
It is as simple as fetching the following URL with your desired parameters for user and year.
GET https://github-contributions-n55umvkfm-adomaitisc.vercel.app/<username>/<year>
Response
The response type is very straightforward, it is an array of rows, where we have an array of contributions. Each contribution is an object.
type Contribution = {
count: number;
name: string;
month: string;
day: number;
year: number;
level: string; } | null;
type Row = Contribution[];
type Response = Row[];
Example
Example component can be found on the public repositoryMade by Cauã Adomaitis
Visit my website