An open API service indexing awesome lists of open source software.

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

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.