Skip to main content

Overview

halal.sh covers a large but finite universe of instruments, and coverage grows over time. When you request /compliance for an instrument that hasn’t been analysed yet, the API doesn’t fail and it doesn’t queue work on demand — it returns a well-formed payload with determination.status: "pending" and the analysis fields left null. This guide shows how to detect that state and handle it gracefully.
All 12 sandbox instruments are already analysed, so you won’t see a pending status while testing against the sandbox key. The handling below matters once you’re live against the full universe.

What a pending response looks like

A pending instrument returns status: "pending" with every analysis field nullscreens, revenue, purification, stability, and filing:
There is no auto-queue and no retry_after on a pending response. Re-requesting the same symbol in a loop won’t trigger analysis or change the result — it just burns rate limit. (The only place retry_after appears is on 429 rate-limit errors, which is unrelated to pending coverage.)

Detect pending

Branch on determination.status and treat pending as “compliance unknown” rather than an error.

Pending in a portfolio screen

POST /screen can return compliance_status: "pending" for any symbol that isn’t analysed yet. Partition the results and decide what each bucket means for your UI.

What to show users

How coverage grows

Coverage expands as new instruments are analysed, so a symbol that’s pending today may return a full result later. Design for it: cache results you’ve already fetched, re-check pending symbols on a sensible cadence (for example, the next time a user opens that stock), and always render a clear neutral state in the meantime. Never block a screen or treat pending as a hard error.