GitHub Avatar Crawler is a small command-line tool that crawls a GitHub user profile, visits followers and/or following lists, and downloads profile avatars into a local avatars/ folder. It supports both structured and flat output layouts, optional GitHub bearer-token authentication for better request reliability, and a configurable crawl depth so you can collect just a profile's avatar or explore multiple layers of connected accounts.
- Download avatars from a target GitHub profile
- Crawl
followers,following, or both - Choose between a structured folder tree or a flat output folder
- Configure crawl depth
- Optional GitHub bearer token support
- Basic request retry handling with polite delays
- Colored terminal output for clearer progress feedback
- Python 3.8 or newer
requestsbeautifulsoup4coloramais optional, but recommended for colored output
Install the Python dependencies:
pip install requests beautifulsoup4 coloramaRun the script:
python main.pyThen follow the prompts:
- Enter a valid GitHub username.
- Optionally provide a GitHub bearer token.
- Choose whether to crawl followers, following, or both.
- Set the crawl depth.
- Pick the output format.
Creates nested folders under avatars/<username>/ so each discovered user is grouped by relationship and depth.
Creates a single avatars/<username>/flatlist/ folder with all downloaded avatars in one place.
- The script loads the target GitHub profile page.
- It extracts the
og:imagemeta tag to fetch the avatar. - It collects profile links from follower or following pages.
- It repeats the process up to the selected depth.
- Avatars are saved locally as
.jpgfiles.
github-avatar-crawler-main/
|-- main.py
|-- README.md
|-- LICENSE
|-- requirements.txt
`-- avatars/
- The crawler uses GitHub public profile pages and may be affected by rate limits or layout changes on GitHub.
- Using a bearer token can help reduce request failures during longer crawls.
- A depth of
0downloads only the target user's avatar. - The script stops gracefully when you press
Ctrl+C.
This project is licensed under the MIT License. See LICENSE for details.
Ashish Kumar