Instruction helps you create a fake API based on json-server to build the location selection functionality. Should only be used for educational purposes or project demo.
Hướng dẫn giúp bạn tạo nhanh một fake API dựa trên json-server để xây dựng chức năng lựa chọn địa điểm tại Việt Nam( Tỉnh/thành phố, xã/phường ). Chỉ nên dùng cho mục đích học tập hoặc để demo dự án.
Data is periodically updated. Last update : 07/2025 - 2 Levels of Administrative Divisions
Data source: https://danhmuchanhchinh.gso.gov.vn/Default.aspx
Nếu thấy repository nhỏ này thật sự hữu ích với bạn, hãy nhấn vào nút Star để mình có thêm cố gắng update nó. Xin cảm ơn.
( If you find this repository useful, please click star button to give me the motivation to keep this work up-to-date. Thanks so much )
Demo HTML - CSS - Javascript
Demo ReactJs
1 . Clone this repository
git clone https://github.com/qtv100291/Vietnam-administrative-division-json-server.git2 . Install dependencies
npm install3 . Run JSON Server
json-server --watch db.jsonNote : For deploying json-server to various free hosting, check this reference link:
https://github.com/jesperorb/json-server-heroku#deploy-json-server-to--free-hosting-site- (Heroku, Glitch, Azure) or https://github.com/kitloong/json-server-vercel (Vercel). If needed, using my json-server deployed: https://vietnam-administrative-division-json-server-swart.vercel.app 
( Ghi chú : Để deploy json-server lên một vài hosting miễn phí, các bạn có thể tham khảo link này: https://github.com/jesperorb/json-server-heroku#deploy-json-server-to--free-hosting-site- (Heroku, Glitch, Azure) hoặc https://github.com/kitloong/json-server-vercel (Vercel), hoặc nếu thấy cần, có thể dùng luôn api đã được mình đẩy lên: https://vietnam-administrative-division-json-server-swart.vercel.app )
- Get all City/Province : http://localhost:3000/province
 - Get all Ward/Commune of a City/Province : http://localhost:3000/commune/?idProvince=${ id of Province }
 
Example : Get all Ward/Commune of Hanoi City ( id Province: 01 ) : http://localhost:3000/commune/?idProvince=01
danh sách tỉnh thành việt nam json, api tỉnh thành phố xã phường
