🚀 A handy tool to view your own GitHub repository traffic statistics
- Traffic statistics for all your repositories (views/clones)
- Visualization over time
- Multi-language support (EN/TR)
- Pagination and filtering
-
Fork this repository:
- Click the "Fork" button in the top-right corner to copy it to your GitHub account
-
Create a Personal Access Token (PAT):
- Click your profile picture in the top-right corner of GitHub > "Settings" > "Developer settings" > "Personal access tokens" > "Tokens (classic)"
- Click "Generate new token" > "Generate new token (classic)"
- Give your token a name (e.g., "Repo Traffic Viewer")
- Select the following permissions: (admin:repo_hook, read:org, repo)
repo(full control)workflow(to run Actions)
- Click "Generate token"
- Save the generated token somewhere safe – it will only be shown once!
-
Add the token as a Repository Secret:
- Go to your forked repository > "Settings" > "Secrets and variables" > "Actions"
- Click "New repository secret"
- Enter
PERSONAL_ACCESS_TOKENin the Name field - Paste your token in the Value field
- Click "Add secret"
-
Enable GitHub Pages:
- In your forked repository, go to "Settings" > "Pages"
- Under "Source", select "Deploy from a branch"
- Select "main" as the branch and "/docs" as the folder
- Click Save
-
Run Actions manually (for initial data collection):
- Go to the "Actions" tab in your forked repository
- Select the "GitHub Traffic Data Collector" workflow
- Click "Run workflow" to trigger it manually
- This will collect the initial data
-
Your page is ready!:
- After a few minutes, you can access it at
https://[YOUR-USERNAME].github.io/github-repo-traffic-viewer/ - Data will be updated automatically every hour
- After a few minutes, you can access it at
To use the repository in your own language:
- Open the
index.htmlfile - Find the
translationsobject (line ~130 in script.js) - Add a new language block, for example for Spanish:
es: {
title: "Estadísticas de tráfico de repositorios",
loadingAuth: "Verificando sesión de GitHub...",
// Add other translations...
}- Add a button to the language switcher (line ~40 in index.html):
<button class="lang-btn" onclick="changeLanguage('es')">ES</button>- Change theme: Modify the color codes in the
styletags - New features: Add new charts by editing the JavaScript code (inside the
scripttag) - API integrations: Add new data using the GitHub API
- By default, it updates every hour (
cron: '0 * * * *'). - You can change the frequency by editing the
fetch-traffic.ymlfile.
- Check if your PAT has the correct permissions (
repoandworkflow) - Make sure the workflow has run successfully in the Actions tab
- Ensure you've triggered the workflow manually on the first run
- All data is stored in JSON format under the
docs/data/folder - These files are publicly visible on GitHub, but they only contain traffic data for your repositories
✔️ Privacy: Your traffic data is processed only in your browser
✔️ Customization: Add your own language and visual theme
✔️ Continuous Access: Even if the original repo is deleted, your fork continues to work
✔️ Development: Improve the tool according to your own needs
If you'd like to improve this project:
- Fork the repository
- Create a new branch (
git checkout -b feature/awesome-feature) - Commit your changes (
git commit -m 'Add some awesome feature') - Push to your branch (
git push origin feature/awesome-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This tool only shows traffic data for the forking user's own repositories. It does not display data for other users.
If you like my project, you can support me by buying me a coffee!
Thank you! 🙏

