widetorah
v0.1.1
Published
TypeScript SDK for WideTorah -- Torah verses, Talmud daf, Rashi commentary, parashot, and Jewish encyclopdia
Maintainers
Readme
widetorah
TypeScript SDK for WideTorah -- access Torah verses, Talmud daf pages, Rashi commentary, weekly parashot, Jewish holidays, biblical figures, and glossary terms through a typed async API. Zero runtime dependencies -- uses the native fetch API (Node 18+, Deno, Bun, browsers).
WideTorah provides structured access to the Jewish scriptural canon: 24 books of the Tanakh with 69,616 verses across 3 translations (Masoretic Hebrew, JPS-1917, Koren), 54 weekly parashot, 2,121 Talmud daf pages across 63 tractates, 3,901 Rashi commentary entries, and 10 Jewish holidays -- all from the widetorah.com REST API.
Explore the Torah online at widetorah.com -- verse-by-verse reading, Talmud daf browser, parashah calendar, and Jewish encyclopedia.
Table of Contents
- Install
- Quick Start
- What You'll Find on WideTorah
- API Reference
- TypeScript Types
- API Endpoints
- Learn More About the Torah
- Also Available for Python
- WideHoly Developer Tools
- License
Install
npm install widetorahpnpm add widetorahyarn add widetorahQuick Start
import { WideTorah } from "widetorah";
const client = new WideTorah();
// Get Genesis 1:1 in JPS-1917 translation
const verse = await client.getVerse("genesis", 1, 1);
console.log(verse);
// { results: [{ reference: 'Genesis 1:1', text: 'In the beginning God created...', text_hebrew: 'בְּרֵאשִׁית בָּרָא אֱלֹהִים...' }] }
// Browse weekly Torah portions
const parashot = await client.listParashot("genesis");
console.log(parashot);
// { results: [{ name: 'Bereshit', hebrew_name: 'בראשית', reference: 'Genesis 1:1-6:8' }, ...] }
// Study Talmud -- Berakhot 2a
const daf = await client.getTalmudDaf("berakhot", 2, "a");
console.log(daf);
// { results: [{ tractate_slug: 'berakhot', number: 2, side: 'a', text_hebrew: '...', text_english: '...' }] }
// Search for verses about covenant
const results = await client.search("covenant", 5);
for (const v of results.results) {
console.log(`${v.reference}: ${v.text.slice(0, 80)}...`);
}What You'll Find on WideTorah
Tanakh Structure
The Hebrew Bible (Tanakh) is organized into three divisions containing 24 books. The acronym TaNaKh comes from the initial letters of its three sections: Torah (Teaching), Nevi'im (Prophets), and Ketuvim (Writings).
| Division | Hebrew | Books | Description | |----------|--------|-------|-------------| | Torah | תורה | 5 | The Five Books of Moses -- Genesis through Deuteronomy | | Nevi'im | נביאים | 8 | The Prophets -- Joshua, Judges, Samuel, Kings, Isaiah, Jeremiah, Ezekiel, Twelve | | Ketuvim | כתובים | 11 | The Writings -- Psalms, Proverbs, Job, Song of Songs, Ruth, Lamentations, Ecclesiastes, Esther, Daniel, Ezra-Nehemiah, Chronicles |
WideTorah serves 69,616 verses across 3 translations:
| Translation | Code | Language | Notes |
|-------------|------|----------|-------|
| Masoretic Hebrew | masoretic | Hebrew | Original consonantal text with vowel pointing (nikkud) |
| JPS 1917 | jps-1917 | English | Jewish Publication Society classic English translation |
| Koren | koren | English | Modern Koren Publishers Jerusalem translation |
import { WideTorah } from "widetorah";
const client = new WideTorah();
// List all books in the Torah (Pentateuch)
const torahBooks = await client.listBooks("torah");
for (const book of torahBooks.results) {
// Genesis (בראשית) -- 50 chapters, 1533 verses
console.log(`${book.name} (${book.hebrew_name}) -- ${book.chapter_count} chapters, ${book.verse_count} verses`);
}
// Get details for a specific book
const genesis = await client.getBook("genesis");
console.log(genesis.description);Weekly Parashot
The Torah is divided into 54 weekly reading portions (parashot, singular parashah), completing the entire Torah in an annual cycle. Each Shabbat, a designated portion is read publicly in synagogue from the Torah scroll. The annual reading cycle begins and ends on Simchat Torah. In leap years all 54 portions are read individually; in regular years some portions are combined (doubled) to fit the shorter calendar.
| Book | Parashot | Example | |------|----------|---------| | Genesis | 12 portions | Bereshit, Noach, Lech Lecha, Vayera... | | Exodus | 11 portions | Shemot, Va'era, Bo, Beshalach... | | Leviticus | 10 portions | Vayikra, Tzav, Shemini... | | Numbers | 10 portions | Bamidbar, Naso, Beha'alotcha... | | Deuteronomy | 11 portions | Devarim, Va'etchanan, Eikev... |
// Get details of the first parashah -- Bereshit (Genesis 1:1-6:8)
const bereshit = await client.getParashah("bereshit");
console.log(`${bereshit.name} (${bereshit.hebrew_name})`);
console.log(`Reference: ${bereshit.reference}`);
// Bereshit (בראשית)
// Reference: Genesis 1:1-6:8
// List all parashot for the book of Exodus
const exodusParashot = await client.listParashot("exodus");
for (const p of exodusParashot.results) {
console.log(`${p.name}: ${p.reference}`);
}Talmud & Mishnah
The Talmud (Babylonian Talmud, Talmud Bavli) is the central text of Rabbinic Judaism, consisting of the Mishnah (oral law codified c. 200 CE by Rabbi Yehudah HaNasi) and the Gemara (rabbinical analysis and commentary, c. 500 CE). It is organized into 6 orders (sedarim) containing 63 tractates with 2,121 daf pages.
| Seder | Hebrew | Tractates | Subject | |-------|--------|-----------|---------| | Zeraim | זרעים | 11 | Agriculture, blessings, tithes | | Moed | מועד | 12 | Shabbat, festivals, fast days | | Nashim | נשים | 7 | Marriage, divorce, vows | | Nezikin | נזיקין | 10 | Civil/criminal law, ethics (Avot) | | Kodashim | קדשים | 11 | Temple service, sacrifices, kashrut | | Tohorot | טהרות | 12 | Ritual purity and impurity |
The Talmud is studied page by page -- each folio (daf) has two sides (amud aleph/bet, or a/b). The worldwide Daf Yomi program completes the entire Talmud in a 7.5-year cycle, studying one daf per day (2,711 pages total).
// Browse tractates in Seder Moed (Festivals)
const moed = await client.listTractates("moed");
for (const t of moed.results) {
// Shabbat (שבת) -- 157 daf
console.log(`${t.name} (${t.hebrew_name}) -- ${t.daf_count} daf`);
}
// Read Talmud Berakhot 2a -- the very first page of the Talmud
const daf = await client.getTalmudDaf("berakhot", 2, "a");
// Contains text_hebrew, text_english, text_aramaic
// List Mishnah chapters for a tractate
const mishnah = await client.listMishnah("berakhot");
for (const ch of mishnah.results) {
console.log(`Chapter ${ch.chapter}: ${ch.text_english.slice(0, 60)}...`);
}Rashi Commentary
Rashi (Rabbi Shlomo Yitzchaki, 1040-1105 CE, Troyes, France) wrote the most widely studied commentary on the Torah and Talmud. His Torah commentary is printed alongside the biblical text in virtually every edition of the Chumash. Rashi's commentary is known for its conciseness, drawing on Midrash and Talmud to explain the plain meaning (peshat) of the text. WideTorah provides 3,901 Rashi commentary entries covering the Five Books of Moses, with both the original Hebrew and English translation.
// Get Rashi's commentary on Genesis chapter 1
const rashiGen1 = await client.listRashi("genesis", 1);
for (const entry of rashiGen1.results) {
// Rashi on Genesis 1:1-1:3: In the beginning -- The text does not intend to teach...
console.log(`Verses ${entry.verse_start}-${entry.verse_end}: ${entry.text_english.slice(0, 100)}...`);
}Jewish Holidays & Biblical Figures
WideTorah covers the major Jewish holidays with their Torah readings, haftarah portions, and Hebrew calendar dates:
| Holiday | Hebrew | Category | Torah Reading | |---------|--------|----------|---------------| | Rosh Hashanah | ראש השנה | Biblical | Genesis 21-22 | | Yom Kippur | יום כיפור | Biblical | Leviticus 16 | | Sukkot | סוכות | Biblical | Leviticus 22:26-23:44 | | Pesach | פסח | Biblical | Exodus 12:21-51 | | Shavuot | שבועות | Biblical | Exodus 19-20 | | Hanukkah | חנוכה | Rabbinic | Numbers 7 | | Purim | פורים | Rabbinic | Exodus 17:8-16 | | Tisha B'Av | תשעה באב | Rabbinic | Deuteronomy 4:25-40 |
Biblical figures span the entire narrative from the Patriarchs through the Second Temple period -- Abraham, Moses, David, Solomon, Elijah, Isaiah, Esther, Daniel, and more.
// List biblical holidays
const holidays = await client.listHolidays("biblical");
for (const h of holidays.results) {
console.log(`${h.name} (${h.hebrew_name}) -- ${h.torah_reading}`);
}
// Explore the patriarchs
const patriarchs = await client.listFigures("patriarchs");
for (const f of patriarchs.results) {
console.log(`${f.name} (${f.hebrew_name}) -- ${f.era}`);
}
// Get details of a specific figure
const moses = await client.getFigure("moses");
console.log(`${moses.name}: ${moses.description}`);API Reference
| Method | Description | Returns |
|--------|-------------|---------|
| listBooks(section?) | List 24 Tanakh books, filter by section | ApiResponse<Book> |
| getBook(slug) | Book details (name, hebrew_name, chapter/verse counts) | Book |
| listTranslations() | Available translations (JPS-1917, Koren, Masoretic) | ApiResponse<Translation> |
| listChapters(book?) | Chapters, filter by book slug | ApiResponse<Chapter> |
| getVerse(book, chapter, verse, translation?) | Specific verse with Hebrew and translation | ApiResponse<Verse> |
| search(query, limit?) | Full-text search across Torah verses | ApiResponse<Verse> |
| listParashot(book?) | 54 weekly Torah portions, filter by book | ApiResponse<Parashah> |
| getParashah(slug) | Parashah details with reference range | Parashah |
| listTractates(seder?) | 63 Talmud tractates, filter by seder | ApiResponse<Tractate> |
| getTalmudDaf(tractate, daf, side?) | Talmud folio page (Hebrew, English, Aramaic) | ApiResponse<TalmudDaf> |
| listMishnah(tractate?) | Mishnah chapters, filter by tractate | ApiResponse<MishnahChapter> |
| listRashi(book?, chapter?) | 3,901 Rashi commentaries, filter by book/chapter | ApiResponse<RashiEntry> |
| listHolidays(category?) | Jewish holidays, filter by category | ApiResponse<Holiday> |
| listFigures(era?) | Biblical figures, filter by era | ApiResponse<Figure> |
| getFigure(slug) | Figure details (name, hebrew_name, era, is_prophet) | Figure |
| listTopics() | Thematic topics (covenant, creation, law) | ApiResponse<Topic> |
| listGlossary() | Hebrew/Aramaic glossary terms | ApiResponse<GlossaryTerm> |
TypeScript Types
All API responses are fully typed. The main types:
import type {
ApiResponse, // Paginated wrapper { count, next, previous, results }
Book, // Tanakh book (name, hebrew_name, section, chapter_count, verse_count)
Verse, // Torah verse (text, text_hebrew, reference, book_slug)
Parashah, // Weekly portion (name, hebrew_name, reference, start/end chapter/verse)
Tractate, // Talmud tractate (name, hebrew_name, seder, daf_count)
TalmudDaf, // Folio page (text_hebrew, text_english, text_aramaic, number, side)
MishnahChapter,// Mishnah chapter (text_hebrew, text_english)
RashiEntry, // Commentary entry (text_hebrew, text_english, verse_start, verse_end)
Holiday, // Jewish holiday (name, hebrew_name, category, torah_reading)
Figure, // Biblical figure (name, hebrew_name, era, is_prophet)
Topic, // Thematic topic (name, description, verse_count)
GlossaryTerm, // Hebrew/Aramaic term (term, definition, hebrew_word)
Translation, // Bible translation (code, name, language)
Chapter, // Book chapter (number, verse_count, book_slug)
} from "widetorah";API Endpoints
All endpoints are under https://widetorah.com/api/v1/torah/:
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | /books/ | List Tanakh books (filter: section) |
| GET | /books/{slug}/ | Book details |
| GET | /translations/ | List translations |
| GET | /chapters/ | List chapters (filter: book__slug) |
| GET | /verses/ | List/search verses (filter: chapter__book__slug, translation__code, search) |
| GET | /parashot/ | List parashot (filter: book__slug) |
| GET | /parashot/{slug}/ | Parashah details |
| GET | /tractates/ | List tractates (filter: seder) |
| GET | /dapim/ | List Talmud daf (filter: tractate__slug, number, side) |
| GET | /mishnah/ | List Mishnah chapters (filter: tractate__slug) |
| GET | /rashi/ | List Rashi commentary (filter: book__slug, chapter) |
| GET | /holidays/ | List holidays (filter: category) |
| GET | /figures/ | List biblical figures (filter: era) |
| GET | /figures/{slug}/ | Figure details |
| GET | /topics/ | List topics |
| GET | /glossary/ | List glossary terms |
Example
curl -s "https://widetorah.com/api/v1/torah/books/genesis/"{
"id": 1,
"name": "Genesis",
"slug": "genesis",
"hebrew_name": "בראשית",
"number": 1,
"section": "torah",
"chapter_count": 50,
"verse_count": 1533,
"description": "The first book of the Torah..."
}Full API documentation at widetorah.com/developers/. OpenAPI 3.1.0 spec: widetorah.com/api/schema/.
Learn More About the Torah
- Scripture: Torah Books · Parashot · Translations
- Talmud: Tractates · Rashi Commentary
- Reference: Figures · Holidays · Glossary
- Tools: Developers
- API: OpenAPI Spec
Also Available for Python
pip install widetorahfrom widetorah import WideTorah
with WideTorah() as client:
verse = client.get_verse("genesis", 1, 1)
print(verse)WideHoly Developer Tools
| Package | PyPI | npm | Description | |---------|------|-----|-------------| | widetorah | PyPI | npm | Torah, Talmud, Rashi commentary -- widetorah.com | | widebible | PyPI | npm | Bible verses, cross-references, study tools -- widebible.com | | widequran | PyPI | npm | Quran, Hadith, Tafsir commentary -- widequran.com | | widesutra | PyPI | npm | Buddhist sutras, Tipitaka, Pali Canon -- widesutra.com | | widegita | PyPI | npm | Bhagavad Gita, Vedic philosophy -- widegita.com | | wideholy | PyPI | npm | Unified multi-religion scripture SDK -- wideholy.com |
Part of the WideHoly open-source scripture tools ecosystem.
License
MIT License -- see LICENSE for details.
