---
title: "Compare Runs"
method: GET
path: "/api/screen-bulk/compare"
tags: ["screening"]
---

# Compare Runs

`GET /api/screen-bulk/compare`

## Request

- Base URL: `https://api.halalterminal.com`
- URL: `https://api.halalterminal.com/api/screen-bulk/compare`
- Auth: API key in header `X-API-Key`

Compare the results of two bulk screening runs.

Identifies symbols whose compliance status changed between run A and
run B, including newly compliant, newly non-compliant, added, and
removed symbols.

**curl example:**
```bash
curl -X GET "https://api.halalterminal.com/api/screen-bulk/compare?run_a=abc123&run_b=def456" \
     -H "X-API-Key: <API_KEY>"
```

**Python requests example:**
```python
import requests

resp = requests.get(
    "https://api.halalterminal.com/api/screen-bulk/compare",
    params={"run_a": "abc123", "run_b": "def456"},
    headers={"X-API-Key": "<API_KEY>"},
)
print(resp.json())
```

## Query parameters

- `run_a` string, required: Run ID of the first (baseline) screening run.
- `run_b` string, required: Run ID of the second (comparison) screening run.

## Response `200`

Side-by-side comparison of two screening runs

- BackendSchemasScreeningCompareResponse
  - `run_a` string, required
  - `run_b` string, required
  - `index_name` string, required
  - `run_a_date` string, nullable
  - `run_b_date` string, nullable
  - `summary` CompareSummary, required
    - `newly_compliant` integer, required: Symbols that became compliant in run B
    - `newly_non_compliant` integer, required: Symbols that became non-compliant in run B
    - `unchanged_compliant` integer, required
    - `unchanged_non_compliant` integer, required
    - `added_symbols` integer, required: Symbols present in run B but not in run A
    - `removed_symbols` integer, required: Symbols present in run A but not in run B
  - `changes` CompareChange[], required
    - `symbol` string, required
    - `change` string, required: Type of change: became_compliant, became_non_compliant, added, or removed
    - `run_a_compliant` boolean, nullable
    - `run_b_compliant` boolean, nullable
    - `reason` string, nullable: Human-readable explanation for the compliance change

## Other responses

- `401`: API key required or invalid
- `404`: Resource or symbol not found
- `422`: Validation Error
- `429`: Quota exceeded

---

[API](https://skmtc.dev/halalterminal/apis/halal-terminal-api.md) · [All operations](https://skmtc.dev/halalterminal/apis/halal-terminal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/halalterminal/apis/halal-terminal-api/revisions/78768b250943?raw)
