Skip to content

Repository files navigation

Stats for your README.md

Setup

1. Get a GitHub Personal Access Token

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Click Generate new token (classic)
  3. Give it a descriptive name (e.g. github-stats)
  4. Select the following scope:
    • read:user — read access to your public profile data
  5. Click Generate token and copy the value immediately (it won't be shown again)

2. Set the GITHUB_TOKEN environment variable

Locally: create a .env file at the project root:

GITHUB_TOKEN=your_token_here

On Vercel: add it as an environment variable in your project's dashboard (see Deploy to Vercel below).


Running locally

Prerequisites: Node.js 18+, Vercel CLI (npm i -g vercel)

# Install dependencies
npm install
# Start the local development server (serves /api routes via Vercel CLI)
vercel dev

The API will be available at http://localhost:3000.


Deploy to Vercel

  1. Fork or clone this repository
  2. Import the project in the Vercel dashboard
  3. In Project Settings → Environment Variables, add:
    • GITHUB_TOKEN = your personal access token from the step above
  4. Click Deploy

That's it — Vercel will detect the /api directory and deploy each file as a serverless function automatically.


Known limits

LimitValueReason
Repositories scanned100GitHub GraphQL API maximum per request
Languages fetched per repository10GraphQL query limit
Languages displayed in charts5Top 5 by byte count

If you have more than 100 public repositories, only the most recent 100 will be used when computing statistics.


Reference

GitHub profile statistics

Copy the piece of code from below and paste it into your markdown.
Change the value of username= to your GitHub's username.

[![My Stats](https://github-stats-evirunurm.vercel.app/api/stats.js?username=evirunurm)](https://github.com/evirunurm/github-stats)

`/api/stats.js` endpoint accepts the following parameters.
A query parameter must follow the `parameter=value` structure.
Several parameters must go separated by `&`
ParameterTypeDescription
usernamestringRequired. Your GitHub username
color"white"Set to "white" if you want the background to be white
pengbooleanIf you want the GitHub icon
instead of the cute little
penguin, set this to false.

Most used languages

Copy the piece of code from below and paste it into your markdown.
Change the value of username= to your GitHub's username.

[![My languages](https://github-stats-evirunurm.vercel.app/api/languages.js?username=evirunurm)](https://github.com/evirunurm/github-stats)

`/api/languages.js` endpoint accepts the following parameters.
A query parameter must follow the `parameter=value` structure.
Several parameters must go separated by `&`
ParameterTypeDescription
usernamestringRequired. Your GitHub username
color"white"Set to "white" if you want the background to be white
piebooleanIf you don't want the pie chart but want percentage bars instead, set this to "false".

Examples

GitHub profile statistics

Parameter Output
 default 


peng=false


color=white



Most used languages

Parameter Output
 default 


pie=false


color=white


color=white&pie=false



About

Resources

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages