Public Transit API
Transit routing and real-time data API for public transport with rate limiting and authentication
Authentication
All API requests require authentication using API key and host headers
Required Headers
capi-key
RequiredBearer token with your API key
Bearer YOUR_API_KEYcapi-host
RequiredPlatform host for data source
Platform Hosts
busmaps.com
Global transit data coverage (official data from busmaps.com)
wikiroutes.info
Coverage provided by wikiroutes.info crowdsourcing project
Rate Limits
Rate limits are enforced per API key with RPS (second), RPM (minute), RPD (day) and RPMonth (month) limits
Rate limits vary by endpoint and subscription plan. Contact support for current limits.
Example Request
curl -H "capi-key: Bearer YOUR_API_KEY" \
-H "capi-host: busmaps.com" \
"https://capi.busmaps.com:8443/routes?origin=51.52,-0.149&destination=51.50,-0.108"Available Endpoints
/routes
Calculate optimal public transport routes with real-time data integration
/nextDepartures
Retrieve scheduled and real-time departure information from public transport stops. Two modes: search by coordinates (location) or query specific stop (stopId + regionName)
/stopsInRadius
Search for all public transport stops within a given radius of coordinates
/rawVehiclePositions
Retrieve raw real-time vehicle positions within specified geographic bounds. Returns vehicle positions data with route id and timestamp.
/pedestrian/route/lon,lat;lon,lat
Calculate optimal walking routes between coordinates using OSRM pedestrian routing. Prioritizes pedestrian infrastructure like sidewalks and footpaths. Compatible with OSRM API specification.
/pedestrian/matrix/lon,lat;lon,lat
Calculate distance and duration matrices between multiple coordinates for pedestrian routing. Compatible with OSRM matrix API.
/getGtfsFeedsDownloads
Access our comprehensive GTFS feed catalog with both original and improved versions. Download source data and processed feeds with error corrections, license information, and additional derivatives. Perfect for data analysis and offline applications.
/nominatim/reverse
Convert geographic coordinates (latitude, longitude) into a human-readable address using OpenStreetMap Nominatim. Worldwide coverage with detailed address components.
/nominatim/search
Search for locations by name, address, or place using OpenStreetMap Nominatim. Returns coordinates and details for matching locations. Worldwide coverage.
Common Response Fields
Most API responses include additional metadata and processing information:
processingTimeMs
numberServer processing time for the request in milliseconds
156.68regionName
stringGeographic region identifier for the request
"uk_ireland"imperial
booleanWhether distances and measurements use imperial units
trueNote: Pedestrian routing endpoints (pedestrianRoute, pedestrianMatrix) are powered by OSRM and follow a different response format without these common fields.
HTTP Status Codes
OK
Request was successful and returned valid data
- Requested data (routes, departures, etc.)
- Processing time metrics
Bad Request
Invalid request parameters or malformed request
- Missing required parameters
- Invalid coordinate format
- Invalid parameter values
Internal Server Error
Unexpected server error occurred
- Server processing error
- Database connectivity issues
- Internal service failure
Bad Gateway
Upstream service is unavailable or responding incorrectly
- Transit data service outage
- Routing service unavailable
- External API connectivity issues