Asmaul Husna API — Haikel Ilham HakimSkip to content

Project archive

Asmaul Husna API

Haikel, 3 min read - Preview Source

بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ

I kept running into the same thing across Islamic applications: a hardcoded JSON file of the 99 Names of Allah. Copied from some blog, pasted into the project, rarely touched again. When the transliteration had an error or the Arabic was missing a character, every app that copied that file inherited the same defect. There was no single source of truth — just fragmented copies propagating mistakes.

I built this API to be that source. One endpoint, consistent structure: Arabic script, Latin transliteration, Indonesian meaning, standard ordering. Free, no authentication, hosted on Vercel so it loads quickly from Indonesian locations. If someone is building an Islamic app and needs Asma’ul Husna, they can hit this instead of bundling a stale JSON file.

I wrote it in Go with Fiber. At the time I was looking to get more comfortable with Go, and a small focused API seemed like the right size of project for that. Fiber keeps allocations low compared to the standard library, which matters at steady traffic. I added Prometheus and Grafana for observability — request counts, latency percentiles, error rates. Even a free API should tell you when something is wrong before users do.

Endpoints

EndpointMethodDescription
/GETGet info about the API
/api/allGETGet all Asma’ul Husna
/api/:urutanGETGet specific Asma’ul Husna based on urutan
/api/latin/:latinGETGet specific Asma’ul Husna based on latin

Response Example

Get all Asma’ul Husna

Request:

ts
fetch("https://asmaul-husna-api.vercel.app/api/all")
  .then((res) => res.json())
  .then((result) => console.log(result));

Response:

json
{
  "statusCode": 200,
  "total": 99,
  "data": [
    {
      "urutan": 1,
      "latin": "Ar Rahman",
      "arab": "الرحمن",
      "arti": "Yang Maha Pengasih"
    },
    {
      "urutan": 2,
      "latin": "Ar Rahiim",
      "arab": "الرحيم",
      "arti": "Yang Maha Penyayang"
    },
    {
      "urutan": 3,
      "latin": "Al Malik",
      "arab": "الملك",
      "arti": "Yang Maha Merajai / Memerintah"
    },
    ....
  ]
}

With page and limit

ts
// REST
fetch("https://asmaul-husna-api.vercel.app/api/all?page=2&limit=20")
  .then((res) => res.json())
  .then((result) => console.log(result));

Note: The page and limit query are optional. But if you want to use the page query, you must use the limit query as well.

Response:

json
{
  "statusCode": 200,
  "total": 20,
  "data": [
    {
      "urutan": 21,
      "latin": "Al Baasith",
      "arab": "الباسط",
      "arti": "Yang Maha Melapangkan(makhluknya)"
    },
    {
      "urutan": 22,
      "latin": "Al Khaafidh",
      "arab": "الخافض",
      "arti": "Yang Maha Merendahkan(makhluknya)"
    },
    {
      "urutan": 23,
      "latin": "Ar Raafi '",
      "arab": "الرافع",
      "arti": "Yang Maha Meninggikan(makhluknya)"
    },
    ...
  ]
}

Get specific Asma’ul Husna based on urutan

Request:

ts
fetch("https://asmaul-husna-api.vercel.app/api/1")
  .then((res) => res.json())
  .then((result) => console.log(result));

Response:

json
{
  "statusCode": 200,
  "total": 1,
  "data": {
    "urutan": 1,
    "latin": "Ar Rahman",
    "arab": "الرحمن",
    "arti": "Yang Maha Pengasih"
  }
}

Get specific Asma’ul Husna based on latin

Note: the latin can be lowercase or uppercase.

Request:

ts
fetch("https://asmaul-husna-api.vercel.app/api/latin/ar-rahman")
  .then((res) => res.json())
  .then((result) => console.log(result));

Response:

json
{
  "statusCode": 200,
  "total": 1,
  "data": {
    "urutan": 1,
    "latin": "Ar Rahman",
    "arab": "الرحمن",
    "arti": "Yang Maha Pengasih"
  }
}

Tech Stack

  • Go
  • Fiber
  • Swagger for API Documentation
  • Prometheus and Grafana for API monitoring

Credits