Overview
The halal.sh API screens public equities against AAOIFI Standard No. 21 (2021 Revision) — the most widely adopted Shariah screening standard for equities. Every determination is based on two categories of screens: business activity and financial ratios.Business activity screen
The first screen evaluates whether the company’s core business is permissible under Islamic law.| Result | Meaning |
|---|---|
pass | Core business is permissible (e.g., technology, healthcare, manufacturing) |
fail | Core business involves prohibited activities (e.g., conventional banking, gambling, alcohol production) |
pass with concerns noted in the response.
Financial ratio screens
Three financial ratios are evaluated against thresholds defined by AAOIFI Standard 21:| Screen | Formula | Threshold | What it measures |
|---|---|---|---|
| Debt to market cap | Total interest-bearing debt / 12-month avg market cap | ≤ 30% | Leverage from conventional debt |
| Prohibited revenue | (Interest income + other prohibited income) / Total revenue (TTM) | ≤ 5% | Income from prohibited sources (interest, gambling, alcohol, etc.) |
| Cash & receivables to market cap | (Cash + receivables) / 12-month avg market cap | ≤ 30% | Concentration of interest-bearing assets |
Market cap basis
AAOIFI Standard 21 specifies the use of 12-month trailing average market capitalization as the denominator for debt and cash ratios. This smooths out short-term price volatility. When 12-month average data is insufficient (e.g., recent IPOs), the API falls back to spot market cap and signals this in theconfidence score and extraction_metadata.
Trailing twelve months (TTM)
Revenue and interest income use trailing twelve months (TTM) — the most recent annual filing plus subsequent quarterly filings. This ensures the most current picture of the company’s income.Determination logic
Confidence score
Every determination includes a confidence score (0–1.0) reflecting data quality:| Range | Level | Meaning |
|---|---|---|
| 0.85–1.0 | High | Recent filings, clean extraction, validated data |
| 0.70–0.84 | Medium | Minor data gaps or older filings |
| Below 0.70 | Low | Significant estimation, missing data, or stale filings |
- Stale filings (>180 days since last filing)
- Extraction fallbacks used (e.g., component sum instead of primary fields)
- Missing XBRL data requiring estimation
- Recent IPO with limited price history
Purification
When a compliant company has minor prohibited income (e.g., interest on cash deposits), shareholders must purify that portion of their dividends by donating it to charity. The API returns:purification.required— whether purification is neededpurification.percentage— the percentage of dividends to purify (based on prohibited income / total revenue)
Auto-analysis
If you query a stock that hasn’t been analyzed yet, the API automatically queues analysis and returnsstatus: "pending". Poll the same endpoint — analysis typically completes within a few minutes.