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

# /omio/routes

> Get an overview of an Omio route (mode, origin and destination city): the departure and arrival places (name, country and city codes, Omio position ids), total distance and duration, cheapest price and mode, all available modes and operating providers, the aggregate traveller rating and offer count, a per-mode comparison (train vs bus vs flight: cheapest and average price, duration, CO2 range, directness, popularity and speed flags) and a provider breakdown with per-provider cheapest price, frequency and detail page links. Origin and destination are city slugs as used in Omio route URLs.

**Price:** 20 credits

**⚠️ Common errors:** 412: No route found for the given mode, origin and destination



## OpenAPI

````yaml /openapi/travel-hospitality.json post /api/omio/routes
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/omio/routes:
    post:
      tags:
        - /omio
      summary: /omio/routes
      description: >-
        Get an overview of an Omio route (mode, origin and destination city):
        the departure and arrival places (name, country and city codes, Omio
        position ids), total distance and duration, cheapest price and mode, all
        available modes and operating providers, the aggregate traveller rating
        and offer count, a per-mode comparison (train vs bus vs flight: cheapest
        and average price, duration, CO2 range, directness, popularity and speed
        flags) and a provider breakdown with per-provider cheapest price,
        frequency and detail page links. Origin and destination are city slugs
        as used in Omio route URLs.


        **Price:** 20 credits


        **⚠️ Common errors:** 412: No route found for the given mode, origin and
        destination
      operationId: __api_omio_routes_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OmioRoutePayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OmioRoute'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OmioRoutePayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        mode:
          $ref: '#/components/schemas/OmioMode'
        origin:
          type: string
          minLength: 1
        destination:
          type: string
          minLength: 1
      type: object
      required:
        - mode
        - origin
        - destination
    OmioRoute:
      properties:
        '@type':
          type: string
          default: OmioRoute
        departure_id:
          anyOf:
            - type: integer
            - type: 'null'
        arrival_id:
          anyOf:
            - type: integer
            - type: 'null'
        departure_name:
          anyOf:
            - type: string
            - type: 'null'
        arrival_name:
          anyOf:
            - type: string
            - type: 'null'
        departure_country_code:
          anyOf:
            - type: string
            - type: 'null'
        arrival_country_code:
          anyOf:
            - type: string
            - type: 'null'
        departure_city_code:
          anyOf:
            - type: string
            - type: 'null'
        arrival_city_code:
          anyOf:
            - type: string
            - type: 'null'
        travel_mode:
          anyOf:
            - type: string
            - type: 'null'
        distance_km:
          anyOf:
            - type: integer
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        cheapest_price:
          anyOf:
            - type: number
            - type: 'null'
        cheapest_mode:
          anyOf:
            - type: string
            - type: 'null'
        available_modes:
          items:
            type: string
          type: array
          default: []
        provider_names:
          items:
            type: string
          type: array
          default: []
        provider_codes:
          items:
            type: string
          type: array
          default: []
        rating:
          anyOf:
            - type: number
            - type: 'null'
        rating_count:
          anyOf:
            - type: integer
            - type: 'null'
        offer_count:
          anyOf:
            - type: integer
            - type: 'null'
        low_price:
          anyOf:
            - type: number
            - type: 'null'
        mode_comparison:
          items:
            $ref: '#/components/schemas/OmioModeComparison'
          type: array
          default: []
        providers:
          items:
            $ref: '#/components/schemas/OmioRouteProvider'
          type: array
          default: []
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    OmioMode:
      type: string
      enum:
        - train
        - bus
        - flight
        - ferry
    OmioModeComparison:
      properties:
        '@type':
          type: string
          default: OmioModeComparison
        mode:
          anyOf:
            - type: string
            - type: 'null'
        cheapest_price:
          anyOf:
            - type: number
            - type: 'null'
        average_price:
          anyOf:
            - type: number
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        direct:
          anyOf:
            - type: boolean
            - type: 'null'
        clickouts:
          anyOf:
            - type: integer
            - type: 'null'
        co2_min:
          anyOf:
            - type: number
            - type: 'null'
        co2_max:
          anyOf:
            - type: number
            - type: 'null'
        is_cheapest:
          anyOf:
            - type: boolean
            - type: 'null'
        is_fastest:
          anyOf:
            - type: boolean
            - type: 'null'
        is_most_popular:
          anyOf:
            - type: boolean
            - type: 'null'
        is_most_expensive:
          anyOf:
            - type: boolean
            - type: 'null'
        is_lowest_co2:
          anyOf:
            - type: boolean
            - type: 'null'
        most_popular_provider_code:
          anyOf:
            - type: string
            - type: 'null'
        most_popular_provider_name:
          anyOf:
            - type: string
            - type: 'null'
      type: object
    OmioRouteProvider:
      properties:
        '@type':
          type: string
          default: OmioRouteProvider
        code:
          anyOf:
            - type: string
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
        legacy_id:
          anyOf:
            - type: integer
            - type: 'null'
        cheapest_price:
          anyOf:
            - type: number
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        frequency:
          anyOf:
            - type: integer
            - type: 'null'
        clickouts:
          anyOf:
            - type: integer
            - type: 'null'
        image:
          anyOf:
            - type: string
            - type: 'null'
        page_link:
          anyOf:
            - type: string
            - type: 'null'
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````