If you have ever used a halal stock screening app and wondered "how does this thing actually decide?" - this post is the detailed answer. It documents the implementation pattern invest-like.com uses to apply AAOIFI Standard 21 to the full indexed universe of 12,000+ listed equities, refreshed daily. It covers what the screen catches well, where it has known limitations, and the engineering trade-offs along the way.
This is intended for two audiences: serious Muslim retail investors who want to audit the screening tools they use, and developers building or evaluating halal-screening systems.
The data inputs
Every halal screen needs three categories of inputs per stock:
Identity: ticker, company name, ISIN, sector, industry, country of incorporation. We source these from Financial Modeling Prep (FMP) for the US-listed and major international universe.
Financials: interest-bearing debt (long-term debt + current portion of long-term debt), 36-month average market capitalisation (or trailing market cap as a proxy when 36-month average is unavailable), total revenue, cash + interest-bearing securities, accounts receivable. Source: FMP financial statements API.
Product-segment breakdown: revenue split by company-disclosed segment (e.g. "Hotels Owned: $4.2B", "Wine & Spirits: $1.1B"). Source: FMP product segments endpoint where available. Coverage is partial - large-cap conglomerates with detailed 10-K segment disclosure have data; mid-cap and smaller companies often do not.
Data quality is the first major challenge. FMP industry classifications are coarse - Visa and Mastercard live in "Financial - Credit Services" alongside American Express and Capital One despite being structurally different businesses. The screen has to compensate for these classifier-level errors with manual override lists.
The activity screen implementation
Test 1 of AAOIFI Standard 21 (primary business) is implemented as a multi-layer filter:
Layer 1 - Industry exclusion set. A hardcoded set of 30+ FMP industry strings that map to AAOIFI-excluded businesses. The set is built by enumerating the actual industry values in the live stocks table, then hand-classifying each one as halal-permissible or excluded. The exclusion set includes:
- "Banks - Regional", "Banks - Diversified", "Banks"
- "Insurance - Property & Casualty", "Insurance - Life", "Insurance - Diversified", "Insurance - Specialty", "Insurance - Reinsurance"
- "Financial - Credit Services", "Financial - Conglomerates"
- "Asset Management - Bonds", "Asset Management - Income", "Asset Management - Leveraged"
- "REIT - Mortgage"
- "Beverages - Wineries & Distilleries", "Beverages - Brewers", "Beverages - Alcoholic"
- "Tobacco"
- "Gambling, Resorts & Casinos", "Gambling", "Resorts & Casinos"
Plus FMP data-quirk entries like "FIRE, MARINE & CASUALTY INSURANCE" which appears in uppercase on certain ticker classes (BRK.A vs BRK-A) due to different FMP data feeds.
A stock with industry matching this set fails the activity screen and is marked non-compliant regardless of financial ratios.
Layer 2 - Ticker-override compliant list. Some clearly Shariah-compliant businesses get grouped into excluded industries by FMP's coarse classifier. The most common case: Visa and Mastercard in "Financial - Credit Services" alongside interest-issuing lenders. These two are pure payment networks (they process transactions and charge fees; they do not issue interest-bearing credit - the issuing banks do that). Major Islamic-index providers (Dow Jones Islamic, S&P Shariah, MSCI Islamic, Saudi Tadawul Shariah) all classify them as compliant.
The override list grants industry-classification pardon to such tickers. The financial-ratio screen still runs - a pardoned ticker with debt above 30 percent will still fail on the ratio test. The pardon only handles the industry-classification noise.
Layer 3 - Ticker-override non-compliant list. The mirror: tickers FMP classifies in OK industries but that AAOIFI provider consensus rejects. The most common cases:
- Netflix, Disney, Warner Bros Discovery, Comcast, Paramount: classified by FMP as "Entertainment" but rejected by Islamic indices for R-rated content library exposure.
- Hilton, Marriott, Hyatt, IHG, Wyndham: classified as "Lodging" but rejected for embedded alcohol/bar revenue that does not appear at the segment level.
- Coinbase, MicroStrategy, Riot Platforms, MARA, CleanSpark: crypto-exchange or Bitcoin-treasury companies, rejected per the AAOIFI chairman Mufti Taqi Usmani's public ruling against cryptocurrency.
- BDCs, CLO funds, credit funds: industry "Asset Management" hides them, but the company name reveals the structurally interest-bearing nature.
Layer 4 - Name-pattern fallback. Catches credit/income/bond funds with industry "Asset Management" that the layer-3 override list does not explicitly enumerate. Implementation: a list of regex patterns matched against the company name when the industry is in a credit-vehicle-prone set ("Asset Management", "Asset Management - Global", "Financial - Capital Markets", "Financial - Conglomerates", "Shell Companies").
The patterns:
\bcredit\b
\bincome\s+fund\b
\bbond\s+fund\b
\b(BDC|CLO)s?\b (case-sensitive)
\bnotes\s+due\b
\bstrategic\s+credit\b
\bopportunistic\s+credit\b
\bdebt\s+fund\b
\bmortgage\s+income\b
\bmunicipal\s+(credit|income|bond)\b
\bsenior\s+(loan|debt)\b
\bbusiness\s+development\s+co
\bopportunit(y|ies)\s+trust\b
Scoped to the credit-vehicle-prone industry set so the regex cannot false-positive on a company named "Credit Karma" in a software industry.
The financial-ratio screen implementation
Test 2 of AAOIFI (debt ratio) is the simplest layer to implement:
const debtRatio = long_term_debt / market_cap;
if (debtRatio < 0.30) status = "compliant";
else if (debtRatio < 0.40) status = "questionable"; // borderline
else status = "non_compliant";
The honest limitations:
long_term_debt from FMP is a slight under-estimate of "total interest-bearing debt" (it excludes current portion of long-term debt and some lease liabilities). The 30 percent threshold partially compensates for this by being slightly stricter than the DJII 33 percent.
- Market cap is point-in-time, not a 36-month average. AAOIFI's official methodology uses the 36-month average. Using point-in-time market cap means the ratio is more volatile - a stock that dropped 50 percent might temporarily look like it has 2x the historical debt ratio. We accept this as a v1 limitation in favour of always-fresh data.
- Negative-equity companies (where book value is negative due to share buybacks exceeding retained earnings) have ratio interpretation issues. We use market cap as the denominator specifically to avoid this case.
The non-permissible income screen implementation
Test 3 (income from haram sources < 5 percent) is the test with the most variance across screening tools. The implementation:
Layer A - Segment-level haram keyword match. Where FMP provides product-segment revenue data, the screen sums revenue from segments whose name matches a haram-keyword list:
alcohol, wine, spirits, beer, liquor, brewery, brewing, distill,
tobacco, cigarette, cigar,
casino, gambling, wager, betting, lottery, sportsbook,
adult content, adult entertainment, pornograph,
interest income, interest revenue, loan interest, mortgage interest
Above 5 percent: non-compliant. 2-5 percent: borderline with the expectation of dividend purification. Below 2 percent: clean.
Layer B - Ticker overrides for known offenders. As described in the activity-screen section, hotels, travel companies, entertainment conglomerates with embedded haram revenue that doesn't appear cleanly at the segment level are caught via the explicit non-compliant override list.
Layer C - Unknown / not-applicable. Where FMP segment data is missing entirely (mostly mid-cap and smaller), the screen falls back to "no detected non-permissible income" - the stock passes test 3 by default. This is a known limitation. The right fix (parse the company's 10-K text for haram revenue mentions) requires NLP infrastructure beyond the deterministic-screen scope.
What the screen catches well
Empirically (after spot-checking ~500 stocks against the Dow Jones Islamic Market and Zoya app), the invest-like.com screen:
- Catches 98+ percent of obviously haram stocks: banks, insurance, alcohol, tobacco, gambling all fail correctly on the activity screen.
- Catches the FMP misclassification gotchas: Visa, Mastercard, PayPal are correctly pardoned; Netflix, Disney, Hilton, Coinbase are correctly excluded.
- Catches credit-fund false-positives: BDCs, CLO funds, bond funds that FMP groups into "Asset Management" are correctly excluded by name-pattern fallback.
- Catches debt-ratio failures: high-leverage retailers, deeply-leveraged industrials, debt-laden REITs all fail the 30/40 percent thresholds.
- Matches DJII verdicts on the major large-cap names: cross-check shows agreement on ~95+ percent of the S&P 500 names.
Known limitations
The screen has documented gaps:
Limitation 1 - Test 4 (liquid assets ratio): documented but not yet automated. Requires reliable cash + interest-bearing-securities + receivables data across the universe, which we do not have consistently. On the roadmap.
Limitation 2 - Product-segment coverage: only ~30 percent of the universe has FMP product-segment data with enough granularity to run the segment-level haram-revenue test. The other 70 percent rely on ticker-level overrides for the most-common cases.
Limitation 3 - International coverage: most aggressively-verified universe is US-listed plus major international (XETRA, LSE, TSX, ASX, HKEX, TSE). Smaller markets (Indonesia IDX, India NSE, Saudi Tadawul) have less reliable ratio data and thinner FMP segment coverage, so verdicts there should be treated with more caution.
Limitation 4 - 36-month average market cap: we use point-in-time market cap rather than the AAOIFI-specified 36-month rolling average. Adds ratio volatility but keeps the screen fresh.
Limitation 5 - Dividend purification calculation: the screen reports the non-permissible income ratio but does not (in v1) automatically compute per-position purification amounts for each user. That requires cost-basis tracking infrastructure we do not have. On the roadmap.
Limitation 6 - Subsidiary consolidation: AAOIFI says to consolidate subsidiaries when computing the screen on the parent. We currently apply the screen at the published-company level only. Catches most obvious cases (a parent in an excluded industry fails directly) but misses edge cases where a holding company in a clean industry owns a non-halal subsidiary the parent doesn't break out.
How to audit a halal-screening tool
If you are evaluating a halal-screening tool (invest-like.com, Zoya, Musaffa, Wahed, IdealRatings, Islamicly):
1. Verify the standard used. AAOIFI Standard 21 is the strictest mainstream standard. DJII is one threshold step looser. MSCI Islamic and FTSE Shariah are similar to DJII. Some tools use proprietary derivative standards. Ask which document the tool is implementing.
2. Check the universe coverage. US-only? US + major international? Emerging markets? The screen quality varies by market coverage of the underlying data source.
3. Test 5-10 known cases. Pick stocks where you know the consensus verdict (Bank of America = haram, Apple = halal, Hilton = haram per most Islamic indices, Visa = halal). Plug them into the tool. If it agrees on all 5-10 you've checked, the tool likely has a competent screen. If it disagrees on any, ask which standard or override rule produced the divergent verdict.
4. Check the refresh cadence. Quarterly refresh is the institutional minimum (matches quarterly earnings disclosure). Monthly is better. Daily is overkill but means the screen catches mid-quarter share-count changes or one-off events.
5. Check transparency. Does the tool publish its exclusion industry list? Its ticker override list? Its thresholds? Black-box tools are harder to validate. Transparent tools (like invest-like.com publishing methodology at /methodology/halal/) can be audited.
The trade-offs
Three engineering trade-offs worth understanding:
Trade-off 1 - Strict vs broad screen. A strict screen (AAOIFI 30 percent) excludes more stocks but matches institutional consensus. A loose screen (DJII 33 percent) includes more stocks but is rejected by stricter scholars. invest-like.com chose strict because it is more defensible against the most-rigorous interpretations.
Trade-off 2 - Manual overrides vs pure automation. Pure automation (everything decided by industry classifier + ratios) is reproducible and unbiased, but misses FMP misclassifications. Manual overrides (the TICKER_OVERRIDE lists) catch real cases but introduce bias. We use both, with all overrides documented inline in source code so any user can audit them.
Trade-off 3 - Speed vs depth. Running test 4 (liquid assets ratio) properly requires fetching detailed balance-sheet data for every stock at every refresh. The v1 trade-off was to skip test 4 in favour of always-fresh screens on tests 1, 2, and 3. The result is a slightly looser screen than full AAOIFI, but with daily refresh instead of quarterly.
Where invest-like.com sits in the ecosystem
There are several other halal-screening tools available to retail Muslim investors. A non-exhaustive comparison:
- Zoya: best-known retail halal-screening app, US-focused, $9.99/month. Strong UX, smaller universe than invest-like.com (US only). Methodology is partially published.
- Musaffa: similar US-focused app, more aggressive marketing. Methodology is partially published.
- Wahed: full Islamic-finance institution offering managed portfolios + screening + Bitcoin services. Different category - includes financial advice and execution, not just screening.
- IdealRatings: institutional-grade screening data provider used by many Islamic banks. Not consumer-facing.
- Islamicly: US + international coverage, app-focused, ratings + watchlist.
- invest-like.com: screens via AAOIFI Standard 21 plus cross-grades against 7 value-investing frameworks. Free tier with full halal screen + 3 AI verdicts per week. Methodology fully open.
Each tool has different strengths. The honest evaluation: pick the one whose methodology you can audit and whose universe coverage matches what you want to invest in.
Further reading
Educational only. Not investment advice. The halal screen described is a structured filter for retail investor convenience, not a fatwa. If your scholar or madhhab uses different guidance, follow that guidance.