Bike Sharing API
A REST API that aggregates bike sharing data from multiple providers into a unified interface. Built for the Open Data Hub to provide real-time bike and station availability across different sharing systems in South Tyrol.
Overview
Cities often have multiple bike sharing providers, each with their own API format and data model. This creates friction for developers building mobility apps and for cities trying to analyze transportation patterns.
This API solves that problem by providing a single endpoint that aggregates data from all providers, normalizing station information, bike availability, and e-bike battery levels into a consistent format.
Key Features
Multi-Provider Support
Integrates with GBFS, custom APIs, and legacy systems from multiple bike sharing operators.
Geospatial Queries
Find nearby stations using PostGIS spatial queries with configurable radius and result limits.
Real-time Updates
Polls providers every 30 seconds to keep availability data fresh, with WebSocket support for push updates.
Historical Analytics
Stores historical data for usage pattern analysis, peak hour identification, and capacity planning.
API Design
The API follows REST conventions with consistent response formats. Endpoints support filtering, pagination, and field selection to minimize payload sizes for mobile clients.
GBFS Compliance: The API also exposes a GBFS-compatible feed, making it easy for third-party apps like Google Maps to consume the aggregated data directly.
GET /api/v1/stations?lat=46.498&lng=11.354&radius=500
{
"stations": [
{
"id": "station_123",
"name": "Piazza Walther",
"provider": "bikemi",
"location": { "lat": 46.4983, "lng": 11.3548 },
"bikes_available": 8,
"docks_available": 4,
"ebikes_available": 3
}
]
}
Tech Stack
What I Learned
This project taught me about the challenges of data aggregation: handling different update frequencies, dealing with provider outages gracefully, and merging overlapping data sets without duplicates.
I also learned about spatial databases and how PostGIS enables efficient geographic queries that would be impractical with traditional SQL.