islamic-network / alquran.cloud Goto Github PK
View Code? Open in Web Editor NEWWeb App that powers https://alquran.cloud
License: GNU General Public License v3.0
Web App that powers https://alquran.cloud
License: GNU General Public License v3.0
When I am trying to get data from your API your API response was blocked by CORS policy.
I think missing access key if yes please provide a link for getting access key or you can suggest me how do I use that
error slim show up when input wrong ayah (or non-numeric ayah).
example: https://alquran.cloud/ayah?reference=113%3A-2
get error like this:
The application could not run because of the following error:
Details
Type: GuzzleHttp\Exception\ClientException
Code: 400
Message: Client error: `GET http://api.alquran.cloud/ayah/113:eee/quran-uthmani` resulted in a `400 Bad Request` response: {"code":400,"status":"Bad Request","data":"Please specify a valid surah reference in the format Surah:Ayat (2:255)."}
File: /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
Line: 113
Trace
#0 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)
#5 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /var/www/vhosts/alquran.cloud/www/vendor/guzzlehttp/guzzle/src/Client.php(131): GuzzleHttp\Promise\Promise->wait()
#10 /var/www/vhosts/alquran.cloud/www/vendor/alquran/api-client/src/AlQuranCloud/ApiClient/Client.php(66): GuzzleHttp\Client->request('GET', 'http://api.alqu...', Array)
#11 /var/www/vhosts/alquran.cloud/www/vendor/alquran/api-client/src/AlQuranCloud/ApiClient/Client.php(180): AlQuranCloud\ApiClient\Client->connect('http://api.alqu...')
#12 /var/www/vhosts/alquran.cloud/www/routes/ayah.php(12): AlQuranCloud\ApiClient\Client->ayah('113:eee', 'quran-uthmani')
#13 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#14 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#15 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/Route.php(344): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#16 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(122): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#17 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/Route.php(316): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#18 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/App.php(476): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#19 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(122): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#20 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/App.php(370): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#21 /var/www/vhosts/alquran.cloud/www/vendor/slim/slim/Slim/App.php(295): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#22 /var/www/vhosts/alquran.cloud/www/www/index.php(15): Slim\App->run()
#23 {main}
Btw, thanks for the API. it's cool. keep good work :)
*ps: sorry for my bad english :D
Hi,
Is there an option to get audio in .wav format? The default is .mp3.
Asalaam alaykum
The ayah "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ" is not appearing separately when accessing http://api.alquran.cloud/surah/114/editions/quran-simple
but when accessing http://api.alquran.cloud/surah/1/editions/quran-simple
it appears separately, just wanted to be sure if is this intentional? because traditionally "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ" is an ayah not part of the surah. This effects the translation text, since the translation text only has text without the translation of "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ" Please correct me if I am wrong, and point me in the right direction. Thanks
Jazak Allah
Regards
Salman
As far as I know, l مْ + ب cause to convert م to ن, and in this places Quran notation should show small Mim, but There are numerous of places where this case (مْ + ب) doesn't happen but there is no Mim, I check original Quran text I didn't find them.
I'm listing below some of this issue:
رُكَّعًۭا سُجَّدًۭا يَبْتَغُونَ
تَبْصِرَةًۭ وَذِكْرَىٰ لِكُلِّ
أَءِذَا مِتْنَا وَكُنَّا تُرَابًۭا ۖ
إِنَّ ٱللَّهَ غَفُورٌۭ رَّحِيمٌ
ذَكَرٍۢ وَأُنثَىٰ وَجَعَلْنَٰكُمْ شُعُوبًۭا
إِنَّ أَكْرَمَكُمْ عِندَ ٱللَّهِ أَتْقَىٰكُمْ ۚ إِنَّ ٱللَّهَ عَلِيمٌ خَبِيرٌۭ
ٱجْتَنِبُوا۟ كَثِيرًۭا مِّنَ
ٱلظَّنِّ إِثْمٌۭ ۖ وَلَا
إِنَّ ٱللَّهَ تَوَّابٌۭ رَّحِيمٌۭ
And the list goes on...
Hey there i was using python to retrieve data from /quran
endpoint. I got this error:
Traceback (most recent call last):
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 710, in _error_catcher
yield
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 1077, in read_chunked
self._update_chunk_length()
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 1012, in _update_chunk_length
raise InvalidChunkLength(self, line) from None
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 937, in stream
yield from self.read_chunked(amt, decode_content=decode_content)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 1065, in read_chunked
with self._error_catcher():
File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/urllib3/response.py", line 727, in _error_catcher
raise ProtocolError(f"Connection broken: {e!r}", e) from e
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 14, in <module>
quran = client.fetch_quran()
File "/home/runner/holybooks/holybooks/client.py", line 22, in fetch_quran
return self.fetch_book(translation=translation)
File "/home/runner/holybooks/holybooks/http.py", line 78, in fetch_book
res = self.request(url)
File "/home/runner/holybooks/holybooks/http.py", line 51, in request
res = req(url)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/sessions.py", line 747, in send
r.content
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
File "/home/runner/holybooks/venv/lib/python3.10/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
Im using requests library. Might have a hint of why? I think it isnt because of the site.
Assalaamu 'Alaikum Wa Rahmatullaahee Wa Baraakatuh,
May Allaah reward you for the work that you've done. It's honestly amazing. I am building a website and I need access to the data in the Qur'aan. To use yours, is there a fee? Do I have to do anything to use the data?
Or can I just download the data and use it on my own? I don't intend to use it for commercial use.
Why not using IPFS network to distribute audio and media files instead of CDN.
benefits:
Im using this technique on my project QuranIPFS and its working perfectly.
Details:
Im hosting Ipfs node on digitalocean cloud as Backend, and using it to distribute 33 receiters audio files.
My website www.quranipfs.com
http://api.alquran.cloud/v1/ayah/262 - (Text) Returns Muhammad Asad's translation Ayat Al Kursi
http://api.alquran.cloud/v1/ayah/2:255 - (Text) Returns Muhammad Asad's translation Ayat Al Kursi
should be
http://api.alquran.cloud/v1/ayah/262/en.asad - (Text) Returns Muhammad Asad's translation Ayat Al Kursi http://api.alquran.cloud/v1/ayah/2:255/en.asad - (Text) Returns Muhammad Asad's translation Ayat Al Kursi
Assalam O Alikum
First of all thank you so much for the great service you are providing. May Allah provide the team with the best of rewards and then some.
For last couple of days, I am getting "net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)" error, when trying to access api with JavaScript fetch method. I am trying to fetch multiple translations within a loop and getting this error consistently on some of the translations as below:
Please note I am not getting this on all the translations but only few mentioned above. I am only using JavaScript and have also tired with jQuery.getJSON() method as well with same result.
Am I missing some setting or precaution? Or do I need to use any other fetch method like jQuery AJAX or XMLHTTPRequest?
Please let me know if you need more information or screenshots. Development is all local so I cannot share any URL for sample.
Thank you.
Al slamo alaikom my brothher
This is a good work may Allah bless you <3
i need the Quran Text you used here
maybe you have it in xml or json or excel or doc
In surah 2 ayah 113, for the English translation, I noticed that there is an unterminated quote. This is the ayah as shown on alquran.cloud:
---------------------------------------------------------------|
v
113. The Jews say: "The Christians have naught (to stand) upon; and the Christians say: "The Jews have naught (To stand) upon." Yet they (Profess to) study the (same) Book. Like unto their word is what those say who know not; but Allah will judge between them in their quarrel on the Day of Judgment.
This is what is should be instead:
---------------------------------------------------------------|
v
113. The Jews say: "The Christians have naught (to stand) upon;" and the Christians say: "The Jews have naught (To stand) upon." Yet they (Profess to) study the (same) Book. Like unto their word is what those say who know not; but Allah will judge between them in their quarrel on the Day of Judgment.
Can we have word by word breakdown segments of Surah Audios?
Example: https://api.quran.com/api/v4/chapter_recitations/1?segments=true&chapter=1
In Al-Quran api there is a wide range of reciters, it would be really helpful if you can provide the segments.
Al Salaamu Alaykum
I have realized that there are some Metas are not exists:
Izhar (Sakinah or Tanween pronounced clearly) and Izhar Shafawi (Mimm Sakinah pronounced clearly).
Also, some normal Madda meta are missing such as: "زُّجَاجَةُ" (see)[http://api.alquran.cloud/ayah/24:35/quran-tajweed]
What should I send you for adding new translation? Is there any guide? What file format? Is it enough pdf file format or txt,epub?
So developers / contributors can spin up a dev instance with one command.
Hi bro.
How to get a translation and a text/voice version in one request?
http://api.alquran.cloud/v1/ayah/1:1/ar.muhammadayyoub
I get the text/voice of the ayah with this link, but It's doesnt have any translations.
I need to combine the previous request with this:
http://api.alquran.cloud/v1/ayah/1:1/fa.khorramdel
Help me please,
Thanks.
Peace up you,
I've noticed an issue in API data in "quran-wordbyword" edition.
As you know in the Arabic words in the Quran we have a special character for ALEF which is (ٰ) we call it mini ALEF like "الرَّحْمٰنِ", "ذَٰلِكَ", "أُولَٰئِكَ".
Now the issue is mini ALEF in "quran-wordbyword" mustn't be ALEF with HAMZA instead just normal ALEF like this one "ا" but not this one "أ"
Examples:
"وَٲحِدَةٍ" must be "وَاحِدَةٍ" (surah name: An-Nisaa, from aya number:1)
"أَمْوَٲلِكُمْۚ" must be "أَمْوَالِكُمْۚ" (surah name: An-Nisaa, from aya number:2)
The original text:
يَـٰٓأَيُّهَا|O|67|75|985$ٱلنَّاسُ|mankind!|78|94|112$ٱتَّقُواْ|Fear|64|80|2492$رَبَّكُمُ|your Lord|82|98|190$ٱلَّذِى|the One Who|107|123|138$خَلَقَكُم|created you|100|116|191$مِّن|from|50|66|53$نَّفْسٍ|a soul|62|70|2507$وَٲحِدَةٍ|single|78|93|3658$وَخَلَقَ|and created|100|129|3659$مِنْهَا|from it|63|92|246$زَوْجَهَا|its mate|87|116|3660$وَبَثَّ|and dispersed|111|140|1427$مِنْهُمَا|from both of them|140|155|966$رِجَالاً كَثِيرًا|many men|138|150|3661$وَنِسَآءًۚ|and women.|100|125|3662$وَٱتَّقُواْ|And fear|78|103|467$ٱللَّهَ|Allah|53|78|184$ٱلَّذِى|(through) Whom|128|153|138$تَسَآءَلُونَ|you ask|103|116|3663$بِهِۦ|[with it]|74|83|204$وَٱلْأَرْحَامَۚ|and the wombs.|126|144|3664$إِنَّ|Indeed,|70|88|58$ٱللَّهَ|Allah|53|71|184$كَانَ|is|57|75|913$عَلَيْكُمْ|over you|78|96|416$رَقِيبًا|Ever-Watchful.|120|129|3665$
The original text:
وَءَاتُواْ|And give|83|96|440$ٱلْيَتَـٰمَىٰٓ|(to) the orphans|130|156|1925$أَمْوَٲلَهُمْۖ|their wealth,|104|130|2360$وَلَا|and (do) not|104|130|25$تَتَبَدَّلُواْ|exchange|83|109|3666$ٱلْخَبِيثَ|the bad|90|103|2417$بِٱلطَّيِّبِۖ|with the good,|117|124|3667$وَلَا|and (do) not|104|118|25$تَأْكُلُوٓاْ|consume|78|92|3268$أَمْوَٲلَهُمْ|their wealth|99|114|2360$إِلَىٰٓ|with|53|68|118$أَمْوَٲلِكُمْۚ|your wealth.|103|118|3587$إِنَّهُۥ|Indeed, it|84|91|396$كَانَ|is|57|180|913$حُوبًا|a sin|66|311|3668$كَبِيرًا|great.|72|194|2548$
Thanks for your efforts.
GET Ayah - Get an Ayah of the Quran
{{edition}} is an edition identifier. Example: en.asad for Muhammad Asad's english translation
http://api.alquran.cloud/v1/ayah/262 - (Text) Returns Muhammad Asad's translation Ayat Al Kursi
the link text is wrong here ^
http://api.alquran.cloud/v1/ayah/2:255 - (Text) Returns Muhammad Asad's translation Ayat Al Kursi
http://api.alquran.cloud/v1/ayah/262/ar.alafasy - (Audio) Returns Mishary Alafasy's recitation of the Ayat Al Kursi
http://api.alquran.cloud/v1/ayah/262 - (Text) Returns the Arabic text of Ayat Al Kursi
Hi.
Is there a plan to provide GraphQL API?
Thanks a lot for this awesome app.
Requests to the CDN to receive surah audio is not working with at least alafasy's audio files. Two days ago, it was working fine.
example request: https://cdn.alquran.cloud/media/audio/ayah/ar.alafasy/1
response: not found
hello
thanks for your great api
how can i get access to the direct path of every audio file in this api route?
http://api.alquran.cloud/v1/edition?format=audio&language=ar&type=versebyverse
i mean such a like this:
yoursite.com/albaqara.mp3
Apakah sudah tersedia untuk tranlation Indonesia? | any available translation to indonesia
Assalamu alaikum,
There is an issue in the Malayalam translation https://alquran.cloud/ayah?reference=8%3A64, it is showing wrong aya meaning
Issue details
Translation : "identifier":"ml.abdulhameed","language":"ml"
Sura : 8 Anfal
Aya : 64
It is showing translation of Sura 7: aya 64
for correct translation , please visit http://tanzil.net/#8:64 > select Malayalam in Translation box , see the be image below
Quran cloud API screen shot below
Please correct this ASAP, may I know how this kind of error occurs. how do we make sure that there is no more issue like this in the other sura translation?
As Salaam u Alaykum,
Beloved brothers, Jazakallahu Khairan wa ahsanal jazaa, May Allah Suhanahu Wa Ta'ala reward you abundantly for this project.
I was wondering if its possible to get the tajweed Quraan in indopak text, I am attempting to make a tajweed parser that's decoupled from html eg, given the Ayah have a meta field attached that has the start and end indices of the tajweed rule, I have replicated the current parser from the brother that ported it to JS into python did some tweaks and can generate the required meta.
Initially I was then hoping this could be used in other languages or apps to then get the ayah and then highlight programmatically in a language agnostic way. This can be achieved with the meta but only for the same text type which is uthmaani.
Here in South Africa the most common text is most similar to the Quraan-simple-enhanced, I thought I maybe able to use the meta to highlight the tajweed rules taken from Quraan-tajweed, however there are differences that render the extracted indices unaligned.
if there exists an indopak text decorated with the same tajweed tags as the tajweed-quraan I would be able to achieve what I'm trying to do, any advice or direction would be appreciated.
JazakAllah
Moved here from islamic-network/api.alquran.cloud#50
In my opinion, I think using an ayah instead of this text is much better for a big Quran website like this one. Someone might confuse this text as part of Quran.
جزاكم الله خيرا
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.