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

# Get E-Bike Usage Pattern Analysis

> Examine e-bike versus pedal bike usage patterns and identify fleet optimization opportunities. Returns hourly e-bike availability patterns, station-level e-bike distribution, system-wide e-bike metrics, and deployment opportunity scores for targeted e-bike expansion.

**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}/ebike_patterns
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://api.getswitch.io
    description: Production
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}/ebike_patterns:
    get:
      tags:
        - Station Based Analytics
      summary: Get E-Bike Usage Pattern Analysis
      description: >-
        Examine e-bike versus pedal bike usage patterns and identify fleet
        optimization opportunities. Returns hourly e-bike availability patterns,
        station-level e-bike distribution, system-wide e-bike metrics, and
        deployment opportunity scores for targeted e-bike expansion.


        **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_ebike_patterns
      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: >-
            E-bike pattern data retrieved. Returns hourly availability patterns,
            station distribution, system metrics, and deployment opportunity
            rankings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EbikePatternsResponse'
        '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:
    EbikePatternsResponse:
      properties:
        hourly_bike_analysis:
          items:
            $ref: '#/components/schemas/HourlyEbikeData'
          type: array
          title: Hourly Bike Analysis
          description: >-
            Hourly patterns of e-bike vs pedal bike availability and shortage
            rates
          examples:
            - - available_ebikes: 12.5
                ebike_ratio: 0.35
                ebike_shortage: 0.15
                hour: 8
                pedal_bikes: 18.2
                pedal_shortage: 0.08
        station_ebike_analysis:
          items:
            $ref: '#/components/schemas/StationEbikeMetrics'
          type: array
          title: Station Ebike Analysis
          description: Station-level e-bike availability metrics and distribution patterns
          examples:
            - - available_ebikes: 3.5
                ebike_ratio: 0.32
                ebike_shortage: 0.12
                pedal_bikes: 8.2
                station_id: 123
                station_latitude: 45.464664
                station_longitude: 9.18854
                station_name: Central Station
        ebike_opportunities:
          items:
            $ref: '#/components/schemas/EbikeOpportunityMetrics'
          type: array
          title: Ebike Opportunities
          description: Stations with high potential for e-bike deployment improvements
          examples:
            - - avg_shortage_rate: 0.45
                opportunity_score: 0.78
                priority_category: High
                station_id: 456
                station_name: Park Avenue
        ebike_metrics:
          $ref: '#/components/schemas/EbikeMetrics'
          description: System-wide e-bike performance and utilization metrics
          examples:
            - avg_ebike_utilization: 0.62
              ebike_penetration: 0.5
              shortage_correlation: 0.58
              total_ebikes: 300
      type: object
      required:
        - hourly_bike_analysis
        - station_ebike_analysis
        - ebike_opportunities
        - ebike_metrics
      title: EbikePatternsResponse
      description: |-
        Comprehensive e-bike patterns analysis response with availability,
        usage, and deployment insights.
      examples:
        - ebike_metrics:
            avg_ebike_utilization: 0.58
            ebike_penetration: 0.31
            shortage_correlation: 0.47
            total_ebikes: 640
          ebike_opportunities:
            - avg_shortage_rate: 0.52
              opportunity_score: 0.78
              priority_category: High
              station_id: 245
              station_name: Stazione Centrale
            - avg_shortage_rate: 0.22
              opportunity_score: 0.41
              priority_category: Medium
              station_id: 101
              station_name: Duomo
          hourly_bike_analysis:
            - available_ebikes: 1.6
              ebike_ratio: 0.28
              ebike_shortage: 0.46
              hour: 8
              pedal_bikes: 4.1
              pedal_shortage: 0.18
            - available_ebikes: 2.4
              ebike_ratio: 0.33
              ebike_shortage: 0.31
              hour: 14
              pedal_bikes: 4.9
              pedal_shortage: 0.11
          station_ebike_analysis:
            - available_ebikes: 0.9
              ebike_ratio: 0.29
              ebike_shortage: 0.52
              pedal_bikes: 2.2
              station_id: 245
              station_latitude: 45.4859
              station_longitude: 9.2045
              station_name: Stazione Centrale
            - available_ebikes: 3
              ebike_ratio: 0.35
              ebike_shortage: 0.22
              pedal_bikes: 5.6
              station_id: 101
              station_latitude: 45.4642
              station_longitude: 9.19
              station_name: Duomo
    HourlyEbikeData:
      properties:
        hour:
          type: integer
          maximum: 23
          minimum: 0
          title: Hour
          description: Hour of day (0-23)
          examples:
            - 8
            - 14
            - 20
        available_ebikes:
          type: number
          minimum: 0
          title: Available Ebikes
          description: Average number of e-bikes available during this hour
          examples:
            - 12.5
            - 8.7
            - 15.3
        pedal_bikes:
          type: number
          minimum: 0
          title: Pedal Bikes
          description: Average number of pedal bikes available during this hour
          examples:
            - 18.2
            - 14.6
            - 22.1
        ebike_ratio:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Ratio
          description: Proportion of available bikes that are e-bikes during this hour
          examples:
            - 0.35
            - 0.42
            - 0.58
        ebike_shortage:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Shortage
          description: >-
            Proportion of station-time records with zero e-bikes during this
            hour
          examples:
            - 0.15
            - 0.28
            - 0.45
        pedal_shortage:
          type: number
          maximum: 1
          minimum: 0
          title: Pedal Shortage
          description: >-
            Proportion of station-time records with zero pedal bikes during this
            hour
          examples:
            - 0.08
            - 0.12
            - 0.25
      type: object
      required:
        - hour
        - available_ebikes
        - pedal_bikes
        - ebike_ratio
        - ebike_shortage
        - pedal_shortage
      title: HourlyEbikeData
      description: Hourly e-bike availability and usage patterns.
    StationEbikeMetrics:
      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
        available_ebikes:
          type: number
          minimum: 0
          title: Available Ebikes
          description: Average number of e-bikes available at this station
          examples:
            - 3.5
            - 6.2
            - 8.7
        pedal_bikes:
          type: number
          minimum: 0
          title: Pedal Bikes
          description: Average number of pedal bikes available at this station
          examples:
            - 8.2
            - 12.5
            - 15.3
        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
        ebike_shortage:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Shortage
          description: Proportion of time this station has zero e-bikes available
          examples:
            - 0.12
            - 0.25
            - 0.48
      type: object
      required:
        - station_id
        - station_name
        - station_latitude
        - station_longitude
        - available_ebikes
        - pedal_bikes
        - ebike_ratio
        - ebike_shortage
      title: StationEbikeMetrics
      description: Station-level e-bike availability and distribution metrics.
    EbikeOpportunityMetrics:
      properties:
        station_id:
          type: integer
          exclusiveMinimum: 0
          title: Station Id
          description: Unique identifier for the bike sharing station
          examples:
            - 123
            - 456
            - 789
        station_name:
          type: string
          minLength: 1
          title: Station Name
          description: Human-readable name of the station
          examples:
            - Central Station
            - Park Avenue
            - Main Square
        opportunity_score:
          type: number
          maximum: 1
          minimum: 0
          title: Opportunity Score
          description: >-
            Composite opportunity score (0-1, higher indicates better
            opportunity)
          examples:
            - 0.65
            - 0.78
            - 0.92
        priority_category:
          type: string
          pattern: ^(High|Medium|Low)$
          title: Priority Category
          description: Priority level for e-bike deployment
          examples:
            - High
            - Medium
            - Low
        avg_shortage_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Avg Shortage Rate
          description: Average e-bike shortage rate at this station
          examples:
            - 0.25
            - 0.45
            - 0.68
      type: object
      required:
        - station_id
        - station_name
        - opportunity_score
        - priority_category
        - avg_shortage_rate
      title: EbikeOpportunityMetrics
      description: E-bike deployment opportunity metrics for stations with high potential.
    EbikeMetrics:
      properties:
        total_ebikes:
          type: integer
          minimum: 0
          title: Total Ebikes
          description: Total number of e-bikes in the system
          examples:
            - 150
            - 300
            - 500
        ebike_penetration:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Penetration
          description: Proportion of total fleet that are e-bikes (0-1)
          examples:
            - 0.35
            - 0.5
            - 0.75
        avg_ebike_utilization:
          type: number
          maximum: 1
          minimum: 0
          title: Avg Ebike Utilization
          description: Average e-bike utilization rate (0-1, higher is better)
          examples:
            - 0.45
            - 0.62
            - 0.78
        shortage_correlation:
          type: number
          maximum: 1
          minimum: 0
          title: Shortage Correlation
          description: Correlation between e-bike shortages and overall demand (0-1)
          examples:
            - 0.25
            - 0.58
            - 0.83
      type: object
      required:
        - total_ebikes
        - ebike_penetration
        - avg_ebike_utilization
        - shortage_correlation
      title: EbikeMetrics
      description: E-bike system metrics with comprehensive utilization data.
  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.