> ## 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 Zone Growth Trends

> Zones whose daily trip activity is growing or declining, from a linear regression over the period. `growth_rate` is the weekly change of daily trips and `confidence_score` the R² of the fit; only zones with a clear trend (R² above 0.3) are listed. `feasibility` is `limited` while zones need less than 7 days of history to be included.

**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}/growth_trends
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/zone-based/{provider}/growth_trends:
    get:
      tags:
        - Zone Based Analytics
      summary: Get Zone Growth Trends
      description: >-
        Zones whose daily trip activity is growing or declining, from a linear
        regression over the period. `growth_rate` is the weekly change of daily
        trips and `confidence_score` the R² of the fit; only zones with a clear
        trend (R² above 0.3) are listed. `feasibility` is `limited` while zones
        need less than 7 days of history to be included.


        **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_growth_trends
      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: >-
            Growth trends retrieved. Growing and declining zones with rate and
            confidence.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pulse__core_api_lib__copilot__zone_based__schemas__GrowthTrendsResponse
        '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__GrowthTrendsResponse:
      properties:
        growing_zones:
          items:
            $ref: '#/components/schemas/ZoneTrendData'
          type: array
          title: Growing Zones
        declining_zones:
          items:
            $ref: '#/components/schemas/ZoneTrendData'
          type: array
          title: Declining Zones
        feasibility:
          type: string
          title: Feasibility
          examples:
            - high
            - limited
        message:
          type: string
          title: Message
      type: object
      required:
        - growing_zones
        - declining_zones
        - feasibility
        - message
      title: GrowthTrendsResponse
      examples:
        - declining_zones:
            - confidence_score: 0.44
              context:
                population: 412
                top_pois:
                  - category: sustenance
                    count: 64
                  - category: shop
                    count: 51
                  - category: tourism
                    count: 12
                transit_stops_total: 9
              data_points: 31
              geom:
                coordinates:
                  - - - 9.18869
                      - 45.46417
                    - - 9.19006
                      - 45.46417
                    - - 9.19006
                      - 45.46555
                    - - 9.18869
                      - 45.46555
                    - - 9.18869
                      - 45.46417
                type: Polygon
              growth_rate: -2.1
              trend_direction: declining
              zone_id: u0nd9he
              zone_label: u0nd9he
              zone_latitude: 45.46486
              zone_longitude: 9.18938
          feasibility: limited
          growing_zones:
            - confidence_score: 0.68
              context:
                population: 980
                top_pois:
                  - category: sustenance
                    count: 47
                  - category: leisure
                    count: 6
                transit_stops_total: 4
              data_points: 31
              geom:
                coordinates:
                  - - - 9.17496
                      - 45.45181
                    - - 9.17633
                      - 45.45181
                    - - 9.17633
                      - 45.45319
                    - - 9.17496
                      - 45.45319
                    - - 9.17496
                      - 45.45181
                type: Polygon
              growth_rate: 3.4
              trend_direction: growing
              zone_id: u0nd8f3
              zone_label: u0nd8f3
              zone_latitude: 45.4525
              zone_longitude: 9.17564
          message: >-
            Growth from daily trip-activity regression (weekly rate, R²>0.3, min
            3 days). Confidence improves as history accumulates.
    ZoneTrendData:
      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
        trend_direction:
          type: string
          title: Trend Direction
          examples:
            - growing
            - declining
            - stable
        growth_rate:
          type: number
          title: Growth Rate
          description: Weekly growth rate of daily trip activity
        confidence_score:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence Score
          description: R-squared of the fit
        data_points:
          type: integer
          minimum: 0
          title: Data Points
          description: Number of days in the regression
      type: object
      required:
        - zone_id
        - zone_label
        - zone_latitude
        - zone_longitude
        - trend_direction
        - growth_rate
        - confidence_score
        - data_points
      title: ZoneTrendData
    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.