Shariah-Compliant Investing Research Agent Stack
Yassir v0.1.0 used 4 web vendors plus a fundamentals API. Consolidating to Scavio + Polygon cuts credentials by 50%.
An r/HalalInvestor post released Yassir v0.1.0 — an open-source AI research agent for Shariah-compliant investing. The stack used HalalTerminal API for fundamentals plus a four-vendor web fallback chain (Brave, Tavily, Exa, Perplexity). The four-vendor chain is where most of the cost and complexity lives, and it's the layer most worth consolidating.
Why the four-vendor chain happened
No single vendor covered everything. Brave for index independence. Tavily for clean LangChain integration. Exa for semantic retrieval. Perplexity Sonar for citations. Each redundant call added cost; each new vendor added a credential and a fallback decision tree.
What consolidating actually saves
Replacing the four web vendors with one Scavio API gets you SERP + Reddit + YouTube under one credit pool. Reddit picks up the community-sentiment layer that pure web search misses. YouTube surfaces earnings call recaps and analyst videos. Cost drops from ~$50-100/mo on the four-vendor chain to $30/mo on Scavio Project.
The keepers
Polygon.io free tier covers fundamentals (stock prices, ratios) with delayed data. Free tier limits: 5 requests/minute, 1 year of history, delayed pricing. For research-grade use that's acceptable; serious agents upgrade to $29/mo Starter or $79/mo Stocks Developer for more history. HalalTerminal stays for Shariah-tagged data if budget allows.
The Shariah filter belongs at the LLM layer
Shariah-specific filters (no riba, no gharar, business-mix limits) live in the agent prompt or the LLM's reasoning step, not in the search vendor. A general-purpose multi-platform search API beats a niche search vendor for the discovery layer because breadth matters more than category-tagging at search time.
import os, requests
from polygon import RESTClient
SCAVIO = os.environ['SCAVIO_API_KEY']
POLYGON = os.environ['POLYGON_API_KEY']
H = {'x-api-key': SCAVIO}
client = RESTClient(api_key=POLYGON)
def research(ticker):
return {
'web': requests.post('https://api.scavio.dev/api/v1/search',
headers=H, json={'query': f'{ticker} 2026 financials'}).json(),
'reddit': requests.post('https://api.scavio.dev/api/v1/reddit/search',
headers=H, json={'query': ticker}).json(),
'youtube': requests.post('https://api.scavio.dev/api/v1/youtube/search',
headers=H, json={'query': f'{ticker} earnings call'}).json(),
'fundamentals': client.get_ticker_details(ticker)
}The Shariah verdict step
Pass the assembled data to Claude with a Shariah ruleset. Reject if interest-bearing debt > 33% of market cap. Reject if revenue from alcohol, gambling, or conventional finance > 5%. Flag for purification if there's small interest income. The LLM produces a verdict plus a one-paragraph explanation citing the sources used.
What the consolidation gives Yassir contributors
Fewer credentials to manage. Lower per-query cost. Reddit retail- sentiment as a real signal layer (r/halalinvesting plus r/wallstreetbets surface sentiment shifts). YouTube earnings-call recaps without a separate vendor. The Yassir code shrinks; the contributor onboarding gets simpler.
Per-question economics
Per ticker research call: 3 Scavio queries (web, Reddit, YouTube) + 1 Polygon fundamentals call + 1 Claude pass = ~$0.013 of API plus $0.05-0.20 of Claude tokens. At 100 ticker queries/day, the agent runs about $30/mo plus Claude API spend.
The MCP layer
Wire mcp.scavio.dev/mcp as a Claude Desktop tool. The user asks "is AAPL Shariah-compliant in 2026?". Claude calls Scavio for web/Reddit/YouTube context, calls Polygon for fundamentals, applies the Shariah filter, returns sourced answer in 8-15 seconds. No CLI required for non-technical users.