The Structured Mishnah API

63 tractates · 525 chapter files · 4,476 cells · 6,953 markers · No key, no rate limit · CC BY 4.0

What this is

Most digital libraries serve the Mishnah as a linear sequence: tractate, chapter, mishnah one, mishnah two. This API serves it as it is set in HaMishnah k’Darka — every chapter as a two-dimensional table of labelled cells, together with the structural markings that show how the cells answer one another.

It is one small JSON file per chapter. Fetching Berakhot chapter 1 costs about 16 KB rather than the 16 MB of the complete database. There is no key to obtain, no registration and no rate limit. The licence is CC BY 4.0: use it for anything, including commercially, provided the work is credited.

It can also be used as a structural layer on its own. Every chapter carries the name that chapter has in Sefaria’s library, so the structure can be laid over any edition of the text.

The addresses

EndpointReturns
/Mishnah-New/api/index.jsonCounts, the six sedarim, and all 63 tractates with links.
/Mishnah-New/api/tractates.jsonThe 63 tractates as a flat list.
/Mishnah-New/api/markers.jsonThe eight marker types: colour, hex, definition, counts.
/Mishnah-New/api/schema.jsonJSON Schema defining every field of a chapter file.
/Mishnah-New/api/{tractate}.jsonOne tractate: its chapters, each with shape and counts.
/Mishnah-New/api/{tractate}/{chapter}.jsonOne chapter, complete.

A tractate’s address component is its English name in lower case, with hyphens for spaces: berakhot, bava-batra, avodah-zarah, rosh-hashanah, maaser-sheni, tevul-yom, moed-katan. The full list is in tractates.json.

Every file the API serves is listed on one page: all 63 tractate files and all 525 chapter files, grouped by order.

Example
/Mishnah-New/api/berakhot/1.jsonBerakhot, chapter 1
/Mishnah-New/api/bava-batra/10.jsonBava Batra, chapter 10
/Mishnah-New/api/avodah-zarah/5.jsonAvodah Zarah, chapter 5
/Mishnah-New/api/moed-katan/1.jsonMoed Katan, chapter 1

One irregularity. Sotah chapter 9 is set as two separate tables and is served as /sotah/9a.json and /sotah/9b.json. There is no /sotah/9.json. That is why 525 chapter files cover 524 chapters. Anything that walks chapter numbers should read the chapter list in the tractate file rather than counting.

What a chapter file contains

FieldContents
_creditDataset name, the credit line to reproduce, the licence and its URL, and the address this file is served from. It is repeated in every file so the licence travels with the data.
referenceWhere the chapter sits: tractate and seder in English and Hebrew, the chapter number, and sefaria_ref — the same chapter’s name in Sefaria’s library.
structureshape (the row widths), the number of rows, cells and subdivisions, and how many markers of each type the chapter carries.
rowsThe table itself. Each cell has a label (, ), a position giving row, column and how many columns it spans, the full Hebrew text, the runs that split that text into marked and unmarked spans, the markers gathered for searching, and any subdivisions.
source_pageThe chapter’s own page on this site.

shape is an array of row widths, not a phrase like “3 × 3”. Berakhot 1 is [[2,2],[4],[2,2]]: a three-row table whose first and last rows carry two cells each and whose middle row is a single cell spanning the full width. Reading it any other way loses the spanning cell.

The authoritative description of every field is schema.json, which is a JSON Schema and can be validated against directly.

The markers

A marker records a span of text inside a cell that is marked in the printed edition, and its type names the kind of connection. There are eight. They are rendered as coloured words rather than as a background highlight. The definitions below are reproduced from the Color Code guide.

ColourTypeGroupMarksInstances
Bluehorizontal1Horizontal linksDirect parallels between all segments of a horizontal thread.3,602
Tealhorizontal2Horizontal linksKey words that appear in both the first and second segments of a three-part horizontal thread.414
Maroonhorizontal3Horizontal linksKey words that appear in both the second and third segments of a three-part horizontal thread.400
Goldvertical1Vertical linksRepeating words or phrases within multiple segments of a warp thread.1,010
GreeninternalparallelVertical linksParallels between parts of a single segment.1,298
RoseclosureBoundary linksLinguistic connections between the first weft thread and the last, creating an envelope.128
Violetciasm1Boundary linksThe half chiasm created by the connection between the upper left segment and the lower right segment.54
Light Violetciasm2Boundary linksThe half chiasm created by the connection between the upper right segment and the lower left segment.47

Markers appear in 6,953 places across the 525 chapter files. Each cell gives them twice: inside runs, where the cell’s text is broken into consecutive marked and unmarked spans so it can be rendered with the markings intact, and again in markers, gathered together for searching. Concatenating every run reproduces the cell’s text exactly.

Reading it in Hebrew

The text is Hebrew and the tables read right to left: column 1 is the rightmost. A cell’s position gives its column number, and a renderer that places column 1 on the left will mirror the structure and reverse the argument the table is making.

Licence and citation

CC BY 4.0. The credit line to reproduce is carried in every file, in _credit.

Kline, Moshe. The Structured Mishnah Dataset. Chaver.com. https://chaver.com/Mishnah-New/api/

The complete database is also available as a single file, mishnah_db.json, for anyone who would rather hold all 525 chapters at once. The companion Torah dataset, which carries verse ranges without text so that any translation can be used, is at /torah-weave/data/.