---
title: "Get Portfolio Report"
method: POST
path: "/api/reports/portfolio"
tags: ["reports"]
---

# Get Portfolio Report

`POST /api/reports/portfolio`

## Request

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

Generate a Shariah compliance report for a portfolio of stocks.

Accepts a list of ticker symbols and returns an aggregated report with
per-holding compliance results, overall compliance percentage, and
summary counts. Useful for screening an entire portfolio at once.

**curl example:**
```bash
curl -X POST "http://localhost:8000/api/reports/portfolio" \
     -H "Content-Type: application/json" \
     -d '{"symbols": ["AAPL", "MSFT", "AMZN"]}'
```

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

resp = requests.post(
    "http://localhost:8000/api/reports/portfolio",
    json={"symbols": ["AAPL", "MSFT", "AMZN"]},
)
report = resp.json()
print(f"Compliance: {report['compliance_percentage']}%")
print(f"Compliant: {report['compliant']}/{report['total']}")
```

## Request body

- PortfolioReportRequest: Request body for generating a portfolio-level compliance report.
  - `symbols` string[], required: List of ticker symbols to include in the portfolio report

## Response `200`

Aggregated Shariah compliance report for the portfolio

- PortfolioReportResponse: Aggregated Shariah compliance report for a portfolio of stocks.
  - `report_generated_at` string, required: ISO 8601 timestamp when the report was generated
  - `total` integer, required: Total number of holdings analyzed
  - `compliant` integer, required: Number of holdings that passed Shariah compliance screening
  - `non_compliant` integer, required: Number of holdings that failed Shariah compliance screening
  - `errors` integer, required: Number of holdings where screening could not be completed
  - `compliance_percentage` number, nullable: Percentage of successfully screened holdings that are compliant
  - `holdings` PortfolioHoldingReport[], required: Individual screening results for each holding in the portfolio
    - `symbol` string, required: Ticker symbol of the holding
    - `is_compliant` boolean, nullable: Whether the holding passes Shariah compliance screening; null if an error occurred
    - `screening` object, nullable: Detailed screening results, if available
    - `error` string, nullable: Error message if screening could not be completed for this holding

## Other responses

- `400`: Invalid request — at least one symbol is required
- `401`: Authentication required
- `404`: Resource not found
- `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)
