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

# Get Route Telemetry

> Returns paginated segment-level physics data (grade, curvature, fuel burn) for a completed route.

<Note>Telemetry is only available for routes with `status: "complete"`. Requesting telemetry for a `processing` route returns a `404` with a helpful error message.</Note>


## OpenAPI

````yaml GET /v1/routes/{route_id}/telemetry
openapi: 3.1.0
info:
  title: Motion Freight Router API
  description: >-
    Drop-in replacement for Google Routes API with segment-level physics
    enrichment for heavy freight. Provides both a Google-compatible synchronous
    endpoint and stateful route management endpoints.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: http://localhost:8000
    description: Local development
security: []
tags:
  - name: Google-Compatible
    description: Drop-in replacement for Google Routes API. Same request/response format.
  - name: Routes
    description: Stateful route management with sync/async computation.
  - name: Telemetry
    description: Segment-level physics telemetry data (grade, curvature, fuel burn).
  - name: Health
    description: API health and status.
paths:
  /v1/routes/{route_id}/telemetry:
    get:
      tags:
        - Telemetry
      summary: Get Route Telemetry
      description: >-
        Returns paginated segment-level physics data (grade, curvature, fuel
        burn) for a completed route.
      operationId: getRouteTelemetry
      parameters:
        - name: route_id
          in: path
          required: true
          description: The unique route resource ID
          schema:
            type: string
            example: route_01HYX3MPK5XJQJG0NB0PRSDVWC
        - name: cursor
          in: query
          required: false
          description: Pagination cursor (segment index offset). Defaults to 0.
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: limit
          in: query
          required: false
          description: >-
            Maximum number of segments to return per page. Defaults to 50, max
            200.
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
      responses:
        '200':
          description: Telemetry data for the route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelemetryResponse'
        '400':
          description: Route computation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  type: routing_error
                  code: route_failed
                  message: Route computation failed.
                  param: route_id
                  doc_url: null
        '404':
          description: Route not found, still processing, or no telemetry available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_found:
                  summary: Route not found
                  value:
                    error:
                      type: invalid_request_error
                      code: route_not_found
                      message: Route not found.
                      param: route_id
                      doc_url: null
                still_processing:
                  summary: Route still processing
                  value:
                    error:
                      type: invalid_request_error
                      code: route_processing
                      message: >-
                        Route is still processing. Poll GET
                        /v1/routes/{route_id} until status is 'complete'.
                      param: route_id
                      doc_url: null
                no_telemetry:
                  summary: No telemetry data available
                  value:
                    error:
                      type: invalid_request_error
                      code: no_telemetry
                      message: No telemetry data available for this route.
                      param: null
                      doc_url: null
components:
  schemas:
    TelemetryResponse:
      type: object
      description: Full telemetry response with summary and per-segment data
      properties:
        routeId:
          type: string
          description: Associated route ID
        computedAt:
          type: string
          format: date-time
          description: When telemetry was computed
        vehicleSpec:
          type: object
          description: Resolved vehicle specification used for computation
        summary:
          $ref: '#/components/schemas/TelemetrySummary'
        segments:
          type: array
          items:
            $ref: '#/components/schemas/TelemetrySegment'
          description: Paginated segment telemetry data
        hasMore:
          type: boolean
          default: false
          description: Whether more segments are available
        nextCursor:
          type: string
          nullable: true
          description: Cursor for the next page of segments
      required:
        - routeId
        - computedAt
        - vehicleSpec
        - summary
        - segments
    ErrorResponse:
      type: object
      description: Structured error response.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
    TelemetrySummary:
      type: object
      description: Aggregated telemetry summary for the entire route
      properties:
        totalFuelBurnLiters:
          type: number
          nullable: true
          description: Total estimated fuel burn in liters
        totalGradeGainMeters:
          type: number
          nullable: true
          description: Total elevation gain in meters
        totalGradeLossMeters:
          type: number
          nullable: true
          description: Total elevation loss in meters
        maxGradePercent:
          type: number
          nullable: true
          description: Maximum grade percentage on the route
        averageCurvatureDegreesPerKm:
          type: number
          nullable: true
          description: Average curvature across the route
        schoolZoneCount:
          type: integer
          default: 0
          description: Number of segments passing through school zones
        residentialSegmentCount:
          type: integer
          default: 0
          description: Number of segments in residential areas
    TelemetrySegment:
      type: object
      description: Telemetry data for a single route segment
      properties:
        index:
          type: integer
          description: Segment index
        startLocation:
          type: object
          properties:
            latLng:
              $ref: '#/components/schemas/LatLng'
        endLocation:
          type: object
          properties:
            latLng:
              $ref: '#/components/schemas/LatLng'
        distanceMeters:
          type: integer
          description: Segment distance in meters
        durationSeconds:
          type: integer
          description: Segment duration in seconds
        gradePercent:
          type: number
          nullable: true
          description: Road grade percentage
        curvatureDegreesPerKm:
          type: number
          nullable: true
          description: Curvature in degrees per km
        fuelBurnLiters:
          type: number
          nullable: true
          description: Estimated fuel burn in liters
        zoneFlags:
          type: array
          items:
            type: string
          description: Active zone flags (SCHOOL_ZONE, RESIDENTIAL)
        speedLimitKmh:
          type: number
          nullable: true
          description: Speed limit in km/h
        roadClass:
          type: string
          nullable: true
          description: Road classification
    ErrorDetail:
      type: object
      description: Error detail object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
            - routing_error
            - rate_limit_error
            - api_error
            - enrichment_error
          description: Error type category
        code:
          type: string
          description: Machine-readable error code
          example: route_not_found
        message:
          type: string
          description: Human-readable error message
        param:
          type: string
          nullable: true
          description: The parameter that caused the error
        doc_url:
          type: string
          nullable: true
          description: URL to relevant documentation
      required:
        - type
        - code
        - message
    LatLng:
      type: object
      description: A latitude/longitude coordinate pair
      properties:
        latitude:
          type: number
          format: double
          description: Latitude in degrees
          example: 41.878
        longitude:
          type: number
          format: double
          description: Longitude in degrees
          example: -87.636
      required:
        - latitude
        - longitude

````