Compliance Scoring

Parley computes a 0-100 compliance risk score for every facility based on its violation history, penalty severity, inspection frequency, and current compliance status.

How it works

The compliance score is a rule-based composite metric that aggregates five weighted factors into a single number. A score of 0 indicates the worst compliance profile; 100 indicates clean compliance.

The scoring model is deterministic and rule-based -- not ML. Given the same input data, the score is always the same. Scores are recomputed on every data ingestion (weekly).

Score Breakdown

Each factor is scored 0-100, then combined with the following weights:

30%
violation_recency

How recent the last violation is. A violation within the last 6 months scores high (bad); no violations in 3+ years scores 0 (good).

25%
violation_frequency

Number of violations in the last 3 years relative to facility size and program count. More violations = higher score.

20%
penalty_severity

Total penalty amount in the last 5 years, normalized by facility type. Higher penalties = higher score.

15%
active_violations

Whether the facility has any currently unresolved violations. Binary: 100 if any active violations, 0 otherwise.

10%
inspection_gap

Time since the last inspection. Longer gaps score higher, reflecting uncertainty. No inspection in 5+ years = 100.

The final score formula:

score = (violation_recency * 0.30)      + (violation_frequency * 0.25)      + (penalty_severity * 0.20)      + (active_violations * 0.15)      + (inspection_gap * 0.10)

Interpreting Scores

RangeRisk LevelInterpretation
0 - 20LowClean compliance record. No recent violations, regular inspections.
21 - 40ModerateMinor issues. Possibly older violations, small penalties.
41 - 60ElevatedNotable compliance concerns. Multiple violations or significant penalties.
61 - 80HighSerious compliance problems. Recent HPV violations, active enforcement.
81 - 100CriticalSevere and ongoing violations. Active enforcement cases, major penalties.

Score in API responses

The compliance_score field appears in facility list and detail responses. The detail endpoint also includes the full score_breakdown.

Request
curl "https://api.parley.dev/v1/facilities/f47ac10b-58cc-4372-a567-0e02b2c3d479" \  -H "X-API-Key: prl_YOUR_KEY_HERE"
200OKapplication/json
{  "data": {    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",    "name": "ACME CHEMICAL PLANT",    "compliance_score": 78,    "score_breakdown": {      "violation_recency": 100,      "violation_frequency": 70,      "penalty_severity": 75,      "active_violations": 100,      "inspection_gap": 0    }  }}

Filtering by score

Use min_score and max_score on the facilities list endpoint to filter by compliance risk:

High-risk facilities in California
curl "https://api.parley.dev/v1/facilities?state=CA&min_score=80&sort=score&order=desc" \  -H "X-API-Key: prl_YOUR_KEY_HERE"
Clean facilities near a location
curl "https://api.parley.dev/v1/facilities?lat=34.0522&lng=-118.2437&radius=10&max_score=20" \  -H "X-API-Key: prl_YOUR_KEY_HERE"