API Documentation
Public REST API for journalists, researchers, and developers.
Base URL: https://pigwatch.org/api/v1/police-registry
Quick Start
# Get all departments
curl https://pigwatch.org/api/v1/police-registry/departments
# Search officers by name
curl "https://pigwatch.org/api/v1/police-registry/?search=Smith"
# Export all data as CSV
curl "https://pigwatch.org/api/v1/police-registry/export?format=csv" -o pigwatch.csv
# Verify a report hash
curl https://pigwatch.org/api/v1/police-registry/verify/abc123...
Endpoints
/api/v1/police-registry/Search officers by name, badge, department, country
Params: search, badge, department, department_id, country, page, limit
/api/v1/police-registry/suggestAutocomplete search for officers and departments
Params: q (min 2 chars)
/api/v1/police-registry/departmentsSearch departments
Params: search, country, type, page, limit
/api/v1/police-registry/departments/:idDepartment profile with officers and violations
Params: id (UUID)
/api/v1/police-registry/:idOfficer profile with violation history
Params: id (UUID)
/api/v1/police-registry/statsAggregate statistics
Params: none
/api/v1/police-registry/recentLast 10 violations filed
Params: none
/api/v1/police-registry/violation-typesAll violation categories and types
Params: none
/api/v1/police-registry/map/violationsGeo-located violations for map display
Params: north, south, east, west, category, severity, department_id, start_date, end_date
/api/v1/police-registry/verify/:hashVerify a report by SHA-256 hash (includes OTS status)
Params: hash (64 hex chars)
/api/v1/police-registry/exportBulk data export (JSON or CSV)
Params: format=csv or format=json (default)
/api/v1/police-registry/feed.xmlRSS feed of recent violations
Params: none
/api/v1/police-registry/healthService health check
Params: none
/api/v1/police-registry/officersRegister a new officer
Params: first_name*, last_name*, badge_number, rank, department_id, force
/api/v1/police-registry/departmentsRegister a new department
Params: name*, country*, province_state, city, type, officer_count
/api/v1/police-registry/donateCreate $5 filing donation invoice
Params: payment_method, declarant_name, declarant_email, return_url*
/api/v1/police-registry/donate/:invoiceId/statusCheck donation payment status
Params: invoiceId
/api/v1/police-registry/:id/violationsFile a violation (requires payment_id)
Params: category*, title*, description*, severity, filing_type, payment_id*, oath_confirmed, declarant_name, declarant_email, declarant_signature, incident_date, incident_location, evidence_base64
/api/v1/police-registry/departments/:id/respond/:vidDepartment response to a violation
Params: response*, respondent_name*, respondent_email*, respondent_position
/api/v1/police-registry/export/officers.csvCSV export of all officers with trust scores and violation counts
Params: none
/api/v1/police-registry/export/departments.csvCSV export of all departments with trust scores
Params: none
/api/v1/police-registry/export/violations.jsonJSON export of all violations (public fields only, no declarant info)
Params: none
Data Exports
Public bulk data exports for journalists, researchers, and developers. No authentication required.
# Download all officers as CSV
curl https://pigwatch.org/api/v1/police-registry/export/officers.csv -o officers.csv
# Download all departments as CSV
curl https://pigwatch.org/api/v1/police-registry/export/departments.csv -o departments.csv
# Download all violations as JSON
curl https://pigwatch.org/api/v1/police-registry/export/violations.json -o violations.json
Export Contents
officers.csv— ID, name, badge, rank, trust score, department, location, violation counts (total/open/resolved)departments.csv— ID, name, location, type, trust score, officer count, violation countviolations.json— ID, title, category, severity, status, incident date/location, report hash, OTS status, officer and department info
Declarant identities, descriptions, and signatures are never included in public exports.
Embeddable Widgets
Embed an officer's trust badge on your website. Replace OFFICER_ID with the officer's UUID.
<!-- PigWatch Trust Badge -->
<iframe
src="https://pigwatch.org/embed/OFFICER_ID"
width="340" height="120"
frameborder="0"
style="border:none;border-radius:12px;"
></iframe>
The widget renders a compact trust badge with the officer's name, department, trust score, and violation count. Links back to the full profile on PigWatch.
Department Trust Badge
Embed a department's trust badge. Replace DEPARTMENT_ID with the department's UUID.
<!-- PigWatch Department Trust Badge -->
<iframe
src="https://pigwatch.org/embed/department/DEPARTMENT_ID"
width="340" height="120"
frameborder="0"
style="border:none;border-radius:12px;"
></iframe>
Shows department name, location, type, trust score, officer count, and violation count.
Rate Limits
- Violation filing: 10 requests/minute per IP
- Officer/department registration: 5 requests/minute per IP
- Search/read endpoints: 100 requests/minute per IP
Data Policy
All public endpoints return aggregate data only. Declarant identities, report descriptions, and signatures are never exposed via the API. The export endpoint provides officer names, department names, violation titles, categories, severities, and SHA-256 hashes only.