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

# Positions By Trip Id

> This endpoint returns the Positions for a Trip.

You can enable OSM road classification by passing through include_osm_road_classification=true.

The response is paginated, so if the next link is not null, use that link to get the next page of results.



## OpenAPI

````yaml openapi_2024-03-26 get /trip/{trip_id}/position
openapi: 3.1.0
info:
  title: FastAPI
  version: '2024-03-26'
servers:
  - url: https://api.pathstack.io
    description: PathStack production environment
security: []
paths:
  /trip/{trip_id}/position:
    get:
      tags:
        - Positions
      summary: Positions By Trip Id
      description: >-
        This endpoint returns the Positions for a Trip.


        You can enable OSM road classification by passing through
        include_osm_road_classification=true.


        The response is paginated, so if the next link is not null, use that
        link to get the next page of results.
      operationId: positions_by_trip_id_trip__trip_id__position_get
      parameters:
        - name: trip_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Trip ID
            description: Trip ID of the Positions to be returned
          description: Trip ID of the Positions to be returned
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            title: Page number
            description: Page number for pagination (zero-indexed)
            default: 0
          description: Page number for pagination (zero-indexed)
        - name: include_osm_road_classification
          in: query
          required: false
          schema:
            type: boolean
            title: Include OpenStreetMap road classification
            description: >-
              Return road name and distance from the road centreline for points
              which lie on a road. Values are null if the point is not on a
              road.
            default: false
          description: >-
            Return road name and distance from the road centreline for points
            which lie on a road. Values are null if the point is not on a road.
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            format: date
            default: '2024-03-26'
            title: X-Api-Version
          examples:
            default:
              value: '2024-03-26'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSuccess_list_PointWithFeatures__'
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                        title: Error code
                      message:
                        type: string
                        example: Invalid JWT format
                        title: Error message
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 401
                        title: Error code
                      message:
                        type: string
                        example: >-
                          Authentication header is missing, or token is
                          invalid/expired.
                        title: Error message
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 403
                        title: Error code
                      message:
                        type: string
                        example: You do not have access to this resource
                        title: Error message
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 404
                        title: Error code
                      message:
                        type: string
                        example: Trip with ID <trip_id> not found
                        title: Error message
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 422
                        title: Error code
                      message:
                        type: string
                        example: Field required
                        title: Error message
                      loc:
                        items:
                          anyOf:
                            - type: string
                            - type: integer
                        type: array
                        title: Location
                      msg:
                        type: string
                        title: Message
                      type:
                        type: string
                        title: Error Type
          description: Unprocessable Entity
      security:
        - JWTBearer: []
components:
  schemas:
    PaginatedSuccess_list_PointWithFeatures__:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PointWithFeatures'
          type: array
          title: Data
          description: Successful response payload
        links:
          $ref: '#/components/schemas/PaginationLinks'
      type: object
      required:
        - data
        - links
      title: PaginatedSuccess[list[PointWithFeatures]]
    PointWithFeatures:
      properties:
        latitude:
          type: number
          title: Latitude
        longitude:
          type: number
          title: Longitude
        time:
          type: string
          title: Time
        speed_kilometres_per_hour:
          anyOf:
            - type: number
            - type: 'null'
          title: Speed Kilometres Per Hour
        hdop:
          anyOf:
            - type: number
            - type: 'null'
          title: Hdop
        vdop:
          anyOf:
            - type: number
            - type: 'null'
          title: Vdop
        number_of_satellites:
          anyOf:
            - type: integer
            - type: 'null'
          title: Number Of Satellites
        heading:
          anyOf:
            - type: number
            - type: 'null'
          title: Heading
        odometer_kilometres:
          anyOf:
            - type: number
            - type: 'null'
          title: Odometer reading at this point
        odometer_distance_metres:
          anyOf:
            - type: number
            - type: 'null'
          title: >-
            Distance travelled between this point and the previous point
            calculated with odometer readings
        gps_distance_metres:
          anyOf:
            - type: number
            - type: 'null'
          title: >-
            Distance travelled between this point and the previous point
            calculated by GPS distance using WGS84
        id:
          type: string
          format: uuid4
          title: Id
        trip_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Trip Id
        device_id:
          type: string
          format: uuid4
          title: Device Id
        osm_road_classification:
          anyOf:
            - $ref: '#/components/schemas/OsmRoadClassification'
            - type: 'null'
      type: object
      required:
        - latitude
        - longitude
        - time
        - speed_kilometres_per_hour
        - hdop
        - vdop
        - number_of_satellites
        - heading
        - odometer_kilometres
        - odometer_distance_metres
        - gps_distance_metres
        - id
        - trip_id
        - device_id
      title: PointWithFeatures
    PaginationLinks:
      properties:
        previous:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous
        current:
          anyOf:
            - type: string
            - type: 'null'
          title: Current
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
      type: object
      title: PaginationLinks
    OsmRoadClassification:
      properties:
        road_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Road Name
        on_road:
          type: boolean
          title: On Road
          default: false
        distance_from_road_metres:
          anyOf:
            - type: number
            - type: 'null'
          title: Distance From Road Metres
      type: object
      title: OsmRoadClassification
  securitySchemes:
    JWTBearer:
      type: http
      scheme: bearer

````