> ## 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 Missed Demand Estimation

> Estimate lost trip opportunities caused by vehicle shortages. Returns hourly missed demand patterns showing when demand could not be served, and per-station metrics identifying which locations have the highest estimated missed demand.

Use this to quantify the revenue impact of shortages and prioritize capacity 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}/missed_demand
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}/missed_demand:
    get:
      tags:
        - Station Based Analytics
      summary: Get Missed Demand Estimation
      description: >-
        Estimate lost trip opportunities caused by vehicle shortages. Returns
        hourly missed demand patterns showing when demand could not be served,
        and per-station metrics identifying which locations have the highest
        estimated missed demand.


        Use this to quantify the revenue impact of shortages and prioritize
        capacity 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_missed_demand
      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: >-
            Missed demand data retrieved. Returns hourly demand patterns and
            station-level missed demand metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MissedDemandResponse'
        '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:
    MissedDemandResponse:
      properties:
        hourly_missed_demand:
          items:
            $ref: '#/components/schemas/HourlyDemandData'
          type: array
          title: Hourly Missed Demand
          description: >-
            Hourly missed demand patterns showing estimated demand during
            shortage periods by hour of day
          examples:
            - - avg_trips: 6.2
                demand_level: 15.3
                hour: 8
                peak_indicator: true
        station_missed_demand:
          items:
            $ref: '#/components/schemas/StationDemandMetrics'
          type: array
          title: Station Missed Demand
          description: >-
            Station-level missed demand metrics showing which stations have the
            highest estimated missed demand during shortages
          examples:
            - - demand_variability: 4.2
                ebike_ratio: 0.45
                peak_demand: 12.8
                station_id: 123
                station_name: Central Station
                total_demand: 87.5
        total_missed:
          type: number
          minimum: 0
          title: Total Missed
          description: Total estimated missed demand across all stations and time periods
          examples:
            - 456.7
            - 123.4
            - 789.1
        avg_daily_missed:
          type: number
          minimum: 0
          title: Avg Daily Missed
          description: Average estimated missed demand per day during the analysis period
          examples:
            - 15.2
            - 8.9
            - 23.6
      type: object
      required:
        - hourly_missed_demand
        - station_missed_demand
        - total_missed
        - avg_daily_missed
      title: MissedDemandResponse
      description: >-
        Missed demand analysis response with hourly patterns and station
        metrics.
      examples:
        - avg_daily_missed: 124.5
          hourly_missed_demand:
            - avg_trips: 12.3
              demand_level: 96.4
              hour: 8
              peak_indicator: true
            - avg_trips: 4.1
              demand_level: 31
              hour: 14
              peak_indicator: false
          station_missed_demand:
            - demand_variability: 9.7
              ebike_ratio: 0.28
              peak_demand: 38
              station_id: 245
              station_latitude: 45.4859
              station_longitude: 9.2045
              station_name: Stazione Centrale
              total_demand: 412
            - demand_variability: 5.2
              ebike_ratio: 0.4
              peak_demand: 21
              station_id: 318
              station_latitude: 45.4532
              station_longitude: 9.176
              station_name: Darsena
              total_demand: 205
          total_missed: 3860
    HourlyDemandData:
      properties:
        hour:
          type: integer
          maximum: 23
          minimum: 0
          title: Hour
          description: Hour of day (0-23)
          examples:
            - 8
            - 14
            - 20
        demand_level:
          type: number
          minimum: 0
          title: Demand Level
          description: >-
            Estimated missed demand level for this hour based on shortage
            patterns
          examples:
            - 12.5
            - 8.7
            - 25.3
        avg_trips:
          type: number
          minimum: 0
          title: Avg Trips
          description: Average estimated trips that could have occurred during this hour
          examples:
            - 5.2
            - 3.8
            - 9.1
        peak_indicator:
          type: boolean
          title: Peak Indicator
          description: Whether this hour represents above-average demand
          examples:
            - true
            - false
      type: object
      required:
        - hour
        - demand_level
        - avg_trips
        - peak_indicator
      title: HourlyDemandData
      description: Hourly demand pattern data with demand estimation and peak detection.
    StationDemandMetrics:
      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_demand:
          type: number
          minimum: 0
          title: Total Demand
          description: >-
            Total estimated missed demand at this station during shortage
            periods
          examples:
            - 45.2
            - 78.9
            - 123.6
        peak_demand:
          type: number
          minimum: 0
          title: Peak Demand
          description: Maximum estimated missed demand in a single hour at this station
          examples:
            - 8.5
            - 12.3
            - 18.7
        demand_variability:
          type: number
          minimum: 0
          title: Demand Variability
          description: >-
            Standard deviation of missed demand across different hours (measure
            of consistency)
          examples:
            - 2.1
            - 4.5
            - 7.8
        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_demand
        - peak_demand
        - demand_variability
        - ebike_ratio
      title: StationDemandMetrics
      description: Station demand-specific metrics with missed demand estimations.
  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.