Skip to content
PIGWATCH

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

GET
/api/v1/police-registry/

Search officers by name, badge, department, country

Params: search, badge, department, department_id, country, page, limit

GET
/api/v1/police-registry/suggest

Autocomplete search for officers and departments

Params: q (min 2 chars)

GET
/api/v1/police-registry/departments

Search departments

Params: search, country, type, page, limit

GET
/api/v1/police-registry/departments/:id

Department profile with officers and violations

Params: id (UUID)

GET
/api/v1/police-registry/:id

Officer profile with violation history

Params: id (UUID)

GET
/api/v1/police-registry/stats

Aggregate statistics

Params: none

GET
/api/v1/police-registry/recent

Last 10 violations filed

Params: none

GET
/api/v1/police-registry/violation-types

All violation categories and types

Params: none

GET
/api/v1/police-registry/map/violations

Geo-located violations for map display

Params: north, south, east, west, category, severity, department_id, start_date, end_date

GET
/api/v1/police-registry/verify/:hash

Verify a report by SHA-256 hash (includes OTS status)

Params: hash (64 hex chars)

GET
/api/v1/police-registry/export

Bulk data export (JSON or CSV)

Params: format=csv or format=json (default)

GET
/api/v1/police-registry/feed.xml

RSS feed of recent violations

Params: none

GET
/api/v1/police-registry/health

Service health check

Params: none

POST
/api/v1/police-registry/officers

Register a new officer

Params: first_name*, last_name*, badge_number, rank, department_id, force

POST
/api/v1/police-registry/departments

Register a new department

Params: name*, country*, province_state, city, type, officer_count

POST
/api/v1/police-registry/donate

Create $5 filing donation invoice

Params: payment_method, declarant_name, declarant_email, return_url*

GET
/api/v1/police-registry/donate/:invoiceId/status

Check donation payment status

Params: invoiceId

POST
/api/v1/police-registry/:id/violations

File 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

POST
/api/v1/police-registry/departments/:id/respond/:vid

Department response to a violation

Params: response*, respondent_name*, respondent_email*, respondent_position

GET
/api/v1/police-registry/export/officers.csv

CSV export of all officers with trust scores and violation counts

Params: none

GET
/api/v1/police-registry/export/departments.csv

CSV export of all departments with trust scores

Params: none

GET
/api/v1/police-registry/export/violations.json

JSON 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 count
  • violations.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.