---
title: "Compare Symbols"
method: POST
path: "/api/compare"
tags: ["comparison"]
---

# Compare Symbols

`POST /api/compare`

## Request

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

Compare Shariah compliance across multiple symbols.

Accepts 2-5 ticker symbols and returns screening results, market
quotes, and stored database data for each symbol side by side.

**curl example**:
```bash
curl -X POST https://api.halalterminal.com/api/compare \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_live_abc123def456" \
  -d '{"symbols": ["AAPL", "MSFT"]}'
```

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

resp = requests.post(
    "https://api.halalterminal.com/api/compare",
    headers={"X-API-Key": "sk_live_abc123def456"},
    json={"symbols": ["AAPL", "MSFT"]},
)
comparison = resp.json()
for item in comparison["items"]:
    print(item["symbol"], item["screening"]["status"])
```

## Request body

- CompareRequest: Request body for comparing Shariah compliance across multiple symbols.
  - `symbols` string[], required: List of 2-5 stock ticker symbols to compare

## Response `200`

Side-by-side compliance comparison for the requested symbols

- BackendSchemasComparisonCompareResponse: Aggregated comparison result for the requested symbols.
  - `symbols` string[], required: Symbols that were compared
  - `count` integer, required: Number of symbols in the comparison
  - `items` CompareItemResponse[], required: Per-symbol comparison results
    - `symbol` string, required: Ticker symbol for this comparison item
    - `screening` object, nullable: Shariah screening result including compliance status
    - `quote` object, nullable: Latest market quote data
    - `database` object, nullable: Stored company data from the database

## Other responses

- `400`: Fewer than 2 or more than 5 symbols provided
- `401`: Missing or invalid API key
- `422`: Validation Error
- `429`: Rate limit 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)
