---
title: Generate static images of your GitHub contribution chart
date: 2026-05-08 07:13
slug: generate-static-images-of-your-github-contribution-chart
categories:
- Blog
- Code
tags:
- github
- api
- terminalwidget
- contrib
---

I just shipped a small API that generates static images of
your GitHub contribution graph, and you can try it [here][1].
My goal was graphs in TerminalWidget, but I
figured it would be useful in more places than that.

### Why I built this

I wanted to show an activity graph in TerminalWidget.
The easiest path turned out to be pulling contribution data
from GitHub GraphQL and rendering the result as an image.

I looked around for an API that does this. I'm sure there's
one (or more) out there, but I didn't find them quickly
enough, and what I did find didn't have the options I
needed.

### What it does right now

The endpoint generates PNGs that look like GitHub profile
contribution charts, with a handful of color themes if you
want something other than the default look.

For now, this is intentionally focused: generate a chart
image quickly and keep the output predictable.

In addition to color themes, I included options for image
size (up to 4000px), number of months to show, and whether
or not to add captions.

There's an API tester with live image preview at [/contrib][1]:

[

![API Tester Screenshot](https://brettterpstra.com/uploads/2026/05/api-tester-themes.jpg)

][1]

### TerminalWidget example

Here is the command I use to generate a [TerminalWidget][2]
update:

```bash
terminal-widget --target github --image "https://brettterpstra.com/contrib/generate?username=ttscoff&months=5&theme=neon&download=1" --padding 0 --bg 000000
```

![Contribution Graph in TerminalWidget](https://brettterpstra.com/uploads/2026/05/contrib-widgets.jpg)

If you're already using TerminalWidget, this makes it dead
simple to drop your recent GitHub activity right into your
widget feed. If you want onto the TerminalWidget beta to try
it out, [sign up here][3]. The latest iOS build is available
now, and the matching macOS build is still waiting for
review but will work for this purpose (and many others).

### What's next

I may extend this with additional chart formats in the
future. For now, the goal was to get a solid GitHub-style
graph renderer up and running with useful customization.

You can play with the API and get full documentation at [brettterpstra.com/contrib][1].

[1]: /contrib/
[2]: https://terminalwidget.app
[3]: https://testflight.apple.com/join/5ZSrz3fd

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
