CTA Bus Tracker API

The Chicago Transit Authority Bus Tracker API provides real-time bus arrival predictions, vehicle locations, route patterns, route lists, and stop directories for the CTA bus network. Access requires an API key issued by the CTA Developer Center.

Run with Naftiko ChicagoTransitAuthorityAPI

What You Can Do

GET
Gettime — Get System Time
/gettime
GET
Getroutes — Get Routes
/getroutes
GET
Getdirections — Get Directions
/getdirections
GET
Getstops — Get Stops
/getstops
GET
Getpatterns — Get Patterns
/getpatterns
GET
Getvehicles — Get Vehicles
/getvehicles
GET
Getpredictions — Get Predictions
/getpredictions
GET
Getservicebulletins — Get Service Bulletins
/getservicebulletins

MCP Tools

gettime

Get System Time

read-only idempotent
getroutes

Get Routes

read-only idempotent
getdirections

Get Directions

read-only idempotent
getstops

Get Stops

read-only idempotent
getpatterns

Get Patterns

read-only idempotent
getvehicles

Get Vehicles

read-only idempotent
getpredictions

Get Predictions

read-only idempotent
getservicebulletins

Get Service Bulletins

read-only idempotent

Capability Spec

chicago-transit-authority-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: CTA Bus Tracker API
  description: The Chicago Transit Authority Bus Tracker API provides real-time bus arrival predictions, vehicle locations,
    route patterns, route lists, and stop directories for the CTA bus network. Access requires an API key issued by the CTA
    Developer Center.
  tags:
  - Chicago
  - Transit
  - Authority
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: chicago-transit-authority
    baseUri: http://www.ctabustracker.com/bustime/api/v2
    description: CTA Bus Tracker API HTTP API.
    authentication:
      type: apikey
      in: query
      name: key
      value: '{{CHICAGO_TRANSIT_AUTHORITY_TOKEN}}'
    resources:
    - name: gettime
      path: /gettime
      operations:
      - name: gettime
        method: GET
        description: Get System Time
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getroutes
      path: /getroutes
      operations:
      - name: getroutes
        method: GET
        description: Get Routes
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getdirections
      path: /getdirections
      operations:
      - name: getdirections
        method: GET
        description: Get Directions
        inputParameters:
        - name: rt
          in: query
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getstops
      path: /getstops
      operations:
      - name: getstops
        method: GET
        description: Get Stops
        inputParameters:
        - name: rt
          in: query
          type: string
          required: true
        - name: dir
          in: query
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getpatterns
      path: /getpatterns
      operations:
      - name: getpatterns
        method: GET
        description: Get Patterns
        inputParameters:
        - name: rt
          in: query
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getvehicles
      path: /getvehicles
      operations:
      - name: getvehicles
        method: GET
        description: Get Vehicles
        inputParameters:
        - name: vid
          in: query
          type: string
          description: Comma-separated vehicle IDs.
        - name: rt
          in: query
          type: string
          description: Comma-separated route designators.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getpredictions
      path: /getpredictions
      operations:
      - name: getpredictions
        method: GET
        description: Get Predictions
        inputParameters:
        - name: stpid
          in: query
          type: string
          description: Comma-separated stop IDs.
        - name: rt
          in: query
          type: string
          description: Comma-separated route designators.
        - name: vid
          in: query
          type: string
          description: Comma-separated vehicle IDs.
        - name: top
          in: query
          type: integer
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: getservicebulletins
      path: /getservicebulletins
      operations:
      - name: getservicebulletins
        method: GET
        description: Get Service Bulletins
        inputParameters:
        - name: rt
          in: query
          type: string
        - name: stpid
          in: query
          type: string
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: chicago-transit-authority-rest
    description: REST adapter for CTA Bus Tracker API.
    resources:
    - path: /gettime
      name: gettime
      operations:
      - method: GET
        name: gettime
        description: Get System Time
        call: chicago-transit-authority.gettime
        outputParameters:
        - type: object
          mapping: $.
    - path: /getroutes
      name: getroutes
      operations:
      - method: GET
        name: getroutes
        description: Get Routes
        call: chicago-transit-authority.getroutes
        outputParameters:
        - type: object
          mapping: $.
    - path: /getdirections
      name: getdirections
      operations:
      - method: GET
        name: getdirections
        description: Get Directions
        call: chicago-transit-authority.getdirections
        outputParameters:
        - type: object
          mapping: $.
    - path: /getstops
      name: getstops
      operations:
      - method: GET
        name: getstops
        description: Get Stops
        call: chicago-transit-authority.getstops
        outputParameters:
        - type: object
          mapping: $.
    - path: /getpatterns
      name: getpatterns
      operations:
      - method: GET
        name: getpatterns
        description: Get Patterns
        call: chicago-transit-authority.getpatterns
        outputParameters:
        - type: object
          mapping: $.
    - path: /getvehicles
      name: getvehicles
      operations:
      - method: GET
        name: getvehicles
        description: Get Vehicles
        call: chicago-transit-authority.getvehicles
        outputParameters:
        - type: object
          mapping: $.
    - path: /getpredictions
      name: getpredictions
      operations:
      - method: GET
        name: getpredictions
        description: Get Predictions
        call: chicago-transit-authority.getpredictions
        outputParameters:
        - type: object
          mapping: $.
    - path: /getservicebulletins
      name: getservicebulletins
      operations:
      - method: GET
        name: getservicebulletins
        description: Get Service Bulletins
        call: chicago-transit-authority.getservicebulletins
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: chicago-transit-authority-mcp
    transport: http
    description: MCP adapter for CTA Bus Tracker API for AI agent use.
    tools:
    - name: gettime
      description: Get System Time
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.gettime
      outputParameters:
      - type: object
        mapping: $.
    - name: getroutes
      description: Get Routes
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getroutes
      outputParameters:
      - type: object
        mapping: $.
    - name: getdirections
      description: Get Directions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getdirections
      with:
        rt: tools.rt
      inputParameters:
      - name: rt
        type: string
        description: rt
        required: true
      outputParameters:
      - type: object
        mapping: $.
    - name: getstops
      description: Get Stops
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getstops
      with:
        rt: tools.rt
        dir: tools.dir
      inputParameters:
      - name: rt
        type: string
        description: rt
        required: true
      - name: dir
        type: string
        description: dir
        required: true
      outputParameters:
      - type: object
        mapping: $.
    - name: getpatterns
      description: Get Patterns
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getpatterns
      with:
        rt: tools.rt
      inputParameters:
      - name: rt
        type: string
        description: rt
        required: true
      outputParameters:
      - type: object
        mapping: $.
    - name: getvehicles
      description: Get Vehicles
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getvehicles
      with:
        vid: tools.vid
        rt: tools.rt
      inputParameters:
      - name: vid
        type: string
        description: Comma-separated vehicle IDs.
      - name: rt
        type: string
        description: Comma-separated route designators.
      outputParameters:
      - type: object
        mapping: $.
    - name: getpredictions
      description: Get Predictions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getpredictions
      with:
        stpid: tools.stpid
        rt: tools.rt
        vid: tools.vid
        top: tools.top
      inputParameters:
      - name: stpid
        type: string
        description: Comma-separated stop IDs.
      - name: rt
        type: string
        description: Comma-separated route designators.
      - name: vid
        type: string
        description: Comma-separated vehicle IDs.
      - name: top
        type: integer
        description: top
      outputParameters:
      - type: object
        mapping: $.
    - name: getservicebulletins
      description: Get Service Bulletins
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: chicago-transit-authority.getservicebulletins
      with:
        rt: tools.rt
        stpid: tools.stpid
      inputParameters:
      - name: rt
        type: string
        description: rt
      - name: stpid
        type: string
        description: stpid
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    CHICAGO_TRANSIT_AUTHORITY_TOKEN: CHICAGO_TRANSIT_AUTHORITY_TOKEN