Halal or Not

v1.1.0
io.github.GoodTurnStudio/halalornot Checked 2 days ago Published 2 months ago

Is it halal? Food, medicines, stocks, funds and crypto, with a verdict for each of the four schools.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

check_ingredients Check an ingredients list

Check an ingredients list. Takes the ingredients exactly as printed on the pack. Returns an overall verdict, a verdict for each school, and every flagged ingredient with the reason.

ParameterTypeDescription
ingredients *stringIngredients list as printed, comma separated.
contextstring'cosmetic' for products used on the skin, 'medicine' for medicines and supplements; these change how alcohol, carmine and necessity are treated.

check_product_by_barcode Check a product by barcode

Check a product by barcode. Looks the barcode up in Open Food Facts, then Open Beauty Facts, and checks its ingredients.

ParameterTypeDescription
barcode *stringEAN-13, EAN-8 or UPC barcode digits.

search_products Find products by name and check them

Find products by name and check them. Searches Open Food Facts by name or brand (for example 'Haribo Starmix') and returns up to five matches, each with a verdict, plus a 'say' line for the best match. Where a brand states the source of an ingredient its label leaves unnamed (Haribo: pork gelatine in its standard UK range), that statement decides it and is quoted in brand_statement.

ParameterTypeDescription
q *stringA product, brand or barcode to look up, for example Haribo Starmix or 5000159484695.
countrystringOpen Food Facts country slug, for example united-kingdom, united-states, france. 'world' means no filter. Also picks the Amazon store for halal versions (amazon.co.uk for the UK and Ireland).

explain_ingredient Explain one ingredient or E-number

Explain one ingredient or E-number. For example 'E471', 'carmine', 'prawns', 'whey' or 'alcohol denat'. Returns the verdict for each school and the reasoning.

ParameterTypeDescription
name *stringThe ingredient or E-number, for example E471, carmine, gelatin or alcohol denat.
contextstringWhether the ingredient is in food or a cosmetic. Defaults to food.

screen_stock Is this stock halal?

Is this stock halal? Screens a US-listed stock via Mizan: first the business (each standard's excluded industries), then the AAOIFI, Dow Jones Islamic, S&P Shariah and MSCI Islamic debt screens. A company name also works (nvidia, philip morris). Links to halal alternatives in the same industry.

ParameterTypeDescription
ticker *stringA US stock ticker, for example AAPL or TSLA.

ask_is_it_halal Ask any 'is it halal' question

Ask any 'is it halal' question. Covers money (savings, credit cards, mortgages, BNPL, insurance, pensions, trading), crypto, medicine, food and drink, and everyday life (music, dogs, tattoos, nail polish, smoking, games, photos, jobs). Returns the verdict, the main scholarly views and halal alternatives. Also recognises single ingredients and E-numbers.

ParameterTypeDescription
q *stringThe question in plain words, for example 'Is a credit card halal?'

check_fund Is this fund, ETF or pension fund halal?

Is this fund, ETF or pension fund halal? Recognises Shariah funds by name or ticker. For other US-registered funds and ETFs, reads the latest SEC holdings report and screens every holding by industry and debt. UK-listed ETFs (VUSA, CSPX, VWRL, SWDA, EQQQ, ISF and others) and fund names (Vanguard S&P 500, FTSE 100 tracker, LifeStrategy) are answered through a US fund tracking the same index, or from what the index holds, with UK Shariah options.

ParameterTypeDescription
ticker *stringFund or ETF ticker (VOO, QQQ, SPUS) or a Shariah fund name.

check_crypto Is this cryptocurrency halal?

Is this cryptocurrency halal? Classifies a coin by what it does (lending, gambling, meme, stablecoin, staking, general-purpose) and gives the scholarly views on crypto and on how it's used.

ParameterTypeDescription
coin *stringCoin name or symbol, for example bitcoin, ETH, AAVE.

check_medicine Is this medicine halal?

Is this medicine halal? Reads a medicine's active and inactive ingredients from its US label (openFDA) and flags gelatine, alcohol, pig-derived enzymes and heparin. The headline and say line lead with the ruling on necessity, so nobody stops a prescribed medicine; the ingredient reading follows (ingredient_headline, verdict)

ParameterTypeDescription
name *stringBrand or generic name.

get_prayer_times Today's prayer times for a place, with Ramadan suhoor and iftar

Today's prayer times for a place, with both Asr times and Ramadan suhoor and iftar. Needs city, or lat and lon together.

ParameterTypeDescription
citystringCity name, for example London or Chicago, IL.
datestringThe day, YYYY-MM-DD. Defaults to today.
latnumberLatitude of the place, in decimal degrees. Goes with lon instead of city.
lonnumberLongitude of the place, in decimal degrees. Goes with lat instead of city.
methodstringCalculation method: isna (North America), mwl (Muslim World League), umm_al_qura, egypt, karachi or moonsighting.

list_topics Every question the rulebook covers

Every question the rulebook covers. Answers 'is it halal?' for food, cosmetics, medicines, stocks, funds, crypto, money products and everyday life, showing where the four Sunni schools and the main scholarly bodies agree and where they differ, with the reasoning and halal alt...

ParameterTypeDescription
categorystringOnly topics in this area: money, crypto, medicine, food or life.

explain_schools How the four schools differ on food

How the four schools differ on food. Answers 'is it halal?' for food, cosmetics, medicines, stocks, funds, crypto, money products and everyday life, showing where the four Sunni schools and the main scholarly bodies agree and where they differ, with the reasoning and halal alt...

list_rules The full rulebook

The full rulebook. Answers 'is it halal?' for food, cosmetics, medicines, stocks, funds, crypto, money products and everyday life, showing where the four Sunni schools and the main scholarly bodies agree and where they differ, with the reasoning and halal alt...