https://github.com/j03-dev/bus_antsirabe_api
Antsirabe bus API
https://github.com/j03-dev/bus_antsirabe_api
api fast rest rust
Last synced: over 1 year ago
JSON representation
Antsirabe bus API
- Host: GitHub
- URL: https://github.com/j03-dev/bus_antsirabe_api
- Owner: j03-dev
- Created: 2023-12-24T14:12:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-03T19:56:25.000Z (over 1 year ago)
- Last Synced: 2025-03-03T20:36:05.712Z (over 1 year ago)
- Topics: api, fast, rest, rust
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bus Antsirabe API
A simple REST API for retrieving bus line and travel information for Antsirabe.
## Endpoints
### GET /api/travel
Returns a list of all available travels with their IDs and names.
Response format:
```json
{
"travel_id": "travel_name"
}
```
### POST /api/travel
Find bus lines between two points.
Request body:
```json
{
"primus": "starting_point_id",
"terminus": "destination_id"
}
```
Response format:
```json
["bus_line_1", "bus_line_2"]
```
## Running locally
1. Clone the repository
2. Install dependencies: `pip install oxhttp`
3. Run the server: `python main.py`
4. API will be available at http://localhost:8080
## Data
Bus line data is stored in `travel.json` and loaded on startup.