This API fetches and parses GitHub user contribution data. It provides two formats: flattened and sequentialized.
Fetches and processes contribution data for a GitHub user.
user
: GitHub username.sequence
: Optional. Set to"true"
to get sequentialized data. Defaults to flattened format.
GET /u/octocat
GET /u/octocat?sequence=true
- 200: JSON array of contribution data.
- 500: Error fetching or parsing data.
- Fetch raw HTML from the user's GitHub contributions page.
- Parse data using JSDOM to extract dates and contribution levels.
- Return data either in flattened or sequentialized format.
[
{
"date": "2025-04-01",
"level": "1"
},
{
"date": "2025-04-02",
"level": "2"
}
]
-
Clone the repository:
git clone https://github.com/yourusername/github-contributions-api.git
-
Install dependencies:
npm install
-
Run the server:
npm start
Server runs at http://localhost:4000
.
- Node.js
- TypeScript
- express
- jsdom
MIT License.