A simple FastAPI service for accessing Bixi GBFS bike-sharing data in Montreal.
- Real-time station status (available bikes/docks)
- Station information and locations
- Location-based search (find nearby stations)
- Station search by name
- System statistics and alerts
- Raw GBFS feed access
# Install dependencies
uv sync# Run the server
python api/main.py
# Or with uvicorn
uvicorn api.main:app --reloadAPI documentation available at: http://localhost:8000/docs
GET /health- Enhanced health check with uptime, connectivity status, and system infoGET /stations- All station informationGET /stations/status- Real-time status of all stationsGET /stations/status?station_ids=123,456- Status of specific stationsGET /stations/near?lat={lat}&lon={lon}- Find nearby stationsGET /stations/search?query={name}- Search stations by nameGET /stations/available?min_bikes={n}- Stations with available bikesGET /stations/issues- Stations with operational problemsGET /stats/system-summary- System-wide statisticsGET /system/alerts- Active system alertsGET /gbfs/raw/{feed_name}?language={lang}- Raw GBFS feed data
Available feed names for /gbfs/raw/{feed_name}:
station_information- Static station data (location, capacity, etc.)station_status- Real-time availability (bikes, docks available)system_information- General system detailssystem_alerts- Active system alertsvehicle_types- Information about bike types
Language options: en (default), fr
- Docker
# Export requirements (development only)
uv export --no-hashes --format requirements-txt --no-editable > requirements.txt
# Build Docker image
docker build -t bixi-api .
# Run container
docker run -p 8000:8000 bixi-api
# Access the API at: http://localhost:8000
# View docs at: http://localhost:8000/docs