Chart API
Chart API · Guide

Add a chart to a GitHub README

GitHub Markdown can't run chart code, but it shows images. Render the chart once and paste its link as a Markdown image; a small GitHub Action can refresh it on a schedule.

GitHub starsLine chart titled "GitHub stars". Values: Jul: 120, Aug: 180, Sep: 260, Oct: 410, Nov: 530.GitHub stars100200300400500600JulAugSepOctNov120180260410530

1. Get a chart link

Call the API once with your key (or ask an AI assistant with the MCP server to make the chart). Use the url from the answer (the MCP tool also gives you a ready-made Markdown line).

POST JSON · curl
curl -s -X POST "https://kitforge-chart-api.kitforgelabs.workers.dev/v1/chart?response=json" \
  -H "Authorization: Bearer YOUR_KEY" -H "content-type: application/json" \
  -d '{"type":"line","title":"GitHub stars","values":true,
       "labels":["Jul","Aug","Sep","Oct","Nov"],"data":[120,180,260,410,530]}' | jq -r .url

2. Paste it into the README

README.md
![GitHub stars: Jul 120, Aug 180, Sep 260, Oct 410, Nov 530](PASTE_THE_URL_HERE)

GitHub serves the image through its own image cache, so your readers never call our API directly, and viewing the chart is free.

3. Optional: keep it up to date with a GitHub Action

A signed URL always shows the same numbers. To update the chart, render a new one and replace the link. Store your key as the repository secret KITFORGE_KEY and mark the image in the README with <!-- chart --> comments:

GitHub Actions
# .github/workflows/chart.yml
name: Update README chart
on:
  schedule: [{ cron: '0 6 * * 1' }]   # Mondays 06:00 UTC
  workflow_dispatch:
permissions: { contents: write }
jobs:
  chart:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Render chart
        env: { KITFORGE_KEY: ${{ secrets.KITFORGE_KEY }} }
        run: |
          # Build your numbers here (from a file, an API, git history …)
          BODY='{"type":"line","title":"Weekly downloads","labels":["W1","W2","W3","W4"],"data":[310,420,390,510]}'
          URL=$(curl -sf -X POST "https://kitforge-chart-api.kitforgelabs.workers.dev/v1/chart?response=json" \
            -H "Authorization: Bearer $KITFORGE_KEY" -H "content-type: application/json" -d "$BODY" | jq -r .url)
          perl -0pi -e "s|<!-- chart -->.*?<!-- /chart -->|<!-- chart -->![Weekly downloads](${URL})<!-- /chart -->|s" README.md
      - name: Commit
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git commit -am "Update README chart" || echo "No change"
          git push

Each run with new numbers uses one credit; a run with unchanged numbers renders the same chart again for free. A weekly chart for a year is 52 credits, well inside the 50 free ones.

The same image link works in GitLab, Notion, Obsidian, Docusaurus and anything else that shows Markdown images.

Try it free. Draw any chart in the playground (runs in your browser, no key), then get a free key for 50 charts. One Kitforge key also works for the Tech Stack API. Packs from $5 for 2,000 charts, pricing.

More guides: Charts in email · Charts from AI assistants (MCP) · Charts in n8n