Public Transit API

Transit routing and real-time data API for public transport with rate limiting and authentication

Version 2.0 Base URL: https://capi.busmaps.com:8443

Authentication

All API requests require authentication using API key and host headers

Required Headers

capi-key Required

Bearer token with your API key

Format: Bearer YOUR_API_KEY
capi-host Required

Platform host for data source

Format:
Options: busmaps.com, wikiroutes.info

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

number

Server processing time for the request in milliseconds

Example: 156.68
Available in: routes, nextDepartures, stopsInRadius

regionName

string

Geographic region identifier for the request

Example: "uk_ireland"
Available in: routes, nextDepartures, stopsInRadius

imperial

boolean

Whether distances and measurements use imperial units

Example: true
Available in: routes, nextDepartures, stopsInRadius

Note: Pedestrian routing endpoints (pedestrianRoute, pedestrianMatrix) are powered by OSRM and follow a different response format without these common fields.

HTTP Status Codes

200

OK

Request was successful and returned valid data

Response includes:
  • Requested data (routes, departures, etc.)
  • Processing time metrics
400

Bad Request

Invalid request parameters or malformed request

Common causes:
  • Missing required parameters
  • Invalid coordinate format
  • Invalid parameter values
500

Internal Server Error

Unexpected server error occurred

Possible reasons:
  • Server processing error
  • Database connectivity issues
  • Internal service failure
502

Bad Gateway

Upstream service is unavailable or responding incorrectly

Common scenarios:
  • Transit data service outage
  • Routing service unavailable
  • External API connectivity issues