Overview
Fetch a stock’s compliance result with one request toGET /instruments/{symbol}/compliance, and render it as a badge in your UI.
To show compliance results to the users of your product, you need the
Developer plan and the credit Screening by halal.sh beside
them. The component in step 2 renders the credit beside the badge.
Step 1: Proxy the request through your backend
Your server holds the API key and forwards the call to halal.sh.Step 2: Render the badge and the credit
Base the badge ondetermination.status, which is compliant, non-compliant or pending.
Step 3: Show the screen details
To show why a stock passes or fails, list the three financial screens. Each one has aresult of "pass" or "fail", or "not_applicable" with a null value when the screen doesn’t apply. There is no boolean passes field, so check result === "pass".
Ratio
value and threshold are decimals: 0.30 means 30%, so multiply by
100 before display. The three financial screen keys are always
debt_to_market_cap, cash_to_market_cap, and prohibited_revenue.
