Need help with bible_api?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

seven1m
297 Stars 59 Forks MIT License 95 Commits 5 Opened issues

Description

Ruby web app that serves JSON API for open and public domain bibles

Services available

!
?

Need anything else?

Contributors list

# 14,899
Elixir
Bootstr...
admin-p...
ruby-on...
72 commits
# 264,168
JavaScr...
HTML
Rails
SQLite
6 commits
# 371,098
CSS
JavaScr...
Shell
MySQL
1 commit
# 247,791
HTML
Objecti...
Shell
task-ma...
1 commit
# 568,077
HTML
Ruby
podcast...
threat-...
1 commit

bible_api

This is a Ruby web app that serves a JSON API for public domain and open bible translations.

Using It

This app is served from bible-api.com, which anyone can use.

With Curl and JQ

→ curl -s https://bible-api.com/John+3:16 | jq
{
  "reference": "John 3:16",
  "verses": [
    {
      "book_id": "JHN",
      "book_name": "John",
      "chapter": 3,
      "verse": 16,
      "text": "\nFor God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life.\n\n"
    }
  ],
  "text": "\nFor God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life.\n\n",
  "translation_id": "web",
  "translation_name": "World English Bible",
  "translation_note": "Public Domain"
}

With Ruby

→ ruby -r open-uri -r json -r pp -e "pp JSON.parse(URI.open('https://bible-api.com/John+3:16').read)"
{"reference"=>"John 3:16",
 "verses"=>
  [{"book_id"=>"JHN",
    "book_name"=>"John",
    "chapter"=>3,
    "verse"=>16,
    "text"=>
     "\n" +
     "For God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life.\n" +
     "\n"}],
 "text"=>
  "\n" +
  "For God so loved the world, that he gave his one and only Son, that whoever believes in him should not perish, but have eternal life.\n" +
  "\n",
 "translation_id"=>"web",
 "translation_name"=>"World English Bible",
 "translation_note"=>"Public Domain"}

Hosting it Yourself

If you want to host this application yourself, you'll need a Linux server with Ruby and MySQL (or MariaDB) installed. Follow the steps below:

  1. Clone the repo:
   git clone https://github.com/seven1m/bible_api
   cd bible_api
   git submodule update --init
  1. Install the dependencies:
   gem install bundler
   bundle config --local deployment true # optional, but prefered on a server
   bundle install
  1. Create the database and import the translations:
   mysql -uroot -e "create database bible_api; grant all on bible_api.* to [email protected] identified by 'password';"
   export BIBLE_API_DB="mysql2://user:[email protected]/bible_api"
   bundle exec ruby import.rb
  1. Host the app with Passenger

... or run

bundle exec ruby app.rb
if you are just testing.

Copyright

Copyright Tim Morgan. Licensed under The MIT License (MIT). See LICENSE for more info.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.