Logo
GitHub Stats API
Back
TypeScript Express.js Node.js
@GitHub Stats @SVG
5 days ago

GitHub Stats API

Fast GitHub Stats Graph - Generate beautiful, real-time GitHub stats cards, badges, and contribution graphs for your README files.

Contribution Graph

icon of typescripticon of javascripticon of nodedotjsicon of nextjsicon of shadcnuiicon of nuxticon of postgresqlicon of drizzleicon of tailwindcssicon of laravelicon of csharp

โœจ About Project

GitHub Stats is a high-performance API service that generates beautiful, customizable GitHub statistics cards, badges, and contribution graphs. Built for developers who want to showcase their GitHub activity in README files, portfolios, and documentation. The service features real-time data fetching from GitHub's REST and GraphQL APIs, multi-tier caching with Redis support, and 60+ built-in themes. With TypeScript, Express.js, and SQLite/Drizzle ORM for visitor tracking, it provides a robust and scalable solution for displaying GitHub statistics.

๐Ÿ› ๏ธ Project Tech Stack

  • Core:

    • Node.js v18+
    • TypeScript v5
    • Express.js
  • Data & Caching:

    • GitHub REST API
    • GitHub GraphQL API
    • Redis (optional)
    • SQLite
    • Drizzle ORM
  • Rendering & Export:

    • SVG Generation
    • WebP, PNG, GIF Export
    • Server-side Rendering
  • Development & Deployment:

    • PM2 Cluster Mode
    • Express Rate Limiting
    • CORS Support

๐ŸŒˆ Project Features

  • Stats Cards

    • User statistics with customizable themes
    • Avatar modes (none, avatar, radar)
    • Custom titles and border styles
    • 60+ built-in themes
  • Language Cards

    • Top programming languages
    • Pie chart visualization
    • Detailed language statistics
  • Contribution Graphs

    • Activity heatmaps by year or last 365 days
    • Multiple animation modes (glow, wave, pulse)
    • Size presets (small, medium, large)
    • Multiple export formats (SVG, GIF, WebP, PNG)
  • Badges System

    • User badges (visitors, followers, repos, stars, etc.)
    • Project badges (stars, forks, issues, PRs, etc.)
    • Customizable themes and colors
    • Frame and icon toggle options
  • Icons Library

    • Reusable SVG icons
    • Color customization
    • Glow effects
    • Interactive demo gallery
  • Performance

    • Multi-tier caching (Memory โ†’ Redis โ†’ Source)
    • Intelligent batching
    • 2-hour default TTL
    • Cluster mode for multi-core scaling
  • Monitoring

    • Health check endpoints
    • Cache statistics
    • Performance metrics
    • Visitor tracking with IP hashing

๐Ÿ“Š API Endpoints

Core Routes

  • GET /stats - User statistics card
  • GET /languages - Programming languages card/pie
  • GET /graph - Contribution activity graph

Badge Routes

  • GET /badge/:type - User badges (visitors, repos, followers, stars, etc.)
  • GET /project/:type - Project badges (stars, forks, issues, PRs, etc.)

Utility Routes

  • GET /icons - List all available icons
  • GET /icons/:name - Get specific icon SVG
  • GET /icons/demo - Interactive icons gallery

Monitoring

  • GET /health - Health check
  • GET /cache/health - Cache health status
  • GET /cache/stats - Cache statistics

๐ŸŽจ Themes

60+ built-in themes including:

  • Dark: default, dark, radical, tokyonight, dracula, monokai, gruvbox, onedark
  • Light: solarized-light, graywhite
  • Graph Themes: aurora, matrix, inferno, ocean, neon, solar, galaxy, github-dark

๐Ÿ’ป Preview

Here are example outputs from the API:

GitHub Stats

Languages

Contribution Graph

๐Ÿš€ Usage

In Markdown

markdown
![GitHub Stats](https://stats.pphat.top/stats?username=YOUR_USERNAME)
![Top Languages](https://stats.pphat.top/languages?username=YOUR_USERNAME)
![Activity Graph](https://stats.pphat.top/graph?username=YOUR_USERNAME)

User Badges

markdown
![Visitors](https://stats.pphat.top/badge/visitors?username=YOUR_USERNAME)
![Total Stars](https://stats.pphat.top/badge/total-stars?username=YOUR_USERNAME)
![Followers](https://stats.pphat.top/badge/followers?username=YOUR_USERNAME)

Project Badges

markdown
![Repo Stars](https://stats.pphat.top/project/stars?repo=OWNER/REPO)
![Repo Forks](https://stats.pphat.top/project/forks?repo=OWNER/REPO)
![Contributors](https://stats.pphat.top/project/contributors?repo=OWNER/REPO)

๐Ÿ“ License

MIT License - See LICENSE