> ## 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 Zone Trip Volume

> Trip starts and ends per zone and per hour of the day for a free-floating service, from recorded trips. Zones are geohash cells (default precision 7, about 150 m) with their centroid, boundary and, when available, population, public-transit stops and top points of interest. Zones are sorted by total trips.

**Failure Modes:**
- **400**: `precision` given with a zoning system other than `geohash7`
- **401**: Token is missing or invalid
- **403**: Insufficient permissions
- **404**: `no_data_binding` when the provider or location is not enabled for your company
- **422**: Invalid filter parameters

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



## OpenAPI

````yaml /api-reference/openapi.json get /copilot/zone-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://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/zone-based/{provider}/trip_volume:
    get:
      tags:
        - Zone Based Analytics
      summary: Get Zone Trip Volume
      description: >-
        Trip starts and ends per zone and per hour of the day for a
        free-floating service, from recorded trips. Zones are geohash cells
        (default precision 7, about 150 m) with their centroid, boundary and,
        when available, population, public-transit stops and top points of
        interest. Zones are sorted by total trips.


        **Failure Modes:**

        - **400**: `precision` given with a zoning system other than `geohash7`

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

        - **403**: Insufficient permissions

        - **404**: `no_data_binding` when the provider or location is not
        enabled for your company

        - **422**: Invalid filter parameters


        **Required Auth Scopes:**

        - `copilot:analytics`
      operationId: get_zone_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 zone-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 zone-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 zone-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 zone-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: >-
              First day of the analysis period (ISO 8601, e.g.
              `2026-10-01T00:00:00Z`). Only the date part is used, as a UTC day.
            title: Start Date
          description: >-
            First day of the analysis period (ISO 8601, e.g.
            `2026-10-01T00:00:00Z`). Only the date part is used, as a UTC day.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              Last day of the analysis period, included (ISO 8601, e.g.
              `2026-10-31T00:00:00Z`). Only the date part is used, as a UTC day.
            title: End Date
          description: >-
            Last day of the analysis period, included (ISO 8601, e.g.
            `2026-10-31T00:00:00Z`). Only the date part is used, as a UTC day.
        - 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, UTC), both bounds
              included. Applied only together with `end_hour`, and only by trip
              volume and shortage mapping.
            title: Start Hour
          description: >-
            First hour of the day to include (0-23, UTC), both bounds included.
            Applied only together with `end_hour`, and only by trip volume and
            shortage mapping.
        - 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, UTC). Applied only together
              with `start_hour`, and only by trip volume and shortage mapping.
            title: End Hour
          description: >-
            Last hour of the day to include (0-23, UTC). Applied only together
            with `start_hour`, and only by trip volume and shortage mapping.
        - name: zoning_system_id
          in: query
          required: false
          schema:
            type: string
            description: >-
              Zoning system the zones belong to. Defaults to `geohash7` (geohash
              cells, whose size `precision` sets).
            default: geohash7
            title: Zoning System Id
          description: >-
            Zoning system the zones belong to. Defaults to `geohash7` (geohash
            cells, whose size `precision` sets).
        - name: precision
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            maximum: 7
            minimum: 4
            description: >-
              Geohash precision to aggregate to (4-7). Only valid when
              zoning_system_id='geohash7', where it defaults to 7. Passing it
              with any other zoning system returns HTTP 400.
            title: Precision
          description: >-
            Geohash precision to aggregate to (4-7). Only valid when
            zoning_system_id='geohash7', where it defaults to 7. Passing it with
            any other zoning system returns HTTP 400.
      responses:
        '200':
          description: >-
            Trip volume retrieved. Hourly totals and per-zone trip starts and
            ends.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pulse__core_api_lib__copilot__zone_based__schemas__TripVolumeResponse
        '400':
          description: Bad Request. `precision` needs `geohash7` zoning.
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '404':
          description: Not Found. Provider or location not enabled.
        '422':
          description: Unprocessable Entity. Validation failed.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    pulse__core_api_lib__copilot__zone_based__schemas__TripVolumeResponse:
      properties:
        hourly_activity:
          items:
            $ref: '#/components/schemas/HourlyTripActivity'
          type: array
          title: Hourly Activity
        zone_total_activity:
          items:
            $ref: '#/components/schemas/ZoneTripActivity'
          type: array
          title: Zone Total Activity
        feasibility:
          type: string
          title: Feasibility
          examples:
            - high
        message:
          type: string
          title: Message
      type: object
      required:
        - hourly_activity
        - zone_total_activity
        - feasibility
        - message
      title: TripVolumeResponse
      examples:
        - feasibility: high
          hourly_activity:
            - hour: 8
              total_trips: 2805
              trip_ends: 1385
              trip_starts: 1420
            - hour: 18
              total_trips: 3272
              trip_ends: 1662
              trip_starts: 1610
          message: >-
            Trip volume from real zone_trip_flows counts (n_trip_starts /
            n_trip_ends), aggregated to the requested geohash precision.
          zone_total_activity:
            - avg_vehicle_count: 6.2
              context:
                population: 655
                top_pois:
                  - category: transportation
                    count: 22
                  - category: sustenance
                    count: 19
                transit_stops_total: 14
              geom:
                coordinates:
                  - - - 9.2038
                      - 45.48477
                    - - 9.20517
                      - 45.48477
                    - - 9.20517
                      - 45.48615
                    - - 9.2038
                      - 45.48615
                    - - 9.2038
                      - 45.48477
                type: Polygon
              total_trips: 2214
              trip_ends: 1034
              trip_starts: 1180
              zone_id: u0ndc2q
              zone_label: u0ndc2q
              zone_latitude: 45.48546
              zone_longitude: 9.20448
            - avg_vehicle_count: 8.9
              context:
                population: 412
                top_pois:
                  - category: sustenance
                    count: 64
                  - category: shop
                    count: 51
                  - category: tourism
                    count: 12
                transit_stops_total: 9
              geom:
                coordinates:
                  - - - 9.18869
                      - 45.46417
                    - - 9.19006
                      - 45.46417
                    - - 9.19006
                      - 45.46555
                    - - 9.18869
                      - 45.46555
                    - - 9.18869
                      - 45.46417
                type: Polygon
              total_trips: 1957
              trip_ends: 995
              trip_starts: 962
              zone_id: u0nd9he
              zone_label: u0nd9he
              zone_latitude: 45.46486
              zone_longitude: 9.18938
    HourlyTripActivity:
      properties:
        hour:
          type: integer
          maximum: 23
          minimum: 0
          title: Hour
        trip_starts:
          type: number
          minimum: 0
          title: Trip Starts
        trip_ends:
          type: number
          minimum: 0
          title: Trip Ends
        total_trips:
          type: number
          minimum: 0
          title: Total Trips
      type: object
      required:
        - hour
        - trip_starts
        - trip_ends
        - total_trips
      title: HourlyTripActivity
    ZoneTripActivity:
      properties:
        zone_id:
          type: string
          title: Zone Id
          description: Geohash7 zone id
          examples:
            - u33db27
        zone_label:
          type: string
          title: Zone Label
          description: Human label (falls back to zone_id)
        zone_latitude:
          type: number
          maximum: 90
          minimum: -90
          title: Zone Latitude
          examples:
            - 52.52
        zone_longitude:
          type: number
          maximum: 180
          minimum: -180
          title: Zone Longitude
          examples:
            - 13.4
        geom:
          additionalProperties: true
          type:
            - object
            - 'null'
          title: Geom
          description: >-
            Zone boundary as a GeoJSON geometry object (e.g. Polygon /
            MultiPolygon with WGS84 lon/lat coordinates). Null when the zone has
            no stored geometry.
          examples:
            - coordinates:
                - - - 13.4
                    - 52.52
                  - - 13.41
                    - 52.52
                  - - 13.41
                    - 52.53
                  - - 13.4
                    - 52.52
              type: Polygon
        context:
          $ref: '#/components/schemas/ZoneContext'
          description: Enriched zone metadata, when available
        total_trips:
          type: number
          minimum: 0
          title: Total Trips
        trip_starts:
          type: number
          minimum: 0
          title: Trip Starts
        trip_ends:
          type: number
          minimum: 0
          title: Trip Ends
        avg_vehicle_count:
          type: number
          minimum: 0
          title: Avg Vehicle Count
      type: object
      required:
        - zone_id
        - zone_label
        - zone_latitude
        - zone_longitude
        - total_trips
        - trip_starts
        - trip_ends
        - avg_vehicle_count
      title: ZoneTripActivity
    ZoneContext:
      properties:
        population:
          type:
            - number
            - 'null'
          title: Population
          description: WorldPop latest population estimate for the zone
        transit_stops_total:
          type:
            - integer
            - 'null'
          title: Transit Stops Total
          description: Combined public-transit stop count in the zone
        top_pois:
          items:
            $ref: '#/components/schemas/ZonePoiCount'
          type: array
          title: Top Pois
          description: Top POI categories by count (max 3)
      type: object
      title: ZoneContext
      description: Key context stats enriched from the SQL layer (standard_zoning_system).
    ZonePoiCount:
      properties:
        category:
          type: string
          title: Category
          examples:
            - sustenance
            - transportation
            - education
        count:
          type: integer
          minimum: 0
          title: Count
          examples:
            - 42
            - 18
            - 7
      type: object
      required:
        - category
        - count
      title: ZonePoiCount
      description: One POI category with its count (top categories per zone).
  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.