A powerful Python script that pulls frequency data from Radio Reference via web scraping and converts it to CHIRP-compatible CSV format for import into handheld radios. Features an interactive menu-driven interface with colorful ASCII art and comprehensive radio management capabilities.
Created by InfoSecREDD
- Query by ZIP Code: Automatically resolves location and finds frequencies
- Query by City & State: Search frequencies for specific cities
- Query by County & State: Get county-wide frequency listings
- Web Scraping Based: No API key required - uses Playwright for JavaScript-rendered content
- CHIRP-Compatible Output: Generates CSV files ready for CHIRP import
- Human-Readable TXT Export: Option to export as formatted text files
- Frequency Filtering: Filter by mode (FM, Digital, DMR, P25, etc.)
- Append Mode: Add frequencies to existing CSV or TXT files
- Import CSV to Handheld: Full workflow for uploading frequencies to radios
- Create Backup: Standalone backup creation from CSV files
- Restore from Backup: Restore radio configurations from backup files
- View Backup Files: Browse and manage all backup files
- Select Radio Model: Choose from all 523 CHIRP-compatible radio models with proper settings
- Comprehensive Device Support: Complete coverage of all radios supported by CHIRP
- Serial Port Detection: Automatic USB serial port detection (filters out Bluetooth/debug ports)
- Connection Status: Real-time display of radio connection status
- County Cache System: Build and maintain a cache of county IDs for faster lookups
- CSV Validation: Validate CSV files against CHIRP format requirements
- Filter Existing CSV: Apply mode filters to existing CSV files
- Convert CSV to TXT: Convert CHIRP CSV files to human-readable text format
- View Serial Ports: List all available USB serial ports
- GMRS/FRS Channels: Generate all 22 standard GMRS/FRS channel frequencies (462-467 MHz)
- NOAA Weather Channels: Generate all 7 NOAA Weather Radio frequencies (162.400-162.550 MHz) with optional location-specific info
No manual installation required! The script automatically checks and installs missing dependencies on first run.
The script will automatically detect and use the correct pip or pip3 command and install:
requests- HTTP library for web scrapingbeautifulsoup4- HTML parsingcolorama- Colored terminal outputuszipcode- ZIP code lookup (with automatic fallback)lxml- HTML parser backendpython-Levenshtein- Fast string matching librarypyserial- Serial port detectionplaywright- JavaScript rendering for dynamic content- Note: Playwright browser binaries (Chromium) are automatically installed after the package
All dependencies are automatically installed and configured on first run. The script handles:
- Virtual environment creation and activation
- Package installation with fallback methods
- Playwright browser binary installation
- Import name mapping (e.g.,
pyserial→serial,beautifulsoup4→bs4)
Simply run the script without any arguments to use the interactive menu:
python getradios.py
# or
python3 getradios.pyThe script displays a colorful ASCII art banner and interactive menu with the following options:
- Search by ZIP Code - Enter a 5-digit ZIP code
- Search by City & State - Enter city name and state abbreviation
- Search by County & State - Enter county name and state abbreviation
- Import CSV to Handheld - Upload frequencies to your radio
- Create Backup - Create a backup from a CSV file
- Restore from Backup - Restore radio configuration from backup
- Validate CSV File - Validate CSV files against CHIRP format
- View Serial Ports - List available USB serial ports
- Select Radio Model - Choose radio model with proper CHIRP settings
- Filter Existing CSV - Apply filters to existing CSV files
- Convert CSV to TXT - Convert CSV to human-readable text
- View Backup Files - Browse and manage backup files
- Build County Cache - Build cache of county IDs for faster lookups
- Add GMRS/FRS Channels - Generate all 22 standard GMRS/FRS channels
- Add NOAA Weather Channels - Generate all 7 NOAA Weather Radio frequencies
You can also use command-line arguments for automation or scripting:
# Using ZIP code
python getradios.py --zipcode 90210 --output frequencies.csv
# Using city and state
python getradios.py --city "Los Angeles" --state CA --output frequencies.csv
# Using county and state
python getradios.py --county "Los Angeles" --state CA --output frequencies.csv
# With filtering (FM frequencies only)
python getradios.py --zipcode 90210 --filter FM --output fm_frequencies.csv
# Export as TXT format
python getradios.py --zipcode 90210 --format txt --output frequencies.txt
# Append to existing file
python getradios.py --zipcode 90210 --output frequencies.csv --append
# Generate GMRS/FRS channels
python getradios.py --gmrs-frs --output gmrs_channels.csv
# Generate NOAA Weather channels with location info
python getradios.py --weather --weather-zip 90210 --output weather_channels.csv--zipcode: 5-digit ZIP code--city: City name--county: County name--state: State abbreviation (required for city/county queries)--gmrs-frs: Generate GMRS/FRS channels (22 standard channels)--weather: Generate NOAA Weather Radio channels (7 standard frequencies)--weather-zip: ZIP code for location-specific weather channel info (use with --weather)--output/-o: Output file path (default: frequencies.csv)--format: Output format -csv(default) ortxt--filter/-f: Filter by mode (FM, Digital, DMR, P25, etc.)--append: Append to existing file instead of overwriting
The interactive menu supports text shortcuts for faster navigation:
ziporzipcode- Search by ZIP Codecity- Search by City & Statecounty- Search by County & Stateimportorupload- Import CSV to Handheldbackuporsave- Create Backuprestore- Restore from Backupgmrsorfrs- Add GMRS/FRS Channelsweather,wx, ornoaa- Add NOAA Weather Channelsvalidate- Validate CSV Fileportsorserial- View Serial Portsmodels,radios, orselect- Select Radio Modelfilter- Filter Existing CSVconvertorcsv2txt- Convert CSV to TXTbackupsorbackup- View Backup Filescacheorbuildcache- Build County Cache0,Q,quit, orexit- Exit the program
- Export frequencies using this script (Search by ZIP/City/County)
- Select option 4: Import CSV to Handheld
- Select your CSV file
- Choose serial port and radio model
- Create backup (recommended)
- Follow the instructions to complete upload via CHIRP
- Export frequencies using this script
- Open CHIRP software
- File → Import from CSV
- Select your exported CSV file
- Review and upload to your radio
Option 5: Create Backup allows you to create backups from CSV files:
- Validates the CSV file
- Saves frequency data and CSV content
- Stores radio model and port information
- Timestamped backup files
Automatic Backups: When importing CSV to handheld (Option 4), you'll be prompted to create a backup before uploading.
Option 6: Restore from Backup allows you to:
- Browse all available backup files
- Select a backup to restore
- Extract CSV content from backup
- Restore to your handheld radio
Backup files are stored in the backups/ directory with the format:
{RadioModel}_{Port}_{Timestamp}.backup
The script includes a sophisticated county caching system for faster lookups:
- Automatic Caching: County IDs are cached as they're discovered
- Build Cache for All States: Option 13 allows building a complete cache
- State-Sectioned Storage: Cache stored in
countyID.db(JSON format) - Rate Limiting: Built-in delays to respect Radio Reference's servers
- API Verification: Uses external APIs to verify county-state relationships
Cache files are stored in countyID.db and organized by state for efficient lookups.
The script includes comprehensive support for all 523 CHIRP-compatible radio models with proper settings:
- Complete CHIRP Coverage: All radios supported by CHIRP are included in the device list
- Automatic detection of baudrate, max channels, and CHIRP ID for each model
- Radio model selection persists across sessions
- Custom radio models can be entered manually if needed
- Connection status displayed in main menu
Supported manufacturers include:
- Major Brands: Yaesu, Kenwood, Icom, Alinco
- Popular Models: Baofeng, BTECH, Wouxun, Anytone, TYT, Radioddity
- Specialized: Quansheng, Retevis, TIDRADIO, and many more
- Complete List: All 523 radios from the official CHIRP supported devices list
Radio settings (baudrate, max channels, memory format) are automatically configured based on CHIRP's official driver specifications.
The script can generate all 22 standard GMRS/FRS channel frequencies:
- Channels 1-7: Shared FRS/GMRS (462.5625-462.7125 MHz) - 2W FRS / 5W GMRS
- Channels 8-14: FRS only (467.5625-467.7125 MHz) - 0.5W FRS only
- Channels 15-22: Shared FRS/GMRS (462.5500-462.7250 MHz) - 2W FRS / 50W GMRS
Important Notes:
- FRS channels 1-7 and 15-22 can be used without a license
- FRS channels 8-14 are FRS-only (0.5W maximum)
- GMRS requires an FCC license
- Channels 15-22 support higher power for GMRS operations (up to 50W)
Use menu option 14 or --gmrs-frs in CLI mode to generate these channels.
The script can generate all 7 NOAA Weather Radio frequencies:
- 162.400 MHz - NOAA WX 1
- 162.425 MHz - NOAA WX 2
- 162.450 MHz - NOAA WX 3
- 162.475 MHz - NOAA WX 4
- 162.500 MHz - NOAA WX 5
- 162.525 MHz - NOAA WX 6
- 162.550 MHz - NOAA WX 7
Important Notes:
- Not all frequencies may be active in your area
- Test all 7 frequencies to find which transmitter is active near you
- You can optionally provide a ZIP code to add location-specific information to channel comments
- Weather channels are broadcast continuously and provide weather alerts and forecasts
Use menu option 15 or --weather in CLI mode to generate these channels. Use --weather-zip to add location-specific information.
Standard CHIRP-compatible CSV with all required columns:
- Location, Name, Frequency, Duplex, Offset, Tone, rToneFreq, cToneFreq, DtcsCode, DtcsPolarity, Mode, TStep, Skip, Comment, URCALL, RPT1CALL, RPT2CALL, DVCODE
Human-readable text format with:
- Frequency listings
- Mode information
- Alpha tags and descriptions
- Formatted for easy reading
- Important: Use responsibly and comply with Radio Reference Terms of Service
- The script includes rate limiting and respectful scraping practices
- Radio Reference's page structure may change - the script may need updates
- Some frequency details (tones, offsets) may need manual adjustment after import
- USB serial ports only - Bluetooth and debug ports are automatically filtered
- County cache building may take time - be patient for all-state cache builds
- "Could not find location": Verify your ZIP code, city, or county name
- "No frequencies found": Radio Reference's page structure may have changed, or the location may not have frequencies listed
- "Could not find county ID": Try using city/state instead, or build the county cache for that state
- "uszipcode lookup failed": The script automatically falls back to web API - this is normal
- Import errors in CHIRP: Verify the CSV format matches CHIRP's expected structure
- No serial ports detected: Make sure your radio is connected via USB (not Bluetooth)
- "Radio Not Connected": Connect your radio via USB cable and select the port
- Missing counties: Use Option 13 to build cache for specific states
- Cache not updating: Delete
countyID.dband rebuild the cache - Slow cache building: This is normal - rate limiting prevents server overload
radiorefexport/
├── getradios.py # Main script
├── countyID.db # County ID cache (JSON format)
├── backups/ # Backup files directory
│ └── *.backup # Backup files
├── .radio_config.json # Radio model and port configuration
└── README.md # This file
Created by InfoSecREDD
This project uses web scraping to extract frequency data from Radio Reference. All data is sourced from Radio Reference's public database.
- Playwright: JavaScript rendering for dynamic content extraction
- BeautifulSoup4: HTML parsing
- Requests: HTTP requests
- Colorama: Terminal colors
- PySerial: Serial port detection
- uszipcode: ZIP code lookup (with fallback to zippopotam.us)
- Radio Reference: Frequency database (https://www.radioreference.com)
- zippopotam.us: ZIP code lookup API (fallback)
- Nominatim (OpenStreetMap): Geocoding API for county verification
Use responsibly and in compliance with Radio Reference's Terms of Service.
Radio Frequency Harvester v1.2.0
Scraping Radio Reference → CHIRP CSV