LeetScraper is a command-line tool that fetches the LeetCode Daily Challenge (or any specific problem) and saves it as well-formatted, language-specific source files β complete with problem description, difficulty, and starter code.
π Open Source | πΉ Written in Go | π GPL-3.0 Licensed
- β Fetches daily challenge or specific problem by slug
- β Outputs clean, readable source files with problem description
- β Supports multiple languages (Go, Python, Java, Rust, etc.)
- β
Fully configurable with
--flagsor~/.leetscraper.json - β Clean CLI and GitHub Actions-based release automation
Precompiled binaries are available inside archives for major platforms:
- Linux (x86_64): leetscraper-linux.tar.gz
- macOS (arm64): leetscraper-darwin.tar.gz
- Windows (x86_64): leetscraper-windows.zip
Or visit the Releases page to download and verify checksums.
# Example (Linux):
curl -LO https://github.com/aaronlmathis/leetscraper/releases/latest/download/leetscraper-linux.tar.gz
tar -xzf leetscraper-linux.tar.gz
chmod +x leetscraper
./leetscraper --helpgit clone https://github.com/aaronlmathis/leetscraper.git
cd leetscraper
make build
./dist/leetscraper --helpWill default to pulling golang snippet, saving to working directory, using filename format: {id}-{difficulty}-{slug}.{ext} if .leetscraper.json is not present in home directory.
leetscraperleetscraper --slug two-sumleetscraper --out ~/leetcode/dailyleetscraper --langs golang,python3,rustleetscraper --format {id}-{difficulty}-{slug}.{ext}Set your preferences (optional) via .leetscraper.json saved to home directory.
See leetscraper.json.sample for example.
~/.leetscraper.json:
{
"outputDir": "/home/you/leetcode",
"filenameFormat": "{id}-{difficulty}-{slug}.{ext}",
"languages": ["golang", "python3"]
}Command-line flags will override config file values.
123-easy-two-sum.go
123-easy-two-sum.py
123-easy-two-sum.rs
Each file includes:
- Problem title, difficulty, and link
- Full problem description (Markdown)
- Starter function in your language(s)
make build # Build binary into dist/
make test # Run integration tests
make release # Cross-compile for release
make package # Create .tar.gz and .zip archives./test/test_leetscraper.shOr run as part of make test.
GPL-3.0-or-later
Β© 2025 Aaron Mathis
If this tool saves you time, consider β starring the repo β it helps more developers discover it!