https://github.com/islamic-network/alquran-api-client-node
https://github.com/islamic-network/alquran-api-client-node
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/islamic-network/alquran-api-client-node
- Owner: islamic-network
- License: gpl-3.0
- Created: 2020-05-11T07:19:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-10T21:27:23.000Z (over 2 years ago)
- Last Synced: 2023-12-10T22:28:52.524Z (over 2 years ago)
- Language: TypeScript
- Size: 138 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ
[](https://github.com/islamic-network/alquran-api-client-node/releases)
[](https://github.com/islamic-network/alquran-api-client-node/blob/master/LICENSE.md)
### Node.js Client for AlQuran API (TypeScript compatible)
This is a Node.js API client written in TypeScript that uses the rest API at alquran.cloud to fetch Quran Ayahs, Surahs Juzs or the entire Quran.
### Work in Progress!
### Installation
The API Client is a composer package. To use it, you need to run the following:
```
yarn add alquran-api-client
```
or
```
npm i --save alquran-api-client
```
### Usage
#### Instantiate the Client
```
import AlQuranApiClientNode from 'alquran-api-client';
```
#### Getting an Ayah
To get a single ayah, use:
```
AlQuranApiClientNode.getAyah('1').then((ayah: Ayah) => {
// "ayah" will be Ayah 1
});
AlQuranApiClientNode.getAyah(765, 'en.pickthall').then((ayah: Ayah) => {
// "ayah" will be Ayah 765 with Marmaduke Pickthall's English translation
});
```
#### Getting a Surah
To get a surah, use:
```
AlQuranApiClientNode.getSurah(36).then((surah: Surah) => {
// "surah" will be Surah Yaseen
});
AlQuranApiClientNode.getSurah(36, 'en.saad').then((surah: Surah) => {
// "surah" will be Surah Yaseen with Muhammad Asad's English translation
});
```
#### Getting a Juz
To get a juz, use:
```
AlQuranApiClientNode.getJuz(30).then((juz: Juz) => {
// "juz" will be Juz 30 (there are only 30!)
});
```
### Getting Editions, Searching and more...
Please see all available API methods in the [examples directory](/examples).
---
### Authors and Contributors
Meezaan-ud-Din Abdu Dhil-Jalali Wal-Ikram (@meezaan). [meezaan@islamic.network](meezaan@islamic.network)
iSecNew10 OpenSource (@iSecNew10). [opensource@isecnew10.email](opensource@isecnew10.email)
### Support or Contact
For support, please visit http://alquran.cloud/api or http://alquran.cloud/contact.
----
#### License: GPL-3.0