Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thaoanhhaa1/vietnam-addresses
This is a Node.js RESTful API that provides endpoints to retrieve information about administrative divisions in Vietnam, including cities, districts, and wards.
https://github.com/thaoanhhaa1/vietnam-addresses
address mongodb mongoose nodejs typescript vercel vietnam vietnam-address-api
Last synced: 7 days ago
JSON representation
This is a Node.js RESTful API that provides endpoints to retrieve information about administrative divisions in Vietnam, including cities, districts, and wards.
- Host: GitHub
- URL: https://github.com/thaoanhhaa1/vietnam-addresses
- Owner: thaoanhhaa1
- License: mit
- Created: 2024-07-20T18:32:47.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-11-04T03:53:09.000Z (3 months ago)
- Last Synced: 2024-11-04T04:26:10.906Z (3 months ago)
- Topics: address, mongodb, mongoose, nodejs, typescript, vercel, vietnam, vietnam-address-api
- Language: JavaScript
- Homepage: https://vietnam-addresses.vercel.app
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# RESTful API for Vietnam Administrative Divisions
## Introduction
This is a Node.js RESTful API that provides endpoints to retrieve information about administrative divisions in Vietnam, including cities, districts, and wards.
## Features
- Get a list of all cities in Vietnam.
- Get a list of all districts in Vietnam.
- Get a list of districts within a specific city.
- Get a list of all wards in Vietnam.
- Get a list of wards within a specific district.### Endpoints
#### 1. Get Cities
- **URL**: `/api/v1/cities`
- **Method**: `GET`
- **Description**: Retrieves a list of all cities in Vietnam.**Response Example**:
```json
[
{
"_id": "106169285912657",
"name": "An Giang"
},
{
"_id": "106729332900600",
"name": "Bà Rịa - Vũng Tàu"
}
]
```#### 2. Get Districts
- **URL**: `/api/v1/districts`
- **Method**: `GET`
- **Description**: Retrieves a list of all districts in Vietnam.**Response Example**:
```json
[
{
"_id": "106114908346097",
"name": "Huyện An Phú",
"parent_id": "106169285912657"
},
{
"_id": "106270445756154",
"name": "Huyện Châu Phú",
"parent_id": "106169285912657"
}
]
```#### 3. Get Districts by City
- **URL**: `/api/v1/districts?cityId={cityId}`
- **Method**: `GET`
- **Description**: Retrieves a list of districts within a specified city.**Parameters**:
- `cityId`: ID of the city.
**Response Example**:
```json
[
{
"_id": "106114908346097",
"name": "Huyện An Phú",
"parent_id": "106169285912657"
},
{
"_id": "106270445756154",
"name": "Huyện Châu Phú",
"parent_id": "106169285912657"
}
]
```#### 4. Get Wards
- **URL**: `/api/v1/wards`
- **Method**: `GET`
- **Description**: Retrieves a list of all wards in Vietnam.**Response Example**:
```json
[
{
"_id": "106415048701764",
"name": "Thị Trấn Mãn Đức",
"parent_id": "106731744533848"
},
{
"_id": "106693533801859",
"name": "Xã Gia Mô",
"parent_id": "106731744533848"
}
]
```#### 5. Get Wards by District
- **URL**: `/api/v1/wards?districtId={districtId}`
- **Method**: `GET`
- **Description**: Retrieves a list of wards within a specified district.**Parameters**:
- `districtId`: ID of the district.
**Response Example**:
```json
[
{
"_id": "106415048701764",
"name": "Thị Trấn Mãn Đức",
"parent_id": "106731744533848"
},
{
"_id": "106693533801859",
"name": "Xã Gia Mô",
"parent_id": "106731744533848"
}
]
```## Development
To contribute to the project, please follow these steps:
1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/your-feature`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature/your-feature`).
5. Create a new Pull Request.## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.