Skip to main content

peakbagger-cli

CI PyPI Python Version OpenSSF Scorecard codecov License: MIT

A command-line interface for searching and retrieving mountain peak data from PeakBagger.com.

Features

  • 🔍 Search peaks by name with instant results
  • 📊 Detailed peak info including elevation, prominence, isolation, and location
  • 📈 Ascent statistics - analyze climbing activity, seasonal patterns, and trip reports
  • 🎨 Beautiful output with formatted tables and colors
  • 🤖 JSON output for automation and scripting
  • 🛡️ Respectful scraping with configurable rate limiting

For contributors: See CONTRIBUTING.md for development setup and guidelines.

Installation

Using uvx (Recommended)

Run directly without installation:

uvx peakbagger peak search "Mount Rainier"
uvx peakbagger peak show 2296

From PyPI

pip install peakbagger

Cloudflare bypass (optional)

PeakBagger.com sits behind a Cloudflare challenge that the default HTTP client cannot always pass. If you hit a 403, install the browser extra, which adds a stealth-browser fallback (it briefly opens a real Chrome window to clear the challenge, then caches the result):

pip install 'peakbagger[browser]'   # requires Google Chrome installed

Usage

Search for peaks

peakbagger peak search "Mount Rainier"
peakbagger peak search "Denali" --format json
peakbagger peak search "Whitney" --full  # Fetch full details for all results

Get peak details

peakbagger peak show 2296  # Mount Rainier
peakbagger peak show 2296 --format json

Output includes elevation, prominence, coordinates, routes, and peak lists.

List peak ascents

peakbagger peak ascents 1798  # Mount Pilchuck
peakbagger peak ascents 1798 --within 1y  # Last year only
peakbagger peak ascents 1798 --with-gpx  # Only ascents with GPS tracks
peakbagger peak ascents 1798 --with-tr   # Only with trip reports
peakbagger peak ascents 1798 --limit 50  # First 50 ascents

Filters: --after DATE, --before DATE, --within PERIOD (e.g., 3m, 1y, 10d)

Analyze ascent statistics

peakbagger peak stats 1798
peakbagger peak stats 1798 --within 5y
peakbagger peak stats 1798 --reference-date 2024-07-15 --seasonal-window 30

Shows temporal breakdown, seasonal patterns, and monthly distribution.

Get ascent details

peakbagger ascent show 12963
peakbagger ascent show 12963 --format json

Includes trip reports and route information.

Get trip reports for a peak

peakbagger trip-reports 1798  # Mount Pilchuck
peakbagger trip-reports 1798 --limit 5 --min-words 100
peakbagger trip-reports 1798 --within 1y --format json

Filters: --after DATE, --before DATE, --within PERIOD (e.g., 3m, 1y, 10d)

Examples

Automation with jq

# Extract specific fields
peakbagger peak show 2296 --format json | jq '.elevation.feet'
peakbagger peak search "Rainier" --format json | jq '.[].pid'
peakbagger trip-reports 1798 --format json | jq '.[].text'

# Find peaks on a specific list
peakbagger peak show 2296 --format json | jq '.peak_lists[] | select(.list_name | contains("Bulger"))'

Batch processing

for pid in 2296 271 163756; do
  peakbagger peak show $pid --format json >> peaks.json
done

More examples: See examples/ for complete scripts including CSV export and filtering.

Configuration

Logging

# Show HTTP requests
peakbagger --verbose peak search "Mount Rainier"
peakbagger -v peak show 2296

# Show detailed debug info
peakbagger --debug peak search "Mount Rainier"

# Suppress all output except data
peakbagger --quiet peak search "Mount Rainier"
peakbagger -q peak show 2296

Logs go to stderr, so you can redirect separately:

# Save JSON output, show logs on screen
peakbagger -v peak show 2296 --format json > peak.json

# Save output and logs separately
peakbagger -v peak show 2296 --format json > peak.json 2> logs.txt

Rate Limiting

Default: 2 seconds between requests. Adjust as needed:

peakbagger peak search "Rainier" --rate-limit 3.0  # 3 seconds

Ethical Use

Use this tool for personal and educational purposes only. Please:

  • ✅ Respect the default rate limits (or increase them)
  • ✅ Use for personal research and trip planning
  • ✅ Attribute data to PeakBagger.com
  • ❌ Don't mass-scrape or create bulk datasets
  • ❌ Don't use for commercial purposes without permission
  • ❌ Don't bypass rate limits to hammer the server

PeakBagger.com provides this data as a free service to the climbing community. Use this tool responsibly.

Troubleshooting

Cloudflare blocks (403): Install the stealth-browser fallback with pip install 'peakbagger[browser]' (requires Google Chrome). On the next 403 it opens a real Chrome window once to clear the challenge and caches the result.

No results: Try different search terms or verify the peak ID is correct.

Installation issues: Requires Python 3.12+ (python3 --version).

Data Source

All data is scraped from PeakBagger.com. The site aggregates peak information from USGS, LIDAR data, and user contributions.

Limitations: No official API (scrapes HTML), rate-limited for respectful use, data accuracy depends on PeakBagger.com.

Support

Other Mountaineering & Outdoors Tools

I climb, scramble, and hike a lot, and I keep building tools around it. If this one's useful to you, the others might be too:

  • mountaineers-mcp -- MCP server that lets AI assistants search and browse mountaineers.org. Activities, courses, trip reports, your account data.
  • mountaineers-assistant -- Chrome extension that syncs your mountaineers.org activity history and shows you stats, trends, and climbing partners you can't see on the site.
  • claude-mountaineering-skills -- Claude Code plugin that generates route beta reports by pulling conditions, forecasts, and trip reports from multiple mountaineering sites.

License

MIT License - see LICENSE file for details.

Metadata

Release files for peakbagger 1.11.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peakbagger 1.11.1
File Size Uploaded
peakbagger-1.11.1.tar.gz 55.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for peakbagger 1.11.1
File Interpreter ABI Platform
peakbagger-1.11.1-py3-none-any.whl Python 3 none any Details

Total release size: 91.2 kB

Release files / peakbagger-1.11.1.tar.gz

Download URL peakbagger-1.11.1.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f7f0b86e76f3ef010e0956def7bcb1e09c5639f9c55566c3cccf3918066e0811
BLAKE2b-256 checksum
How to use checksums
9cdc53dbf61a568937fc6aa7a95b2032ee1919f203619a4f6c1dc69a4a764bdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release files / peakbagger-1.11.1-py3-none-any.whl

Download URL peakbagger-1.11.1-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7126f1de04b566ac79cd8525b213c408ff30b92bbb685e814399b57d5fec0abe
BLAKE2b-256 checksum
How to use checksums
208f8d438dfc28551582ea7ef68d55ac7fb3ab4be79695961bfaef493698668c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.11.1 This release

2 release files

1.11.0

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page