A Python web scraper that extracts public information from the Idaho Sex Offender Registry (SOR) database for any Idaho county. This tool downloads offender data, photos, and detailed information, organizing everything into a structured JSON format and generating printable PDF reports.
- 📊 Complete Data Extraction: Scrapes all offender information including names, addresses, KNO numbers, and compliance status
- 🖼️ Image Downloading: Automatically downloads full-resolution offender photos
- 📄 Detailed Records: Visits each offender's profile page to extract:
- Complete identification information
- Criminal offense descriptions, dates, and locations
- 🔄 Automatic Pagination: Processes all pages of results automatically
- 💾 JSON Export: Saves all data in a well-structured JSON format
- 📑 PDF Generation: Creates professional 8.5x11" printable reports with photos
- 🏷️ Offense Classification: Automatically categorizes offenses (CP, CHILD SA, RAPE, SA, etc.)
- 🗺️ Multi-County Support: Scrape and generate reports for any Idaho county
- ⏱️ Rate Limiting: Includes respectful delays between requests to avoid overwhelming the server
- Python 3.6+
requestslibrarybeautifulsoup4libraryreportlablibrarypillowlibrary
- Clone this repository or download the scripts:
git clone <repository-url>
cd idaho-sor-scraper- Install required dependencies:
pip install requests beautifulsoup4 reportlab pillowOr use the requirements file:
pip install -r requirements.txtScrape Bonner County (default):
python scraper.pyScrape a specific county:
python scraper.py BOUNDARY
python scraper.py KOOTENAI
python scraper.py ADAThe scraper will:
- Connect to the Idaho SOR database
- Submit a POST request for the specified county
- Parse each page of results
- Download offender photos to
offender_images/<county>/ - Visit each offender's detail page for additional information
- Save everything to
<county>_county_offenders.json
Generate PDF for Bonner County (default):
python generate_pdf.pyGenerate PDF for a specific county:
python generate_pdf.py BOUNDARY
python generate_pdf.py KOOTENAIThe PDF generator will:
- Read the JSON file for the specified county
- Create an 8.5x11" PDF with photo grid layout
- Display photos (~1.5" wide) with names and offense classifications
- Save to
<county>_county_offenders.pdf
.
├── scraper.py
├── generate_pdf.py
├── offender_images/
│ ├── bonner/
│ │ ├── 8001234_DOE_JOHN_MICHAEL.jpg
│ │ ├── 8001235_SMITH_JAMES_LEE.jpg
│ │ └── ...
│ ├── boundary/
│ │ └── ...
│ └── kootenai/
│ └── ...
├── bonner_county_offenders.json
├── bonner_county_offenders.pdf
├── boundary_county_offenders.json
├── boundary_county_offenders.pdf
└── README.md
The script generates <county>_county_offenders.json with the following structure:
[
{
"name": "DOE, JOHN MICHAEL",
"kno": "8001234",
"address": "123 MAIN ST",
"city": "SANDPOINT",
"county": "BONNER",
"zip": "83864",
"status": "COMPLIANT",
"profile_url": "https://apps.isp.idaho.gov/sor_id/SOR?id=12345&sz=2814",
"image_url": "https://apps.isp.idaho.gov/sorFiles/photos/DOEJ_8001234_01-01-2024.jpg",
"local_image_path": "offender_images/bonner/8001234_DOE_JOHN_MICHAEL.jpg",
"identification": {
"Reg ID": "SX12345",
"Height": "6'2\"",
"Weight": "200",
"Hair Color": "BROWN",
"Eye Color": "BLUE",
"Race": "WHITE",
"Sex": "MALE",
"Date of Birth": "01/01/1980"
},
"offenses": [
{
"offense": "18-1508",
"description": "LEWD CONDUCT WITH A MINOR",
"date": "03/15/2015",
"location": "BONNER COUNTY, ID"
}
]
}
]The PDF report features:
- Header: County name and generation date on each page
- Photo Grid: 5 columns × 3 rows (15 offenders per page)
- Each Entry Shows:
- Full-resolution photo (~1.5" wide)
- Full name
- Offense classification (in red, bold)
- City of residence
- Page Numbers: Bottom right of each page
The system automatically categorizes offenses into the following types:
- CP - Child Pornography (possession of materials)
- CHILD SA - Child Sexual Assault/Abuse (offenses against minors)
- RAPE - Rape (adult victims)
- SA - Sexual Assault (adult victims)
- EXPLOIT - Exploitation/Enticement of minors
- ASSAULT - Assault with intent/Kidnapping
- EXPOSURE - Indecent Exposure
- OTHER-SEX - Other sexual offenses
- OTHER - Non-sexual offenses
The classification is based on analyzing offense descriptions for keywords related to:
- Age indicators (U/16, UNDER 14, MINOR, CHILD, etc.)
- Offense types (LEWD, MOLESTATION, RAPE, etc.)
- Material possession (PORNOGRAPHY, EXPLICIT IMAGES, etc.)
Both scripts accept a county name as a command-line argument:
# Scrape data
python scraper.py <COUNTY_NAME>
# Generate PDF
python generate_pdf.py <COUNTY_NAME>Some common Idaho counties:
- ADA
- BANNOCK
- BONNER
- BONNEVILLE
- BOUNDARY
- CANYON
- KOOTENAI
- LATAH
- NEZ PERCE
- TWIN FALLS
(The system accepts any valid Idaho county name)
You can modify these values in generate_pdf.py:
self.photo_width = 1.5 * inch # Width of each photo
self.photo_height = 2 * inch # Height of each photo
self.photos_per_row = 5 # Photos per rowThe script automatically calculates how many rows fit on each page based on available space.
- name: Full legal name of the offender
- kno: Idaho offender identification number
- address: Street address
- city: City of residence
- county: County of residence
- zip: ZIP code
- status: Compliance status (COMPLIANT, NON COMP, PENDING, etc.)
- profile_url: Direct link to the offender's detail page
- image_url: URL of the full-resolution photo
- local_image_path: Path to downloaded image file (county-specific directory)
Physical characteristics and biographical information extracted from the offender's detail page:
- Reg ID
- Height, Weight
- Hair Color, Eye Color
- Race, Sex
- Date of Birth
- Aliases
Array of criminal offenses including:
- offense: Idaho code or statute number
- description: Type of offense
- date: Date of conviction/offense
- location: County/state where offense occurred
This scraper includes built-in delays:
- 0.5 seconds between detail page requests
- 1 second between pagination requests
Important Notes:
- This tool accesses publicly available information only
- The data is already published by Idaho State Police
- Please use responsibly and in accordance with local laws
- Do not use for harassment, discrimination, or illegal purposes
- Respect the server by not removing rate limiting
- Consider the privacy and safety implications of distributing this information
This tool is provided for informational and research purposes only. The data scraped is publicly available from the Idaho Sex Offender Registry maintained by Idaho State Police.
Users are responsible for:
- Complying with all applicable federal, state, and local laws
- Using the data ethically and legally
- Not using the data for harassment, discrimination, or any illegal purpose
- Respecting the terms of service of the Idaho SOR website
- Understanding that this information is public record but should be used responsibly
The authors of this tool are not responsible for misuse of the data or the tool itself.
Warning: Misuse of sex offender registry information may be a criminal offense under Idaho Code § 18-8329.
- Check your internet connection
- Verify the website is accessible: https://apps.isp.idaho.gov/sor_id/SOR
- Ensure the county name is spelled correctly and is a valid Idaho county
- The website structure may have changed (HTML parsing may need updates)
- Some offenders may not have photos
- Check the
offender_images/<county>directory permissions - Verify image URLs are accessible
- Check your internet connection
- Ensure you have the latest version of BeautifulSoup4
- Check that the HTML structure hasn't changed on the source website
- Verify the JSON file isn't corrupted
- Ensure the JSON file exists for the specified county
- Check that ReportLab and Pillow are installed correctly
- Verify image files exist in the correct directory
- Check available disk space
- Verify the county name is correct (use uppercase)
- Some counties may have no registered offenders
- Check the Idaho SOR website to confirm data exists for that county
Complete workflow for multiple counties:
# Scrape multiple counties
python scraper.py BONNER
python scraper.py BOUNDARY
python scraper.py KOOTENAI
# Generate PDFs for all counties
python generate_pdf.py BONNER
python generate_pdf.py BOUNDARY
python generate_pdf.py KOOTENAIThis will create:
- 3 JSON files with complete data
- 3 PDF reports ready for printing
- Organized image directories for each county
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test with multiple counties
- Submit a pull request
This project is provided as-is for educational and research purposes. Please check local regulations regarding web scraping and data usage.
Data source: Idaho Sex Offender Registry
Disclaimer: This is an unofficial tool and is not affiliated with, endorsed by, or connected to Idaho State Police or any government agency.