Desh API: one free API for Bangladesh's everyday data
Every Bangladeshi developer has rebuilt the same things: a division → district → upazila dropdown from an old spreadsheet, "taka in words" for an invoice, a Bijoy-to-Unicode converter, a phone number regex, a bank-branch picker, an income-tax calculator. I've built most of them more than once for client projects.
So I put them behind one clean, documented API that anyone can use for free: deshapi.riadul.com.
No sign-up, no API key, English and Bangla names, and the source of every fact in every response.
🚀 What's inside
15 modules and 68 endpoints so far:
| Module | What it gives you |
|---|---|
| Geo | 8 divisions, 64 districts, 495 upazilas, 4,540 unions, 1,349 post offices; bilingual search (old spellings too, like "Comilla"); nearest area to a GPS point |
| Bangla toolkit | Numbers and taka in words, Latin ⇄ Bangla digits, lakh/crore formatting (১২,৫০,০০০), Bangla calendar dates, ordinals, slugs, Avro Phonetic |
| Convert | Bijoy (SutonnyMJ) ⇄ Unicode |
| Phone & validators | Mobile numbers (with original operator), and format checks for NID, vehicle plates, e-TIN, VAT BIN, postcodes and bank routing numbers |
| Banks | All 61 banks and 11,533 branches from Bangladesh Bank, and "which branch is this routing number?" |
| Education | All 181 universities listed by the University Grants Commission |
| Holidays | The official 2027 holiday list, "is this a holiday?" and working-day counts |
| Finance | Income tax under the Finance Act 2026 (every taxpayer category, salary exemption, investment rebate), VAT, loan EMI, DPS, gratuity |
| Gold & zakat | Today's BAJUS gold and silver prices per gram and per vori, and zakat with the nisab from those prices |
| Market prices | Today's TCB retail prices of 60 essentials in Dhaka, with week/month/year comparisons, and government fuel prices |
| Land, hotlines, mock data, fun | Katha/bigha/decimal conversion, national hotlines, synthetic test people, traditional proverbs and riddles |
⚡ Try it in 30 seconds
Paste any of these into a terminal or a browser:
# A district, in English and Bangla
curl https://deshapi.riadul.com/v1/districts/cumilla
# Taka in words for an invoice
curl 'https://deshapi.riadul.com/v1/bangla/taka-in-words?amount=1250.50'
# → "এক হাজার দুইশত পঞ্চাশ টাকা পঞ্চাশ পয়সা"
# Which branch is this routing number?
curl https://deshapi.riadul.com/v1/routing/010130065
# → Agrani Bank, Kachua Bazar branch, Kachua, Chandpur
# Income tax on an 18 lakh salary (Finance Act 2026)
curl 'https://deshapi.riadul.com/v1/finance/income-tax?income=1800000&employment_income=1800000'
# Today's edible oil prices in Dhaka (TCB)
curl 'https://deshapi.riadul.com/v1/market/prices?category=edible-oil'The interactive docs list every endpoint with a "Try it" button, and the landing page has a built-in playground.
🔎 Every fact has a source
Every response looks the same, and meta.source says where the data came from:
{ "success": true, "data": { … }, "meta": { "source": "…", "last_updated": "2026-11-12", "version": "v1" } }I tried hard to use the official source for everything, and to be honest when I couldn't:
- Tax rules are checked against the Finance Act 2026 itself (Act No. 96 of 2026) on bdlaws, not against news summaries, which disagreed with each other. One figure (the salary exemption cap) looked wrong in the official English translation of the Income Tax Act, until I found that the translation was only consolidated up to 2024; the 2026 Act that changed it is cited instead.
- Banks and branches come from Bangladesh Bank's own branch list; universities from the UGC; holidays from the government notification; gold from BAJUS; market prices from TCB.
- If reliable sources disagree, the fact is left out rather than guessed. Where an official source is English-only (bank branches, most universities), there's no Bangla name rather than an invented spelling.
🔐 Privacy by design
- Validators (NID, phone, plates, TIN, BIN, routing numbers) check formats only. Nothing is looked up, stored or logged; logs record the route pattern, never the value.
- The calculators take numbers, never identifiers.
- Mock data is synthetic. Names are paired within one naming tradition so they look believable, but religion is never returned.
🏗️ How it's built
- TypeScript + Hono, with Zod schemas that both validate requests and generate the OpenAPI docs, so the docs can't drift from the code.
- Cloudflare Workers on the free tier: fast everywhere, no servers. Reference data is plain JSON in the repo, validated in CI, so anyone can fix a fact with a pull request.
- Spec-first with GitHub Spec Kit: every module has a spec, research notes, a plan and tasks before code, and tests are written first. 780 tests run inside the Workers runtime.
- Live data without a database: gold and market prices are read on request and cached at the
edge. TCB publishes its prices as Excel files, so the Worker includes a tiny
.xlsxreader instead of a heavy library.
🧗 What Bangladeshi data sources taught me
- Captchas everywhere. Several official sites answer scripts with "What code is in the image?", so some files had to be downloaded by hand.
- Encodings. Law pages served as UTF-16, gazette PDFs in legacy Bijoy fonts, and the same Bangla letter (য়) written two different ways in one spreadsheet.
- Hidden structure. Bank routing numbers carry a check digit, but I couldn't find it documented. Solving for it from 10,032 published numbers gave weights 5, 7, 1; every number passes, so the API now catches typos and repairs numbers that lost their leading zero in spreadsheets.
- Some sources refuse foreign traffic. Servers in US or European clouds got blocked by a
couple of sites, so live prices keep a last good copy (at most 7 days old) and say so in the
response with
freshness: "last_known". A wrong price is never served.
🗺️ What's next, and how you can help
Next on the roadmap: exchange rates, the bank-holiday calendar, prayer times and Ramadan schedules, and SDKs for JavaScript, Python and PHP.
You can help without writing code:
- Spot a wrong fact? Open an issue
with a source, or edit the JSON file in
data/. - Native Bangla speakers: a quick review of spellings in the mock-data names list would help.
- Using it in a project? Tell me; I'd love to list it.
Code is MIT, data is CC BY 4.0. Try it at deshapi.riadul.com, and the code is on GitHub.