2

Does anyone know of an API for Buddhist texts along the same lines as this one for the Bible. I do some spare time software projects and I would like to hook up to Buddhist text API just as part of playing around with some new technologies. Currently I'm using the Google Books API for it.

What I'm imaging is that one could make a web request to a URL such as http://buddhisttextapi/dhammapada/verse/12 and you would get back the 12th verse of the dhammapada in whatever translation. So for the technically minded I'm interested in some kind of REST API - preferably under active development or at least with some decent documentation.

Many Thanks

  • SuttaCentral, for example, uses URLs which look like https://suttacentral.net/en/sn5.3 ... would that count as an answer or are you looking for something other than that? – ChrisW Feb 5 '17 at 18:18
  • @ChrisW Thanks but not really. That returns HTML which is human readable. You want machine readable so XML or JSON. – Crab Bucket Feb 5 '17 at 19:41
  • 2
    To machine-read any web site, I use Html Agility Pack, which converts an HTML document to XML. Looking at the format of that linked Sutta Central page, for example, I would extract the contents of the article element (or section.sutta or div#text elements). – ChrisW Feb 5 '17 at 20:25
  • @ChrisW I didn't know HAP can convert HTML to XML. +1 – NuWin Feb 6 '17 at 3:23
  • @ChrisW true but I just want the JSON or XML directly. I don't want to use the Agility Pack or any HTML parsing (like what is offered in google books). I'm using node.js and express for the server. The agility pack is purely C# isn't it. But thanks for the thought. The answer below gives a good to be fair so I'm happy with that – Crab Bucket Feb 6 '17 at 9:15
2

SC has a API. E.g. : https://suttacentral.net/data?suttas=dn1,dn2

Also see: https://discourse.suttacentral.net/t/suttacentral-api-apps/1927/8

Also the data is in Github. E.g. https://github.com/suttacentral/suttacentral-data/blob/master/text/en/pi/su/an/an1/an1.21-40.html

Similarly you can download the whole Access to Insight website as files: http://www.accesstoinsight.org/tech/download/bulk.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.