Tiny Cloudflare Worker that converts numbers to words for Russian (RUB) and English (USD/EUR).
Live endpoint: https://num2words.api.airat.top
GET /?number=1234.56&lang=ru¤cy=rub&caps=false
Parameters:
number(required) — number or decimal value.lang(optional, defaultru) —rufor Russian (rubles/kopecks),enfor English (USD/EUR).currency(optional) —rubfor Russian;usdoreurfor English. Defaults torubforlang=ruandusdforlang=en.caps(optional, defaultfalse) — return the result in uppercase.
Example:
curl 'https://num2words.api.airat.top/?number=1234.56'Response:
{
"number":"1234.56",
"lang":"ru",
"currency":"rub",
"result":"Одна тысяча двести тридцать четыре рубля 56 копеек",
"amount_text":"Одна тысяча двести тридцать четыре",
"currency_form":"рубля",
"coins_text":"56 копеек"
}Test in browser: https://num2words.api.airat.top/?number=1234.56
English example:
curl 'https://num2words.api.airat.top/?number=1234.56&lang=en¤cy=usd'Response:
{
"number":"1234.56",
"lang":"en",
"currency":"usd",
"result":"One thousand two hundred thirty four dollars 56 cents",
"amount_text":"One thousand two hundred thirty four",
"currency_form":"dollars",
"coins_text":"56 cents"
}Test in browser: https://num2words.api.airat.top/?number=1234.56&lang=en¤cy=usd
English EUR example:
curl 'https://num2words.api.airat.top/?number=1234.56&lang=en¤cy=eur'Response:
{
"number":"1234.56",
"lang":"en",
"currency":"eur",
"result":"One thousand two hundred thirty four euros 56 cents",
"amount_text":"One thousand two hundred thirty four",
"currency_form":"euros",
"coins_text":"56 cents"
}Send number as JSON, or raw text.
curl -X POST 'https://num2words.api.airat.top/' \
-H 'Content-Type: application/json' \
-d '{"number":"1234.56","lang":"ru","currency":"rub","caps":false}'Response:
{
"number":"1234.56",
"lang":"ru",
"currency":"rub",
"result":"Одна тысяча двести тридцать четыре рубля 56 копеек",
"amount_text":"Одна тысяча двести тридцать четыре",
"currency_form":"рубля",
"coins_text":"56 копеек"
}If number is missing or invalid, the API returns HTTP 400:
{"error":"Missing required parameter: number"}Unsupported language:
{"error":"Unsupported language"}Unsupported currency:
{"error":"Unsupported currency"}Negative values are supported and prefixed with "Минус" (Russian) or "Minus" (English).
CORS is enabled for all origins (*).
No analytics or request logs are collected by this project.
Health check endpoint:
GET /health
Response:
{"status":"ok"}Test in browser: https://num2words.api.airat.top/health
worker.js— Cloudflare Worker script.
Deploy with Wrangler (the repo already includes wrangler.toml):
npx wrangler deployIf you use Cloudflare Workers Builds (GitHub integration), set the deploy command to npx wrangler deploy and keep the root path at /.
To serve it on a custom domain, add the domain in Workers & Pages → Domains & Routes. Cloudflare will create the DNS record and issue SSL automatically.
This project is licensed under the MIT License - see the LICENSE file for details.
AiratTop
- Website: airat.top
- GitHub: @AiratTop
- Email: mail@airat.top
- Repository: num2words.api.airat.top