Many Muslim apps want to show a short tafseer (commentary) next to each ayah, and let the reader switch language. In this post we build a small Flutter screen that does exactly that, using the JSON shape of the Tafseer API from QuraniAPI .
The JSON shape
The Tafseer API returns Surah Al-Fatiha with ayah-by-ayah commentary in 9 languages (en, ur, fr, de, tr, ms, ru, zh-CN, ja). Trimmed down, the response looks like this (values shortened):
{ "title" : "Comprehensive Tafseer" , "is_free" : false , "surah" : { "number" : 1 , "name" : "Al-Fatiha" , "arabic" : "..." } , "items" : [ { "ayah" : 1 , "arabic" : "..." , "translations" : { "en" : "..." , "ur" : "..." , "fr" : "..." , "de" : "..." } } ] }
Enter fullscreen mode
Exit fullscreen mode
Endpoint (needs an API key — see how to get access ):
https://quranicapi.online/api/serve.php?slug=tafseer&lang=all
Enter fullscreen mode
Exit fullscreen mode
The full endpoint reference is in the docs .
Dart models
class TafseerItem { final int ayah ; final String…