This API provides access to Bible data, including versions, books, chapters, and verses. You can fetch information about available Bible versions, books in the Bible, chapters for each book, and the text of specific verses from any version.
- Get Available Bible Versions: Retrieve a list of all available Bible versions.
- Get List of Books: Fetch a list of books in the Bible along with their names and codes (in local and English languages).
- Get Chapters for a Book: Get a list of chapters for a specified book.
- Get Verse Text: Retrieve the text of a specific verse from a given version, book, and chapter.
- URL:
/api/alkitab/v1/versions
- Method:
GET
- Response Example:
[ { "code": "tb", "name": "Terjemahan Baru" }, { "code": "ayt", "name": "Alkitab Yang Terbuka (AYT)" } ]
- URL:
/api/alkitab/v1/books
- Method:
GET
- Response Example:
[
{ "name": "Genesis", "code": "gen", "name_en": "Genesis", "code_en": "gen" },
{ "name": "Exodus", "code": "exod", "name_en": "Exodus", "code_en": "exod" }
]
- URL:
/api/alkitab/v1/{bookName}/chapter
- Method:
GET
- Path Parameter: bookName (e.g., "gen" for Genesis) Response Example:
[ 1, 2, 3, 4 ]
- URL:
/api/alkitab/v1/{version}/{bookName}/{chapter}/{verse}
- Method:
GET
- Path Parameters:
version
(e.g., "tb" for Terjemahan Baru)bookName
(e.g., "gen" for Genesis)chapter
(e.g., 1)verse
(e.g., 1) Response Example:
{ "verse": "In the beginning, God created the heavens and the earth." }
Requirements
- Node.js (>= 12.x)
- Express.js
- File system access to Bible data files (JSON)
Clone the repository:
git clone https://github.com/your-username/alkitab-api.git
cd alkitab-api
npm install
Start the server:
npm start
The server will start on http://localhost:3000.
- 404 Not Found: If a resource (e.g., book, chapter, or verse) is not found.
- 400 Bad Request: If required parameters are missing or invalid.
This project is licensed under the MIT License - see the LICENSE file for details.