> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.getswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Station Trip Volume Analysis

> Estimate trip volume and demand patterns using vehicle availability changes as a proxy. Returns daily and hourly trip estimates, stations ranked by activity, demand patterns by time of day, and total system utilization metrics.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions
- **404**: `no_data_binding` when the provider or location is not enabled for your company, or no data for that location and period
- **422**: Invalid filter parameters
- **500**: Internal server error

**Required Auth Scopes:**
- `copilot:analytics`



## OpenAPI

````yaml /api-reference/openapi.json get /copilot/station-based/{provider}/trip_volume
openapi: 3.1.0
info:
  title: SWITCH API
  version: '1.0'
  description: >-
    The SWITCH API gives mobility and logistics teams programmatic access to
    SWITCH forecasts, fleet operations, routing and analytics. Every request is
    authenticated with an API key sent as a bearer token.
servers:
  - url: https://stage-api.getswitch.io
    description: Stage
security: []
tags:
  - name: Forecast
    description: Demand forecasts per zone and time window.
  - name: Operations
    description: Fleet imbalance, rebalancing suggestions and generated tasks.
  - name: Routing
    description: Route optimisation for single and multiple fleets.
  - name: Routing Sessions
    description: Saved routing sessions, their routes and drivers.
  - name: Routing Operations
    description: Complete, undo and re-route the stops of a route.
  - name: Fleet Management
    description: Your depots, stations, drivers and cargo vehicles.
  - name: Integrations
    description: Vehicles, statuses and commands on your fleet platform.
  - name: Station Based Analytics
    description: Analytics for station-based (docked) services.
  - name: Zone Based Analytics
    description: Analytics for free-floating services, by zone.
  - name: Free Float Analytics
    description: Trip history for free-floating services.
  - name: Transit Analytics
    description: Punctuality and service delivery for public transit.
  - name: Live
    description: Real-time fleet, delivery and transit status.
  - name: Grids
    description: Spatial grids used by forecasts and analytics.
  - name: API Keys
    description: Create and manage the API keys you call this API with.
paths:
  /copilot/station-based/{provider}/trip_volume:
    get:
      tags:
        - Station Based Analytics
      summary: Get Station Trip Volume Analysis
      description: >-
        Estimate trip volume and demand patterns using vehicle availability
        changes as a proxy. Returns daily and hourly trip estimates, stations
        ranked by activity, demand patterns by time of day, and total system
        utilization metrics.


        **Failure Modes:**

        - **401**: Token is missing or invalid

        - **403**: Insufficient permissions

        - **404**: `no_data_binding` when the provider or location is not
        enabled for your company, or no data for that location and period

        - **422**: Invalid filter parameters

        - **500**: Internal server error


        **Required Auth Scopes:**

        - `copilot:analytics`
      operationId: get_trip_volume
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
            description: >-
              Identifier of the mobility provider whose data you analyse, e.g.
              `acme-bikes`. It must be the provider of a data source enabled for
              your company's station-based analytics; any other value is refused
              with 404 `no_data_binding` (`kind: source`). Your SWITCH contact
              tells you the provider identifiers and locations enabled for your
              company.
            title: Provider
          description: >-
            Identifier of the mobility provider whose data you analyse, e.g.
            `acme-bikes`. It must be the provider of a data source enabled for
            your company's station-based analytics; any other value is refused
            with 404 `no_data_binding` (`kind: source`). Your SWITCH contact
            tells you the provider identifiers and locations enabled for your
            company.
        - name: geolabel
          in: query
          required: true
          schema:
            type: string
            description: >-
              Location to analyse, e.g. `milan`: one of the locations (or their
              geolabels) that your company's station-based analytics are enabled
              for with this provider. Any other value is refused with 404
              `no_data_binding` (`kind: location`).
            title: Geolabel
          description: >-
            Location to analyse, e.g. `milan`: one of the locations (or their
            geolabels) that your company's station-based analytics are enabled
            for with this provider. Any other value is refused with 404
            `no_data_binding` (`kind: location`).
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              Start of the analysis period, an ISO 8601 date-time with a time
              zone, e.g. `2026-10-01T00:00:00Z`.
            title: Start Date
          description: >-
            Start of the analysis period, an ISO 8601 date-time with a time
            zone, e.g. `2026-10-01T00:00:00Z`.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              End of the analysis period, an ISO 8601 date-time with a time
              zone, e.g. `2026-10-31T23:59:59Z`. Must be after `start_date`, at
              most 366 days later.
            title: End Date
          description: >-
            End of the analysis period, an ISO 8601 date-time with a time zone,
            e.g. `2026-10-31T23:59:59Z`. Must be after `start_date`, at most 366
            days later.
        - name: start_hour
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            maximum: 23
            minimum: 0
            description: >-
              First hour of the day to include (0-23, local time of the city).
              Set together with `end_hour`; both bounds are included.
            title: Start Hour
          description: >-
            First hour of the day to include (0-23, local time of the city). Set
            together with `end_hour`; both bounds are included.
        - name: end_hour
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            maximum: 23
            minimum: 0
            description: >-
              Last hour of the day to include (0-23, local time of the city),
              not before `start_hour`. Set together with `start_hour`.
            title: End Hour
          description: >-
            Last hour of the day to include (0-23, local time of the city), not
            before `start_hour`. Set together with `start_hour`.
      responses:
        '200':
          description: >-
            Trip volume data retrieved. Returns hourly and daily trip estimates
            with station-level activity rankings.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pulse__core_api_lib__data_manager__analyses__station_based__schemas__TripVolumeResponse
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '422':
          description: Unprocessable Entity. Validation failed.
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    pulse__core_api_lib__data_manager__analyses__station_based__schemas__TripVolumeResponse:
      properties:
        hourly_activity:
          items:
            $ref: '#/components/schemas/HourlyActivityData'
          type: array
          title: Hourly Activity
          description: >-
            Hourly activity patterns showing demand and supply proxy metrics
            aggregated across all stations by hour of day
          examples:
            - - demand_proxy: 15.3
                hour: 8
                supply_proxy: 12.8
                total_activity: 28.1
        station_total_activity:
          items:
            $ref: '#/components/schemas/StationActivityData'
          type: array
          title: Station Total Activity
          description: >-
            Station-level activity metrics showing total demand/supply proxy for
            each station, ordered by total activity
          examples:
            - - demand_proxy: 125.3
                ebike_ratio: 0.45
                station_id: 123
                station_latitude: 45.464664
                station_longitude: 9.18854
                station_name: Central Station
                supply_proxy: 109.2
                total_activity: 234.5
        feasibility:
          type: string
          title: Feasibility
          description: Analysis feasibility status
          examples:
            - limited
            - full
            - partial
        message:
          type: string
          title: Message
          description: Explanatory message about the analysis method and limitations
          examples:
            - >-
              Trip volume estimated from vehicle availability changes. Provides
              station activity patterns with hourly granularity.
      type: object
      required:
        - hourly_activity
        - station_total_activity
        - feasibility
        - message
      title: TripVolumeResponse
      description: Trip volume analysis response with hourly patterns and station metrics.
      examples:
        - feasibility: limited
          hourly_activity:
            - demand_proxy: 1240
              hour: 8
              supply_proxy: 1185
              total_activity: 2425
            - demand_proxy: 1310
              hour: 18
              supply_proxy: 1352
              total_activity: 2662
          message: >-
            Trip volume estimated from vehicle availability changes. Provides
            station activity patterns with hourly granularity.
          station_total_activity:
            - demand_proxy: 2510
              ebike_ratio: 0.28
              station_id: 245
              station_latitude: 45.4859
              station_longitude: 9.2045
              station_name: Stazione Centrale
              supply_proxy: 2310
              total_activity: 4820
            - demand_proxy: 1990
              ebike_ratio: 0.35
              station_id: 101
              station_latitude: 45.4642
              station_longitude: 9.19
              station_name: Duomo
              supply_proxy: 1985
              total_activity: 3975
    HourlyActivityData:
      properties:
        hour:
          type: integer
          maximum: 23
          minimum: 0
          title: Hour
          description: Hour of day (0-23)
          examples:
            - 8
            - 14
            - 20
        demand_proxy:
          type: number
          minimum: 0
          title: Demand Proxy
          description: Estimated demand proxy based on vehicle pickups during this hour
          examples:
            - 12.5
            - 8.7
            - 25.3
        supply_proxy:
          type: number
          minimum: 0
          title: Supply Proxy
          description: Estimated supply proxy based on vehicle returns during this hour
          examples:
            - 10.2
            - 6.8
            - 18.9
        total_activity:
          type: number
          minimum: 0
          title: Total Activity
          description: Total activity (demand + supply proxy) during this hour
          examples:
            - 22.7
            - 15.5
            - 44.2
      type: object
      required:
        - hour
        - demand_proxy
        - supply_proxy
        - total_activity
      title: HourlyActivityData
      description: Hourly activity pattern data with demand and supply proxy metrics.
    StationActivityData:
      properties:
        station_id:
          anyOf:
            - type: integer
            - type: string
          title: Station Id
          description: Unique identifier for the bike sharing station
          examples:
            - 123
            - station_456
            - ST_789
        station_name:
          type: string
          minLength: 1
          title: Station Name
          description: Human-readable name of the station
          examples:
            - Central Station
            - Park Avenue
            - Main Square
        station_latitude:
          type: number
          maximum: 90
          minimum: -90
          title: Station Latitude
          description: Station latitude in decimal degrees
          examples:
            - 45.464664
            - 40.7128
            - 51.5074
        station_longitude:
          type: number
          maximum: 180
          minimum: -180
          title: Station Longitude
          description: Station longitude in decimal degrees
          examples:
            - 9.18854
            - -74.006
            - -0.1278
        total_activity:
          type: number
          minimum: 0
          title: Total Activity
          description: Total activity (demand + supply proxy) at this station
          examples:
            - 234.5
            - 189.2
            - 456.8
        demand_proxy:
          type: number
          minimum: 0
          title: Demand Proxy
          description: Total estimated demand proxy at this station
          examples:
            - 125.3
            - 98.7
            - 201.4
        supply_proxy:
          type: number
          minimum: 0
          title: Supply Proxy
          description: Total estimated supply proxy at this station
          examples:
            - 109.2
            - 90.5
            - 255.4
        ebike_ratio:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Ratio
          description: >-
            Average proportion of available bikes that are e-bikes at this
            station
          examples:
            - 0.32
            - 0.45
            - 0.67
      type: object
      required:
        - station_id
        - station_name
        - station_latitude
        - station_longitude
        - total_activity
        - demand_proxy
        - supply_proxy
        - ebike_ratio
      title: StationActivityData
      description: Station-level activity metrics with geographic and activity information.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        An API key, sent as `Authorization: Bearer <key>`. Create one in the
        SWITCH Copilot under **Settings → API keys** (needs the API keys
        permission in your company), or with `POST /auth/api-keys`. The key is
        shown once, at creation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.