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

# route

> Find the fastest route between coordinates in order



## OpenAPI

````yaml /openapi/openapi.json get /route/v1/{profile}/{coordinates}
openapi: 3.1.0
info:
  title: JustRouting API
  version: v1
  description: >-
    OSRM-compatible routing services (route, table, match, trip, nearest) and a
    hosted VROOM vehicle routing solver (optimize). All requests require a
    Bearer API key. Coordinates use `lng,lat` order and must be within a single
    country (Southeast Asia).
  contact:
    email: hello@justrouting.tech
    name: JustRouting
    url: https://justrouting.tech
servers:
  - url: https://api.justrouting.tech
    description: Production
security:
  - bearerAuth: []
tags:
  - name: route
    description: Directions between coordinates
  - name: table
    description: NxN travel time/distance matrix
  - name: match
    description: Map matching for GPS traces
  - name: trip
    description: Traveling salesman optimization
  - name: nearest
    description: Snap a coordinate to the road network
  - name: optimize
    description: Hosted VROOM vehicle routing solver
  - name: geocode
    description: 'Forward geocoding: place name or address into coordinates'
paths:
  /route/v1/{profile}/{coordinates}:
    get:
      tags:
        - route
      summary: Find the fastest route between coordinates in order
      operationId: getRoute
      parameters:
        - name: profile
          in: path
          required: true
          schema:
            type: string
            enum:
              - driving
              - motorcycle
          description: Vehicle profile. `driving` for cars, `motorcycle` for motorcycles.
        - name: coordinates
          in: path
          required: true
          schema:
            type: string
          description: >-
            Semicolon-separated `{lng},{lat}` pairs, up to 100, visited in
            order. All coordinates must be in the same country.
          example: 103.708362,1.357371;103.984748,1.352212
        - $ref: '#/components/parameters/Overview'
        - $ref: '#/components/parameters/Steps'
        - $ref: '#/components/parameters/Alternatives'
        - $ref: '#/components/parameters/Geometries'
        - $ref: '#/components/parameters/Annotations'
        - $ref: '#/components/parameters/ContinueStraight'
        - $ref: '#/components/parameters/Bearings'
        - $ref: '#/components/parameters/Radiuses'
        - $ref: '#/components/parameters/Hints'
        - $ref: '#/components/parameters/Exclude'
        - $ref: '#/components/parameters/Approaches'
        - $ref: '#/components/parameters/Snapping'
        - $ref: '#/components/parameters/GenerateHints'
        - $ref: '#/components/parameters/SkipWaypoints'
        - $ref: '#/components/parameters/Waypoints'
      responses:
        '200':
          description: Route found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OsrmError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '429':
          description: Rate limited
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining today
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
components:
  parameters:
    Overview:
      name: overview
      in: query
      schema:
        type: string
        enum:
          - full
          - simplified
          - 'false'
          - by_legs
        default: simplified
      description: How much route geometry to return.
    Steps:
      name: steps
      in: query
      schema:
        type: boolean
        default: false
      description: Return turn-by-turn steps.
    Alternatives:
      name: alternatives
      in: query
      schema:
        type: string
      description: >-
        `true` for one alternative, or a number for up to that many (not
        guaranteed).
    Geometries:
      name: geometries
      in: query
      schema:
        type: string
        enum:
          - polyline
          - polyline6
          - geojson
        default: polyline
      description: Geometry encoding of the response.
    Annotations:
      name: annotations
      in: query
      schema:
        type: string
      description: >-
        Per-coordinate metadata: `true`, or a comma list of `distance`,
        `duration`, `speed`, `weight`, `nodes`, `datasources`.
    ContinueStraight:
      name: continue_straight
      in: query
      schema:
        type: string
        enum:
          - default
          - 'true'
          - 'false'
        default: default
      description: Force straight continuation at waypoints, constraining U-turns.
    Bearings:
      name: bearings
      in: query
      schema:
        type: string
      description: '`{bearing},{range};...` per coordinate, e.g. `0,20` = north ±20°.'
    Radiuses:
      name: radiuses
      in: query
      schema:
        type: string
      description: Snapping radius in meters per coordinate, or `unlimited`.
    Hints:
      name: hints
      in: query
      schema:
        type: string
      description: Base64 hints from a previous response to speed up snapping.
    Exclude:
      name: exclude
      in: query
      schema:
        type: string
      description: Road classes to avoid (additive list), e.g. `motorway`.
    Approaches:
      name: approaches
      in: query
      schema:
        type: string
      description: >-
        Restrict the road direction at each waypoint: `curb` / `opposite` /
        `unrestricted` (default), e.g. `curb;opposite`.
    Snapping:
      name: snapping
      in: query
      schema:
        type: string
        enum:
          - default
          - any
        default: default
      description: >-
        `default` avoids edges that cannot be used as start/end points; `any`
        snaps to any edge in the graph.
    GenerateHints:
      name: generate_hints
      in: query
      schema:
        type: boolean
        default: true
      description: Add a `hint` to response waypoints for reuse in later requests.
    SkipWaypoints:
      name: skip_waypoints
      in: query
      schema:
        type: boolean
        default: false
      description: Remove waypoints from the response (still calculated, not serialized).
    Waypoints:
      name: waypoints
      in: query
      schema:
        type: string
      description: >-
        Indices of input coordinates to treat as waypoints in the response, e.g.
        `0;3`. Default is all input coordinates.
  schemas:
    RouteResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - Ok
        data_version:
          type: string
          description: Timestamp of the OSM data used.
        routes:
          type: array
          items:
            $ref: '#/components/schemas/OsrmRoute'
        waypoints:
          type: array
          items:
            $ref: '#/components/schemas/Waypoint'
    OsrmError:
      type: object
      properties:
        code:
          type: string
          enum:
            - InvalidUrl
            - InvalidService
            - InvalidVersion
            - InvalidOptions
            - InvalidQuery
            - InvalidValue
            - NoSegment
            - NoRoute
            - NoTable
            - NoMatch
            - NoTrips
            - TooBig
            - DisabledDataset
            - NotImplemented
        message:
          type: string
    AuthError:
      type: object
      properties:
        error:
          type: string
          description: '`missing Authorization header` or `invalid or revoked API key`.'
    RateLimitError:
      type: object
      properties:
        code:
          type: string
          enum:
            - rate_limited
        message:
          type: string
    OsrmRoute:
      type: object
      properties:
        distance:
          type: number
          description: Total distance in meters.
        duration:
          type: number
          description: Total duration in seconds.
        weight:
          type: number
        weight_name:
          type: string
          example: routability
        geometry:
          oneOf:
            - type: string
              description: Encoded polyline (precision 5 or 6).
            - type: object
              description: GeoJSON LineString when geometries=geojson.
              required:
                - type
                - coordinates
              properties:
                type:
                  type: string
                  enum:
                    - LineString
                coordinates:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
        legs:
          type: array
          items:
            $ref: '#/components/schemas/RouteLeg'
    Waypoint:
      type: object
      properties:
        name:
          type: string
          description: Street name the coordinate snapped to.
        location:
          type: array
          items:
            type: number
          minItems: 2
          maxItems: 2
          description: Snapped position as `[lng, lat]`.
        distance:
          type: number
          description: Snapping offset in meters.
        hint:
          type: string
          description: Opaque segment identifier, reusable as the `hints` parameter.
        nodes:
          type: array
          items:
            type: integer
          description: OSM node ids of the segment.
    RouteLeg:
      type: object
      properties:
        distance:
          type: number
          description: Meters.
        duration:
          type: number
          description: Seconds.
        weight:
          type: number
        summary:
          type: string
        steps:
          type: array
          items:
            $ref: '#/components/schemas/RouteStep'
        annotation:
          $ref: '#/components/schemas/Annotation'
    RouteStep:
      type: object
      properties:
        distance:
          type: number
          description: Meters.
        duration:
          type: number
          description: Seconds.
        weight:
          type: number
        geometry:
          type: string
          description: Polyline geometry.
        name:
          type: string
        ref:
          type: string
        pronunciation:
          type: string
          description: IPA phonetic transcription of the name.
        destinations:
          type: string
          description: Destinations of the way.
        exits:
          type: string
          description: Exit numbers or names of the way.
        mode:
          type: string
        driving_side:
          type: string
          enum:
            - left
            - right
        rotary_name:
          type: string
        rotary_pronunciation:
          type: string
        maneuver:
          $ref: '#/components/schemas/StepManeuver'
        intersections:
          type: array
          items:
            $ref: '#/components/schemas/Intersection'
    Annotation:
      type: object
      properties:
        distance:
          type: array
          items:
            type: number
        duration:
          type: array
          items:
            type: number
        weight:
          type: array
          items:
            type: number
        speed:
          type: array
          items:
            type: number
        nodes:
          type: array
          items:
            type: integer
        datasources:
          type: array
          items:
            type: integer
        metadata:
          type: object
          properties:
            datasource_names:
              type: array
              items:
                type: string
    StepManeuver:
      type: object
      properties:
        location:
          type: array
          items:
            type: number
          description: '[lng, lat]'
        bearing_before:
          type: integer
        bearing_after:
          type: integer
        type:
          type: string
          description: >-
            turn, new name, depart, arrive, merge, on ramp, off ramp, fork, end
            of road, continue, roundabout, rotary, roundabout turn,
            notification, exit roundabout, exit rotary
        modifier:
          type: string
          enum:
            - uturn
            - sharp right
            - right
            - slight right
            - straight
            - slight left
            - left
            - sharp left
        exit:
          type: integer
          description: >-
            Number of the roundabout/rotary exit to take; absent when the
            destination is on the roundabout.
    Intersection:
      type: object
      properties:
        location:
          type: array
          items:
            type: number
          minItems: 2
          maxItems: 2
          description: '[lng, lat]'
        bearings:
          type: array
          items:
            type: integer
          description: Bearings of all roads at the intersection, 0-359 (0 = true north).
        classes:
          type: array
          items:
            type: string
          description: Road classes of the exiting roads.
        entry:
          type: array
          items:
            type: boolean
          description: >-
            Flags 1:1 with bearings; true means the road can be entered on a
            valid route.
        in:
          type: integer
          description: Index into bearings of the road you came from; absent for depart.
        out:
          type: integer
          description: Index into bearings of the road you take; absent for arrive.
        lanes:
          type: array
          items:
            $ref: '#/components/schemas/Lane'
          description: Available turn lanes; absent when there is no lane data.
    Lane:
      type: object
      properties:
        indications:
          type: array
          items:
            type: string
            enum:
              - none
              - uturn
              - sharp right
              - right
              - slight right
              - straight
              - slight left
              - left
              - sharp left
          description: Markings for the lane; a lane can have several.
        valid:
          type: boolean
          description: Whether the lane is a valid choice in the current maneuver.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key created in the JustRouting dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.