Skip to main content

Overview

The simplest integration: fetch a stock’s compliance result and render a badge. One request to GET /instruments/{symbol}/compliance, one badge in your UI.
Never call the halal.sh API directly from the browser — that would expose your API key. Proxy the request through your own backend, which holds the key, and have your frontend talk to the proxy.

Step 1 — Proxy the request through your backend

Your server holds the API key and forwards the call to halal.sh. The browser only ever talks to your own endpoint.
The compliance payload looks like this:

Step 2 — Render the badge

Drive the badge off determination.status. The three statuses are compliant, non-compliant, and pending.

Step 3 — Show the screen details

For a richer view, surface the three financial screens. Each one reports a result of "pass" or "fail" — 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.