https://github.com/venopyX/Htapi
Hotel API
https://github.com/venopyX/Htapi
Last synced: over 1 year ago
JSON representation
Hotel API
- Host: GitHub
- URL: https://github.com/venopyX/Htapi
- Owner: venopyX
- License: mit
- Created: 2023-05-24T18:35:15.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-11T20:16:54.000Z (about 3 years ago)
- Last Synced: 2025-03-23T01:43:45.260Z (over 1 year ago)
- Language: Python
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Htapi
Hotel API
Code of REST-API of The data model:
```
{
"hotels": {
"hotel_id": {
"name": "",
"photos_url": ["url1", "url2", "..."],
"ground": "G+1",
"city": "",
"approximate_location": "",
"google_map_location_url": "",
"latitude": "",
"longitude": "",
"price_range": {
"min": "",
"max": ""
},
"additional_services": ["service1", "service2", "..."],
"rooms": [
{
"room_id": "",
"room_type": "",
"room_area": "",
"room_pricing": "",
"room_photos": ["url1", "url2", "..."],
"additional_services": ["service1", "service2", "..."],
"other_description": ""
}
],
"other_description": ""
}
}
}
```
The hotels object includes fields like photos_url, ground, city, approximate_location, google_map_location_url, latitude, longitude, price_range, additional_services, and other_description.
The rooms object includes room_type, room_area, room_pricing, room_photos, additional_services & other_description fields.
The endpoints:
1. GET /hotels - Returns a list of all hotels
2. GET /hotels/{hotel_id} - Returns details for a specific hotel
3. POST /hotels - Creates a new hotel with the provided details
4. PUT /hotels/{hotel_id} - Updates the details for a specific hotel
5. DELETE /hotels/{hotel_id} - Deletes a specific hotel
6. GET /hotels/{hotel_id}/rooms - Returns a list of all rooms for a specific hotel
7. GET /hotels/{hotel_id}/rooms/{room_id} - Returns details for a specific room in a specific hotel
8. POST /hotels/{hotel_id}/rooms - Creates a new room for a specific hotel with the provided details
9. PUT /hotels/{hotel_id}/rooms/{room_id} - Updates the details for a specific room in a specific hotel
10. DELETE /hotels/{hotel_id}/rooms/{room_id} - Deletes a specific room in a specific hotel
11. GET /hotels/search?query={search_query} - Returns a list of hotels that match the search query.