api
Rp Spelling

Documentation

Endpoint

GET https://api.i-as.dev/api/spelled/rupiah?amount={value}&lang={language}

Parameters

  • amount ({value}): The numeric amount you want to convert to a spelled-out format. This value can be provided in various formats, such as:

    • Plain number: 1234567
    • Number with periods as thousand separators: 1.234.567
  • lang ({language}): The language in which the amount should be spelled. It supports the following values:

    • id: Indonesian
    • en: English

Supported Number Ranges

The API supports numbers in the following ranges:

  • Quadrillion
  • Trillion
  • Billion
  • Million
  • Thousand
  • One hundred
  • Ten
  • Unit

Example Requests

1. Spelled in English

Convert 10000 Rupiah to spelled-out form in English.

GET https://api.i-as.dev/api/spelled/rupiah?amount=10000&lang=en

Response Example:

{
  "spelled": "Ten Thousand Rupiah"
}

2. Spelled in Indonesian

Convert 1.234.567 Rupiah to spelled-out form in Indonesian.

GET https://api.i-as.dev/api/spelled/rupiah?amount=1234567&lang=id

Response Example:

{
  "spelled": "Satu Juta Dua Ratus Tiga Puluh Empat Ribu Lima Ratus Enam Puluh Tujuh Rupiah"
}

Response

The API responds with a JSON object containing the spelled-out version of the Rupiah amount.

{
  "spelled": "<spelled-out amount>"
}

Where <spelled-out amount> is the Rupiah amount in words.


Error Handling

If the amount provided is not a valid number, the API will return an error:

{
  "error": "Invalid amount format"
}

Notes

  • Ensure that the amount parameter is a valid number, and if it includes separators (e.g., commas or periods), they should be correctly formatted.
  • The lang parameter should be set to either id (for Indonesian) or en (for English) based on your desired language.