Do you need general information about a sutta, including blurb, difficulty, and a list of all the translations available on SuttaCentral? Then the SuttaPlex API is for you!
[ All API documentation | General discussion on SC APIs ]
What is a SuttaPlex?
A SuttaPlex page is one where all of the basic data about a sutta is presented on a single page. For example, https://suttacentral.net/dn1 The exact presentation depends on what a website user’s language setting is:
We also find these SuttaPlex “cards” as a list when displaying a chapter. Sometimes the cards are “compact”:
The SuttaPlex API gives all the information on these cards other than the parallel data.
Requesting SuttaPlex data
Pattern:
https://suttacentral.net/api/suttaplex/<uid>?language=<2 letter language code>
Example URL: https://suttacentral.net/api/suttaplex/dn1?language=de
Language parameter is optional
Returns:
acronym
:
A string with the human readable/pretty version of the citation. e.g. DN 1 (as opposed to the uid)
volpages:
A string with a list of all PTS volume and page numbers for this sutta. E.g.:
" PTS 1.1, PTS 1.2, PTS 1.3, PTS 1.4, PTS 1.5, PTS 1.6, PTS 1.7, PTS 1.8, PTS 1.9, PTS 1.10,
etc.
alt_volpages:
???
uid:
A string with the unique ID for this sutta, e.g. “dn1”. Always lowercase, no spaces, ascii hyphens only.
blurb:
A short summary for the sutta. This data is located here on github.
difficulty: {
An object with two key/value pairs. E.g.:
{
"name": "advanced",
"level": 3
}
name
can be “beginner”, “intermediate”, or “advanced”. Level is a number between 1 and 3.
original_title:
A string with the title in the original language, e.g. “Brahmajālasutta”. These are found here on github.
root_lang:
A string with the language code of the original language, e.g. “pli”.
root_lang_name:
A string with the full name of the original language, e.g. “Pāli”.
type:
A string with values “leaf” or “branch”
translated_title:
This is the site wide title (not a specific translator’s title of the sutta). By default it is English unless a language is specified in the request, e.g. api/suttaplex/dn1?language=de
translations: [
This is an array of objects for the root text and all existing translations on the site in all languages.
Root text example:
{
"lang": "pli",
"lang_name": "Pāli",
"is_root": true,
"author": "Mahāsaṅgīti Tipiṭaka Buddhavasse 2500",
"author_short": "ms",
"author_uid": "ms",
"publication_date": null,
"id": "dn1_root-pli-ms",
"segmented": true,
"title": null,
"volpage": null,
"has_comment": false
},
Translation example:
{
"lang": "de",
"lang_name": "Deutsch",
"is_root": false,
"author": "Sabbamitta",
"author_short": "sabbamitta",
"author_uid": "sabbamitta",
"publication_date": null,
"id": "dn1_translation-de-sabbamitta",
"segmented": true,
"title": "Das göttliche Netz ",
"volpage": null,
"has_comment": true
},
parallel_count:
An integer with the number of parallels for this sutta.
biblio:
This type is a string, representing the uid of a book
priority_author_uid
A string with the unique ID for the translator whose translation appears first in the list.
verseNo:
For suttas in collections that are primarily verses, this is a string that lists the verses in that sutta. E.g. for Snp1.1 it is "Verse 1–17"
. Uses an en-dash (–
) for ranges.
Errors
If there is no matching text, the following will be returned:
[
{
"acronym": null,
"volpages": null,
"alt_volpages": null,
"uid": null,
"blurb": null,
"difficulty": null,
"original_title": null,
"root_lang": null,
"root_lang_name": null,
"type": null,
"translated_title": null,
"translations": [],
"parallel_count": 0,
"biblio": null,
"priority_author_uid": null,
"verseNo": null
}
]
Parameters
The language=de
, etc., parameter only affects the translated_title
and blurb
results.
Note: This is post is a wiki. Please feel free to click the edit button below to make changes. Feel free to reply to the post if you have questions.