GlobalQuranBLOG Read the Quran

Developers ·

Build a Quran app with AI: Claude, ChatGPT or Cursor and a free API

You no longer need to be an experienced programmer to make a Quran app for your mosque, your school or your family. An AI coding assistant such as Claude, ChatGPT, Cursor or GitHub Copilot can write it for you, if it knows where to get the Quran from and how to play it correctly. Global Quran's AI instructions tell it exactly that, and the Global Quran API provides the text, 96 translations and the recitations, free.

Build a Quran app with AI: an API request for ayah 262 and the resulting verse card for Ayat al-Kursi with tajweed colours

Copy the AI instructions Get a free API key

Three steps

  1. Get a free API key at docs.globalquran.com. Say what you are building (website, mobile app or server) and you get the right kind of key.
  2. Copy the AI instructions. The AI instructions page has a "Copy All Sections" button. It covers the API addresses, how to build the audio links, the Bismillah rules, the user interface, saving settings, performance and accessibility.
  3. Paste them into your AI assistant with your key and say what you want.

A first request to your AI

Using the Global Quran instructions above and my API key YOUR_KEY, build a single-page Quran reader: a list of the 114 surahs, the Arabic with the Saheeh International translation under each verse, a reciter choice, and a Play button that recites verse by verse and highlights the verse being read. Remember my last surah and reciter.

Then ask for more, one step at a time: night mode, a bigger text option, an Urdu translation beside the English, repeat for memorising, a page for each juz.

What the instructions get right for you

These are the places where home-made Quran apps usually go wrong, and the instructions explain each:

  • Audio files are numbered through the whole Quran (1 to 6236), not by surah. Ayat al-Kursi, 2:255, is file 262: https://audio.globalquran.com/ar.alafasy/mp3/128kbs/262.mp3.
  • The Bismillah: it is the first verse of Al-Fatihah; At-Tawbah has none; every other surah is preceded by it when you play from the top, but not when you start from a chosen verse.
  • Several editions in one call: /v1/surah/1/quran-simple|en.sahih returns the Arabic and the translation together.
  • Keys in web pages: a website key only works from your address, and private keys belong on a server.
  • Caching: lists rarely change, and a whole surah at once is better than verse by verse.

Rather not build at all?

Before you publish

Credit the translators whose text you show, check a few verses against globalquran.com, and read the API's fair-use notes. Building a commercial app? Talk to us first.

Keep reading