Alfanous-team / alfanous

Alfanous is an Arabic search engine API provides the simple and advanced search in Quran , more features and many interfaces...
http://www.alfanous.org/
GNU Affero General Public License v3.0
263 stars 89 forks source link

How can I directly search by surah and aya number #522

Closed arfan closed 3 years ago

arfan commented 3 years ago

How can I directly search by sura and aya number? I am trying to do it like this https://www.alfanous.org/api/search?sura_id=1&aya_id=1 but it gives no result.

Regards

sneetsher commented 3 years ago

Welcome @arfan

Those keywords in this table are query fields, not API GET/URL parameters.

So your search?query=sura_id:1+aya_id:1 , the same as you type it in Alfanous website search box, ie. sura_id:1+aya_id:1

However in URL, it should be encoded:

Let me, know when you try them, if that what you wanted.

arfan commented 3 years ago

Thank you. The url works.

sneetsher commented 3 years ago

You welcome.

Kentoseth commented 2 years ago

This example does not work on the JOS2 version of the API.

Same example as above results in entire Surah fati7a being shown.

How do we make API queries using this URL:

https://www.alfanous.org/jos2?

?

@sneetsher

sneetsher commented 2 years ago

@Kentoseth It does accept same query format. JOS2 is at an old API version and it is kept for compatibility. If you are developing something new, recommend sticking to edge version https://www.alfanous.org/api/

https://www.alfanous.org/jos2/search?query=sura_id%3A1%2Baya_id%3A1

By the way, it does not return same schema and it has fewer meta data.