https://github.com/octabytes/quran-api
NodeJs Quran API
https://github.com/octabytes/quran-api
Last synced: 2 months ago
JSON representation
NodeJs Quran API
- Host: GitHub
- URL: https://github.com/octabytes/quran-api
- Owner: octabytes
- License: apache-2.0
- Created: 2021-02-11T05:52:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-19T04:31:14.000Z (over 5 years ago)
- Last Synced: 2025-07-27T23:46:36.808Z (11 months ago)
- Language: JavaScript
- Size: 2.21 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# quran-api
NodeJs Quran API
# Run Local
First of all you should have to install the Firebase CLI
`npm install -g firebase-tools`
Clone repository
`git clone https://github.com/octabytes/quran-api.git`
Install require packages
`npm install`
Move into firebase dir
`cd quran-api/firebase` This is not upto date
`cd ../hadith-api/firebase`
Run local Firestore
`firebase emulators:start --only firestore --import=./cache`
Your emulators start running on [http://localhost:4000/firestore](http://localhost:4000/firestore)
Run API
`export FIRESTORE_EMULATOR_HOST="localhost:8080"`
`npm start` or watch `npm run watch`
Open in browser
[http://localhost:5000/v1/welcome](http://localhost:5000/v1/welcome)
# Documentation
1. Get `Ayah` by `id`
Id made with **surah number** and **ayah number** for example `1-2` which means
first surah and second ayah.
`http://localhost:5000/v1/ayah/:id`
2. Get `Ayah` by Ayah number
`http://localhost:5000/v1/ayah/number/:number`
3. Get list of `Ayah` by surah number
`http://localhost:5000/v1/surah/:number?`
4. Get surah list
`http://localhost:5000/v1/surah/list`
### Paginate data
Using Cursor
`http://localhost:5000/v1/ayah/surah/?cursor=query_cursor`
Using Offset
`http://localhost:5000/v1/ayah/surah/1?offset=30`
### Max result
By default max results are 30
`http://localhost:5000/v1/ayah/surah/1?maxResult=5`
### Direction
Direction is used to get Ayahs from start or from end, for example get surah 2 first 5 ayahs
`http://localhost:5000/v1/ayah/surah/1?direction=start`