muslimait
v1.0.2
Published
Official SDK and CLI for the MuslimAIT Islamic Knowledge API
Maintainers
Readme
MuslimAIT SDK
Official JavaScript/TypeScript SDK and CLI for the MuslimAIT Islamic Knowledge API.
Access 87,000+ verified Islamic sources — Quran, Hadith, and scholarly Q&A — powered by AI.
Installation
npm install muslimaitQuick Start
const { MuslimAIT } = require('muslimait');
const ai = new MuslimAIT('mai_live_your_key_here');
const response = await ai.ask('What are the five pillars of Islam?');
console.log(response.answer);
console.log(response.sources);CLI Usage
# Set your API key
export MUSLIMAIT_API_KEY=mai_live_your_key_here
# Ask a question
muslimait ask "What does Islam say about patience?"
# Search sources
muslimait search "charity zakat"
# Or pass key inline
muslimait ask "Is pork halal?" --key mai_live_your_key_hereAPI Reference
new MuslimAIT(apiKey, baseUrl?)
Create a client instance.
apiKey— Your API key from muslimai.uk/developersbaseUrl— Optional. Default:https://muslimai.uk
client.ask(question, options?)
Ask a question and get an AI-powered answer with citations.
const response = await ai.ask('What is zakat?');
// response.answer — The AI-generated answer
// response.sources — Array of cited sourcesOptions:
timeout— Request timeout in ms (default: 30000)
client.search(query, limit?)
Search Islamic sources directly without AI generation.
const results = await ai.search('patience', 5);
// results.results — Array of matching documentsResponse Format
{
"answer": "Zakat is one of the five pillars of Islam...",
"sources": [
{
"type": "quran",
"citation": "Quran 2:43",
"answer": "Arabic: ... Translation: ..."
},
{
"type": "hadith",
"citation": "Bukhari 8",
"answer": "From Sahih Bukhari..."
}
]
}Get Your API Key
- Visit muslimai.uk/developers
- Sign in with your email
- Create an API key from the dashboard
Pricing
- Free: 10 requests/day
- Basic: 500 requests/day — £4.99/mo
- Pro: 5,000 requests/day — £19.99/mo
- Enterprise: Unlimited — £49.99/mo
Links
License
MIT
