openapi: 3.2.0 info: title: Transit Locations Trip Planning API description: The Transit API delivers real-time public transit data - nearby routes and stops, stop departures, route details, multimodal trip planning, and service alerts - across 1,100+ cities in 37 countries, plus shared-mobility availability for bikes, scooters, and carshare. version: '3.0' contact: name: Transit Partnerships url: https://transitapp.com/partners/apis email: partners@transit.app x-logo: url: https://kinlane-images.s3.amazonaws.com/shared/apis-json/apis-json-logo.jpg servers: - url: https://external.transitapp.com/v3 description: Transit public API v3 security: - apiKeyAuth: [] tags: - name: Trip Planning description: Multimodal origin-to-destination trip planning. paths: /otp/plan: get: operationId: planTrip tags: - Trip Planning summary: Plan a multimodal trip description: Multimodal trip planning between an origin and a destination, returning ranked itineraries that combine public transit with walking, biking, and shared mobility. Built on an OpenTripPlanner-style plan surface. x-modeled: true parameters: - name: fromPlace in: query required: true description: Origin as "lat,lon". schema: type: string example: 45.5088,-73.5878 - name: toPlace in: query required: true description: Destination as "lat,lon". schema: type: string example: 45.4972,-73.5793 - name: date in: query required: false description: Travel date (YYYY-MM-DD). Defaults to today. schema: type: string format: date - name: time in: query required: false description: Travel time (HH:MM). Defaults to now. schema: type: string - name: arriveBy in: query required: false description: When true, treat date/time as the desired arrival time. schema: type: boolean default: false - name: mode in: query required: false description: Comma-separated modes, e.g. TRANSIT,WALK,BICYCLE. schema: type: string example: TRANSIT,WALK - name: Accept-Language in: header required: false description: Preferred response language (BCP 47). schema: type: string example: en responses: '200': description: Ranked trip itineraries. content: application/json: schema: type: object properties: plan: type: object properties: itineraries: type: array items: $ref: '#/components/schemas/Itinerary' '401': $ref: '#/components/responses/Unauthorized' '429': $ref: '#/components/responses/RateLimited' components: schemas: Leg: type: object properties: mode: type: string example: BUS from: type: string example: YUL AƩroport to: type: string example: Centre-ville route_short_name: type: string example: '747' duration: type: integer example: 1500 Error: type: object properties: status: type: integer example: 401 message: type: string example: Invalid API key. Itinerary: type: object properties: duration: type: integer description: Total trip duration in seconds. example: 1980 start_time: type: integer description: Unix epoch seconds of departure. end_time: type: integer description: Unix epoch seconds of arrival. legs: type: array items: $ref: '#/components/schemas/Leg' responses: Unauthorized: description: Missing or invalid API key. content: application/json: schema: $ref: '#/components/schemas/Error' RateLimited: description: Rate limit exceeded (free tier is 5 requests/minute, 1,500/month). content: application/json: schema: $ref: '#/components/schemas/Error' securitySchemes: apiKeyAuth: type: apiKey in: header name: apiKey description: Transit access key requested via Transit's API request form. Sent as the `apiKey` request header on every call.