Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-contri-api

Cloudflare Worker that merges the functionality of the original githubchart-api, githubchart, and deno-github-contributions-api projects into a single JavaScript service. It renders a GitHub-style contribution chart as an SVG without relying on CORS proxies.

Usage

Deploy the worker and access it with the following URL format:

https://gitchart.tanjunkiat.dev/<BASE-COLOR>/<BG-COLOR>/<USER>
  • BASE-COLOR and BG-COLOR are optional hexadecimal color strings (3 or 6 characters).
  • If both are omitted, the default GitHub-like palette is used.
  • Preset names default, halloween, and teal mirror the legacy API behavior.

The worker code lives in gh-contri-api/src/worker.js and renders the SVG by scraping public GitHub contribution data. Color schemes mirror the original Ruby API, including custom base/background combinations and preset palettes.

Example charts

Below are some sample charts rendered through the worker using the jacktan-jk account. You can use these as references for color configuration.

Default palette on dark background

https://gitchart.tanjunkiat.dev/jacktan-jk

Default palette on dark background

Teal palette on dark background

https://gitchart.tanjunkiat.dev/teal/jacktan-jk

Teal palette on dark background

Halloween palette on dark background

https://gitchart.tanjunkiat.dev/halloween/jacktan-jk

Halloween palette on dark background

Custom base/background colors

https://gitchart.tanjunkiat.dev/978934/393937/jacktan-jk

Custom colors (base 978934, bg 393937)

Development

  1. Install dependencies
cd gh-contri-api
npm install
  1. Validate the worker syntax
npm run check
  1. Deploy with Wrangler (requires a Cloudflare account and authentication)
wrangler publish

Credits

This project combines ideas and behavior from:

  • githubchart-api – original Ruby API that returns GitHub-style contribution charts as SVG.
  • githubchart (Ruby gem) – underlying chart-generation library used by the original API.
  • deno-github-contributions-api – Deno-based API for fetching GitHub contribution data.

All trademarks and GitHub logos or styles are the property of their respective owners. This project is not affiliated with or endorsed by GitHub.

About

Cloudflare Worker that scrapes public GitHub contribution data and renders a customizable GitHub-style contribution chart as an SVG, merging the behavior of githubchart-api, githubchart, and deno-github-contributions-api into a single CORS-free API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages