Book of Mormon API

Discussions around Mobile Development
donjuanica
New Member
Posts: 3
Joined: Tue Oct 06, 2015 11:06 pm

Book of Mormon API

Postby donjuanica » Tue Oct 06, 2015 11:12 pm

I thought I'd share this with the group. I've seen a lot of posts about an open BoM API for use in web/mobile apps. I put together a quick NodeJS + Express + MongoDB API that will give you access to the BoM verses. I imported the data from the Book of Mormon found in the Gutenberg Library.

For now this is running in RedHat openshift on the free tier. If it gets too much traffic I suppose they'll contact me and complain, but for now I'd appreciate any testing/feedback.

You can access the API at:

http://bomapi-happycloud.rhcloud.com/v1/verses

The root URL will return 100 verses from the BoM but you can specify any granularity you want (all other endpoints will return a max of 10 verses):

http://bomapi-happycloud.rhcloud.com/v1 ... ter/:verse

e.g.

http://bomapi-happycloud.rhcloud.com/v1/verses/Moroni
http://bomapi-happycloud.rhcloud.com/v1 ... /Moroni/10
http://bomapi-happycloud.rhcloud.com/v1 ... oroni/10/4

Have fun.

samtwarnick
New Member
Posts: 2
Joined: Thu Oct 08, 2015 12:48 pm

Re: Book of Mormon API

Postby samtwarnick » Thu Oct 08, 2015 1:31 pm

This looks great! Is there any way to request multiple verses at once ( i.e. http://bomapi-happycloud.rhcloud.com/v1 ... oni/10/3-5 ) or get all verses in a chapter? Thanks

donjuanica
New Member
Posts: 3
Joined: Tue Oct 06, 2015 11:06 pm

Re: Book of Mormon API

Postby donjuanica » Sat Oct 10, 2015 12:33 pm

You can get multiple verses by leaving off the last segment of the API path. Right now the API limits to returning a max of 10 verses, but I may remove that restriction at some point.

To get up to 10 verses from Moroni 10 you would use:

/v1/verses/Moroni/10

To get the first 10 verses of Moroni You would use:

/v1/verses/Moroni

I kind of like your idea to specify a range of verses as the last part of the path:

/v1/verses/Moroni/10/3-5 - right now that doesn't work but I think I'll add support for it.

Thanks

donjuanica
New Member
Posts: 3
Joined: Tue Oct 06, 2015 11:06 pm

Re: Book of Mormon API

Postby donjuanica » Sat Oct 10, 2015 1:05 pm

I added the ability to specify ranges of verses:

/v1/verses/Moroni/10/3/5 would give you Moroni 10:3-5

So instead of passing a range as the final path param, you add an additional path param to define the range:

/v1/verses/:book/:chapter/:start_verse/:end_verse

HTH

samtwarnick
New Member
Posts: 2
Joined: Thu Oct 08, 2015 12:48 pm

Re: Book of Mormon API

Postby samtwarnick » Tue Oct 20, 2015 4:48 pm

Just saw that you updated this. Thanks for adding the ability to get more than one verse. I'll play around with it some more.


Return to “Mobile Development”

Who is online

Users browsing this forum: No registered users and 1 guest