> ## 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 Competitor Opportunity Analysis

> Identify underserved areas and expansion opportunities based on shortage patterns and demand variability. Returns a ranked list of stations with opportunity scores, priority categories, shortage rates, and geographic coordinates for competitive analysis.

**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}/competitor_opportunities
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}/competitor_opportunities:
    get:
      tags:
        - Station Based Analytics
      summary: Get Competitor Opportunity Analysis
      description: >-
        Identify underserved areas and expansion opportunities based on shortage
        patterns and demand variability. Returns a ranked list of stations with
        opportunity scores, priority categories, shortage rates, and geographic
        coordinates for competitive analysis.


        **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_competitor_opportunities
      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: >-
            Opportunity analysis retrieved. Returns a ranked list of stations
            with opportunity scores and priority categories.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompetitorOpportunitiesResponse'
        '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:
    CompetitorOpportunitiesResponse:
      properties:
        station_metrics:
          items:
            $ref: '#/components/schemas/CompetitorOpportunityStationData'
          type: array
          title: Station Metrics
          description: >-
            Comprehensive station-level opportunity metrics including
            availability patterns, capacity utilization, and scoring
          examples:
            - - avg_docks: 11.5
                avg_vehicles: 8.5
                capacity: 20
                capacity_utilization: 0.42
                demand_variability: 0.38
                ebike_ratio: 0.42
                min_vehicles: 0
                opportunity_score: 78.5
                priority_category: Medium
                shortage_frequency: 0.25
                station_id: 123
                station_latitude: 45.464664
                station_longitude: 9.18854
                station_name: Central Station
                std_vehicles: 3.2
        top_opportunities:
          items:
            $ref: '#/components/schemas/CompetitorOpportunityMetrics'
          type: array
          title: Top Opportunities
          description: >-
            Top 20 stations ranked by opportunity score, representing the best
            deployment opportunities for competitors
          examples:
            - - avg_shortage_rate: 0.45
                opportunity_score: 89.2
                priority_category: High
                station_id: 456
                station_name: Business District Hub
      type: object
      required:
        - station_metrics
        - top_opportunities
      title: CompetitorOpportunitiesResponse
      description: >-
        Competitor opportunities analysis response with comprehensive station
        metrics.
      examples:
        - station_metrics:
            - avg_docks: 24.6
              avg_vehicles: 3.1
              capacity: 30
              capacity_utilization: 0.1
              demand_variability: 0.94
              ebike_ratio: 0.28
              min_vehicles: 0
              opportunity_score: 86.5
              priority_category: High
              shortage_frequency: 0.34
              station_id: 245
              station_latitude: 45.4859
              station_longitude: 9.2045
              station_name: Stazione Centrale
              std_vehicles: 2.9
            - avg_docks: 14.1
              avg_vehicles: 5.4
              capacity: 20
              capacity_utilization: 0.27
              demand_variability: 0.59
              ebike_ratio: 0.4
              min_vehicles: 0
              opportunity_score: 64.2
              priority_category: Medium
              shortage_frequency: 0.19
              station_id: 318
              station_latitude: 45.4532
              station_longitude: 9.176
              station_name: Darsena
              std_vehicles: 3.2
          top_opportunities:
            - avg_shortage_rate: 0.34
              opportunity_score: 86.5
              priority_category: High
              station_id: 245
              station_name: Stazione Centrale
            - avg_shortage_rate: 0.19
              opportunity_score: 64.2
              priority_category: Medium
              station_id: 318
              station_name: Darsena
    CompetitorOpportunityStationData:
      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
        avg_vehicles:
          type: number
          minimum: 0
          title: Avg Vehicles
          description: Average number of vehicles available at this station
          examples:
            - 8.5
            - 12.3
            - 15.7
        std_vehicles:
          type: number
          minimum: 0
          title: Std Vehicles
          description: >-
            Standard deviation of vehicle availability (demand volatility
            indicator)
          examples:
            - 2.1
            - 4.8
            - 7.2
        min_vehicles:
          type: number
          minimum: 0
          title: Min Vehicles
          description: Minimum number of vehicles observed at this station
          examples:
            - 0
            - 2
            - 5
        capacity:
          type: number
          exclusiveMinimum: 0
          title: Capacity
          description: Total station capacity (number of docks)
          examples:
            - 20
            - 30
            - 40
        avg_docks:
          type: number
          minimum: 0
          title: Avg Docks
          description: Average number of available docks at this station
          examples:
            - 8.5
            - 12.3
            - 15.7
        shortage_frequency:
          type: number
          maximum: 1
          minimum: 0
          title: Shortage Frequency
          description: Proportion of time this station has zero vehicles available
          examples:
            - 0.05
            - 0.18
            - 0.42
        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
        capacity_utilization:
          type: number
          maximum: 1
          minimum: 0
          title: Capacity Utilization
          description: Average utilization rate of station capacity (0-1 scale)
          examples:
            - 0.65
            - 0.78
            - 0.91
        demand_variability:
          type: number
          minimum: 0
          title: Demand Variability
          description: >-
            Coefficient of variation for vehicle availability (demand
            consistency indicator)
          examples:
            - 0.25
            - 0.48
            - 0.73
        opportunity_score:
          type: number
          maximum: 100
          minimum: 0
          title: Opportunity Score
          description: Composite opportunity score (0-100 scale) for competitor deployment
          examples:
            - 25.4
            - 67.8
            - 89.2
        priority_category:
          type: string
          title: Priority Category
          description: Priority classification based on opportunity score
          examples:
            - High
            - Medium
            - Low
      type: object
      required:
        - station_id
        - station_name
        - station_latitude
        - station_longitude
        - avg_vehicles
        - std_vehicles
        - min_vehicles
        - capacity
        - avg_docks
        - shortage_frequency
        - ebike_ratio
        - capacity_utilization
        - demand_variability
        - opportunity_score
        - priority_category
      title: CompetitorOpportunityStationData
      description: Detailed competitor opportunity station data with comprehensive metrics.
    CompetitorOpportunityMetrics:
      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: 100
          minimum: 0
          title: Opportunity Score
          description: Composite opportunity score (0-100 scale) for competitor deployment
          examples:
            - 75.2
            - 83.7
            - 91.5
        priority_category:
          type: string
          title: Priority Category
          description: Priority classification based on opportunity score
          examples:
            - High
            - Medium
            - Low
        avg_shortage_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Avg Shortage Rate
          description: Average shortage frequency at this station
          examples:
            - 0.15
            - 0.28
            - 0.45
      type: object
      required:
        - station_id
        - station_name
        - opportunity_score
        - priority_category
        - avg_shortage_rate
      title: CompetitorOpportunityMetrics
      description: Simplified competitor opportunity metrics for top opportunities list.
  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.