{"id":33266599,"url":"https://github.com/sachabechara/pacerr","last_synced_at":"2025-11-22T12:00:57.838Z","repository":{"id":324430442,"uuid":"1097204327","full_name":"sachabechara/pacerR","owner":"sachabechara","description":"Automated retrieval and network analysis of the PACER court cases through EM-ECF Court systems, and extraction of documents (docket sheets and non-scealed documents) for academic research","archived":false,"fork":false,"pushed_at":"2025-11-15T18:55:24.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-15T20:34:28.614Z","etag":null,"topics":["legal","legaltools","pacer","pacer-docket-api","pacer-docket-processing","pacer-dockets","r","r-package","r-package-automation","research-tool"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sachabechara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-15T18:19:01.000Z","updated_at":"2025-11-15T19:11:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sachabechara/pacerR","commit_stats":null,"previous_names":["sachabechara/pacerr"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sachabechara/pacerR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sachabechara%2FpacerR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sachabechara%2FpacerR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sachabechara%2FpacerR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sachabechara%2FpacerR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sachabechara","download_url":"https://codeload.github.com/sachabechara/pacerR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sachabechara%2FpacerR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285603340,"owners_count":27200013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["legal","legaltools","pacer","pacer-docket-api","pacer-docket-processing","pacer-dockets","r","r-package","r-package-automation","research-tool"],"created_at":"2025-11-17T07:00:41.652Z","updated_at":"2025-11-21T11:02:00.932Z","avatar_url":"https://github.com/sachabechara.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pacerR\n\n\u003c!-- badges: start --\u003e\n[![Project Status: WIP](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n\u003c!-- badges: end --\u003e\n\nAutomated retrieval and network analysis of PACER (Public Access to Court Electronic Records) court documents. Developed for academic research on litigation in US federal courts.\n\n---\n\n## ⚠️ CRITICAL: READ THIS BEFORE USING ⚠️\n\n**PACER CHARGES FEES.** You are **SOLELY RESPONSIBLE** for all costs incurred.\n\n### Fee Information\n\n- **Standard rate**: $0.10 per page\n- **Quarterly cap**: $30 per user per quarter\n- **Your responsibility**: Verify your fee exemption status BEFORE using this tool\n- **No guarantees**: The author is NOT responsible for any charges to your account\n\n### Fee Exemptions for Researchers\n\nResearchers can apply for fee exemptions:\n- **Application**: https://pacer.uscourts.gov/my-account-billing/billing/fee-exemption-request-researchers\n- **Verify status**: Check your PACER account to confirm exemption is ACTIVE\n- **Check scope**: Confirm exemption applies to the courts you're accessing\n- **Monitor charges**: Regularly check your account for unexpected fees\n\n**This tool worked with my fee exemption for US Courts of Appeals.** It has NOT been tested extensively on District Courts or other court types. Results may vary.\n\n### What This Tool Does\n\nThis software automates retrieval of XML docket files from PACER. **Each retrieval may incur charges if you do not have an active, applicable fee exemption.**\n\n### Your Responsibilities\n\nYou MUST:\n- ✅ Understand PACER's fee structure completely\n- ✅ Obtain appropriate fee exemption (if eligible)\n- ✅ Verify exemption is active and applies to your use case\n- ✅ Monitor your PACER account for charges\n- ✅ Use ONLY for legitimate academic research\n- ✅ Comply with PACER Terms of Service and Acceptable Use Policy\n\nYou MUST NOT:\n- ❌ Use for bulk commercial downloading\n- ❌ Use for resale of data\n- ❌ Use without understanding fee implications\n- ❌ Assume fee exemption applies without verification\n\n**THE AUTHOR PROVIDES THIS CODE AS-IS FOR RESEARCH PURPOSES AND TAKES NO RESPONSIBILITY FOR FEES, CHARGES, OR MISUSE.**\n\n---\n\n## Overview\n\n`pacerR` provides tools to:\n\n- **Authenticate** with PACER system securely\n- **Retrieve** full docket information in XML format\n- **Extract** associated case information (consolidated, related, lead cases)\n- **Discover** complete litigation networks through recursive case associations\n- **Analyze** patterns in federal court case relationships\n\nBuilt for researchers studying judicial behavior, legal networks, and litigation patterns.\n\n## Installation\n\n```r\n# Install development version from GitHub\n# install.packages(\"devtools\")\ndevtools::install_github(\"sachabechara/pacerR\")\n```\n\n## Prerequisites\n\n### 1. PACER Account\nRegister at https://pacer.uscourts.gov/\n\n### 2. Fee Exemption (STRONGLY RECOMMENDED)\nApply for research fee exemption: https://pacer.uscourts.gov/my-account-billing/billing/fee-exemption-request-researchers\n\n**Verify exemption is active before using this tool.**\n\n### 3. Understand the Costs\n- Without exemption: $0.10 per page (capped at $30/quarter)\n- With exemption: Free, but verify it applies to your account and court type\n- **You are responsible for all charges**\n\n### 4. Credentials\nYou'll need to securely store your PACER username and password (see Setup below)\n\n## Setup\n\n### Secure Credential Management\n\n**Never hardcode credentials in your scripts.** Use environment variables:\n\n```r\n# Edit your .Renviron file\nusethis::edit_r_environ()\n\n# Add these lines:\nPACER_USERNAME=your_username\nPACER_PASSWORD=your_password\n\n# Restart R for changes to take effect\n```\n\nAlternatively, set them in your current session:\n\n```r\nSys.setenv(PACER_USERNAME = \"your_username\")\nSys.setenv(PACER_PASSWORD = \"your_password\")\n```\n\n## Quick Start\n\n### Basic Retrieval\n\n```r\nlibrary(pacerR)\n\n# Authenticate (reads from environment variables)\ntoken \u003c- pacer_authenticate()\n\n# Retrieve a few specific cases\nresults \u003c- pacer_retrieve_cases(\n  cases = c(\"20-1234\", \"20-1235\", \"20-1236\"),\n  circuit = \"cadc\",  # DC Circuit Court of Appeals\n  auth_token = token\n)\n\n# View results\nView(results)\n```\n\n### Retrieve from CSV File\n\n```r\n# CSV file with column containing case numbers\nresults \u003c- pacer_retrieve_cases(\n  cases = \"my_cases.csv\",\n  case_column = \"case_number\",  # Specify which column has case numbers\n  circuit = \"cadc\",\n  auth_token = token\n)\n```\n\n### Network Discovery\n\nDiscover all related cases in a litigation network:\n\n```r\n# Simple discovery (finds immediate associations)\nnetwork \u003c- pacer_discover_network(\n  cases = c(\"20-1234\", \"20-1235\"),\n  circuit = \"cadc\",\n  auth_token = token\n)\n\n# Recursive discovery (finds 2nd-degree connections)\nnetwork \u003c- pacer_discover_network(\n  cases = \"my_cases.csv\",\n  case_column = \"case_number\",\n  circuit = \"cadc\",\n  recursive = TRUE,\n  max_iterations = 2,\n  auth_token = token\n)\n\n# Analyze discovered network\ncat(\"Original cases:\", length(network$original_cases), \"\\n\")\ncat(\"New cases found:\", length(network$discovered_cases), \"\\n\")\ncat(\"Total network size:\", length(network$all_unique_cases), \"\\n\")\n\n# View associations\nView(network$associations)\n```\n\n## Circuit Codes\n\nCommon circuit codes for the `circuit` parameter:\n\n| Code | Court |\n|------|-------|\n| `cadc` | DC Circuit Court of Appeals |\n| `ca1` through `ca11` | Circuit Courts of Appeals 1-11 |\n| `cafc` | Federal Circuit |\n| `dcd` | DC District Court |\n\nSee [PACER documentation](https://pacer.uscourts.gov/) for complete list.\n\n## Advanced Usage\n\n### Custom Rate Limiting\n\n```r\n# Wait 8-12 seconds between each request\nresults \u003c- pacer_retrieve_cases(\n  cases = my_cases,\n  circuit = \"cadc\",\n  rate_limit_seconds = c(8, 12),\n  auth_token = token\n)\n\n# Fixed 10-second wait\nresults \u003c- pacer_retrieve_cases(\n  cases = my_cases,\n  circuit = \"cadc\",\n  rate_limit_seconds = 10,\n  auth_token = token\n)\n```\n\n### Resume Interrupted Downloads\n\n```r\n# Automatically skips cases where XML already exists\nresults \u003c- pacer_retrieve_cases(\n  cases = my_cases,\n  circuit = \"cadc\",\n  output_dir = \"my_xml_files\",\n  resume_if_exists = TRUE,  # Default\n  auth_token = token\n)\n```\n\n### Extract Associations from Existing XML\n\n```r\n# From XML file\nassociations \u003c- pacer_extract_associations(\"docket_20_1234.xml\")\n\n# From XML content\nxml_content \u003c- readLines(\"docket_20_1234.xml\")\nassociations \u003c- pacer_extract_associations(xml_content)\n\n# Process multiple files\nxml_files \u003c- list.files(\"xml_files\", pattern = \"\\\\.xml$\", full.names = TRUE)\nall_assoc \u003c- purrr::map_dfr(xml_files, pacer_extract_associations)\n```\n\n## Output Files\n\n### pacer_retrieve_cases()\n\nCreates:\n- `pacer_xml_output/` (or custom directory)\n  - `docket_*.xml` - Full XML dockets for each case\n  - `retrieval_log_final.csv` - Status of all retrieval attempts\n  - `progress_log_*.csv` - Periodic progress saves\n\n### pacer_discover_network()\n\nCreates:\n- `pacer_network_output/` (or custom directory)\n  - `xml_files/` - All retrieved XML files\n  - `case_associations.csv` - All discovered associations\n  - `all_unique_cases.csv` - Complete list of cases in network\n  - `newly_discovered_cases.csv` - Cases not in original input\n\n## Tested Courts\n\n**This tool has been tested and works with:**\n- ✅ US Courts of Appeals (Circuit Courts) - tested with DC Circuit (\"cadc\")\n\n**NOT extensively tested:**\n- ⚠️ US District Courts\n- ⚠️ Bankruptcy Courts  \n- ⚠️ Other specialized courts\n\n**If you use this with untested court types, verify fee exemption applies and monitor your account closely.**\n\n## Understanding PACER Fees\n\n### Fee Structure (Without Exemption)\n- **Per-page cost**: $0.10 per page\n- **Quarterly cap**: $30 maximum per user per quarter\n- **XML downloads**: Typically charged\n- **When charges apply**: Each docket retrieval\n\n### Fee Exemptions\nResearch exemptions are available but:\n- Must be applied for and approved\n- May not apply to all court types\n- Must be verified active before each use\n- Can expire or be revoked\n- Your responsibility to understand scope\n\n**This tool CANNOT determine if your exemption is active or applicable.**\n\n### Monitor Your Account\nCheck your PACER account regularly at https://pacer.uscourts.gov/\n\n**The author has a research fee exemption that worked for Courts of Appeals. Your exemption may differ.**\n\n## Responsible Use\n\n### Rate Limiting\n\nThis package implements responsible rate limiting to avoid overloading court servers:\n- Default: 5-10 second random wait between requests\n- Configurable via `rate_limit_seconds` parameter\n- Progress saved periodically to resume after interruptions\n\n**Be respectful of court system resources.**\n\n### Acceptable Use\n\n**Permitted:**\n- ✅ Academic research\n- ✅ Legitimate legal research  \n- ✅ Educational purposes with proper fee exemption\n\n**Prohibited:**\n- ❌ Bulk downloading for commercial resale\n- ❌ Automated monitoring without exemption\n- ❌ Any use violating PACER Terms of Service\n- ❌ Use without understanding fee implications\n\n**This tool is for research purposes only. PACER prohibits bulk commercial use. The author does not support or condone use for commercial, non-research, or bulk downloading purposes that violate PACER policies.**\n\n### Terms of Service\n\nUsers MUST comply with:\n- PACER Terms of Service: https://pacer.uscourts.gov/help/tos\n- PACER Acceptable Use Policy\n- All applicable court rules and regulations\n\n**By using this software, you acknowledge:**\n- You understand PACER's fee structure\n- You are responsible for all charges\n- You will verify fee exemption status\n- You will monitor your account\n- You accept all risks and responsibilities\n- The author is NOT liable for any fees or misuse\n\n## Citation\n\nIf you use this package in research, please cite:\n\n```\nSacha Bechara (2024). pacerR: Automated Retrieval and Network Analysis of PACER Court Documents. \nR package version 0.1.0. https://github.com/sachabechara/pacerR\n```\n\n## Development\n\n### Building the Package\n\n```r\n# Generate documentation\ndevtools::document()\n\n# Check package\ndevtools::check()\n\n# Install locally\ndevtools::install()\n\n# Build vignettes\ndevtools::build_vignettes()\n```\n\n### Testing\n\n```r\n# Run tests\ndevtools::test()\n\n# Test specific file\ntestthat::test_file(\"tests/testthat/test-authenticate.R\")\n```\n\n## Related Work\n\n- [CourtListener](https://www.courtlistener.com/) - Free legal opinion and docket data\n- [RECAP](https://www.courtlistener.com/recap/) - PACER archive project\n\n## Issues and Contributions\n\nPlease report bugs or request features via [GitHub Issues](https://github.com/sachabechara/pacerR/issues).\n\nContributions welcome via pull request. See `CONTRIBUTING.md` for guidelines.\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Disclaimer\n\n**READ THE LICENSE FILE COMPLETELY BEFORE USING THIS SOFTWARE.**\n\nThis software is provided AS-IS for academic research purposes with NO WARRANTIES.\n\n**You are SOLELY responsible for:**\n- All PACER fees and charges incurred\n- Verifying fee exemption status and applicability  \n- Monitoring your PACER account\n- Complying with PACER Terms of Service\n- Ensuring appropriate use of court data\n- All risks associated with use of this software\n\n**The author is NOT responsible for:**\n- Any fees or charges to your PACER account\n- Verification of fee exemptions\n- Changes to PACER policies or fee structures\n- Misuse or violations of PACER policies\n- Use without proper understanding of fee implications\n\n**This tool was developed for research on litigation in US federal courts. It has been tested on US Courts of Appeals and may behave differently on other court types.**\n\n## Author\n\n**Sacha Bechara**  \nEmail: sacha.bechara.23@ucl.ac.uk (until end of 2026)  \nAlternative: sacha_bechara@aol.com\n\nDeveloped as part of research on litigation networks in US federal courts.\n\n## Acknowledgments\n\nThis tool was developed independently for academic research on federal court litigation patterns. It is not affiliated with or endorsed by PACER or the US Courts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachabechara%2Fpacerr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsachabechara%2Fpacerr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachabechara%2Fpacerr/lists"}