> ## 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.

# /hopper/flights/search

> Search Hopper flights between an origin and destination (IATA airport codes or city codes) for a departure date, and a return date for round trips, for a given passenger mix (adults, children, seat infants, lap infants). Optionally filter by airlines, maximum stops and maximum price, and choose the ordering. Returns flight itineraries, each with the cheapest total price (base fare and taxes/fees), currency, the outbound and return slices (origin, destination, departure and arrival times, duration, stops and per-segment airline and flight number), and the list of available fare brands with their prices, cabin and remaining seats. Resolve codes via the locations search (kind=flight).

**Price:** 20 credits

**⚠️ Common errors:** 412: No flights found for this route and dates



## OpenAPI

````yaml /openapi/travel-hospitality.json post /api/hopper/flights/search
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/hopper/flights/search:
    post:
      tags:
        - /hopper
      summary: /hopper/flights/search
      description: >-
        Search Hopper flights between an origin and destination (IATA airport
        codes or city codes) for a departure date, and a return date for round
        trips, for a given passenger mix (adults, children, seat infants, lap
        infants). Optionally filter by airlines, maximum stops and maximum
        price, and choose the ordering. Returns flight itineraries, each with
        the cheapest total price (base fare and taxes/fees), currency, the
        outbound and return slices (origin, destination, departure and arrival
        times, duration, stops and per-segment airline and flight number), and
        the list of available fare brands with their prices, cabin and remaining
        seats. Resolve codes via the locations search (kind=flight).


        **Price:** 20 credits


        **⚠️ Common errors:** 412: No flights found for this route and dates
      operationId: __api_hopper_flights_search_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HopperFlightsSearchPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HopperFlightItinerary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HopperFlightsSearchPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        origin:
          type: string
          minLength: 1
        destination:
          type: string
          minLength: 1
        departure_date:
          type: string
          format: date
        return_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        trip_type:
          $ref: '#/components/schemas/HopperTripType'
          default: round_trip
        origin_type:
          $ref: '#/components/schemas/HopperFlightLocationType'
          default: airport
        destination_type:
          $ref: '#/components/schemas/HopperFlightLocationType'
          default: airport
        adults:
          type: integer
          maximum: 9
          minimum: 1
          default: 1
        children:
          type: integer
          maximum: 8
          minimum: 0
          default: 0
        seat_infants:
          type: integer
          maximum: 8
          minimum: 0
          default: 0
        lap_infants:
          type: integer
          maximum: 8
          minimum: 0
          default: 0
        airlines:
          items:
            type: string
          type: array
          default: []
        max_stops:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
        max_price:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
        sort:
          $ref: '#/components/schemas/HopperFlightSort'
          default: recommended
        count:
          type: integer
          minimum: 1
      type: object
      required:
        - origin
        - destination
        - departure_date
        - count
    HopperFlightItinerary:
      properties:
        '@type':
          type: string
          default: HopperFlightItinerary
        trip_id:
          type: string
        price:
          anyOf:
            - type: number
            - type: 'null'
        base_amount:
          anyOf:
            - type: number
            - type: 'null'
        taxes_and_fees:
          anyOf:
            - type: number
            - type: 'null'
        currency:
          anyOf:
            - type: string
            - type: 'null'
        outbound:
          anyOf:
            - $ref: '#/components/schemas/HopperFlightSlice'
            - type: 'null'
        inbound:
          anyOf:
            - $ref: '#/components/schemas/HopperFlightSlice'
            - type: 'null'
        fares:
          items:
            $ref: '#/components/schemas/HopperFlightFare'
          type: array
          default: []
      type: object
      required:
        - trip_id
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    HopperTripType:
      type: string
      enum:
        - round_trip
        - one_way
    HopperFlightLocationType:
      type: string
      enum:
        - airport
        - city
    HopperFlightSort:
      type: string
      enum:
        - recommended
        - price_low
        - price_high
    HopperFlightSlice:
      properties:
        '@type':
          type: string
          default: HopperFlightSlice
        origin:
          anyOf:
            - type: string
            - type: 'null'
        destination:
          anyOf:
            - type: string
            - type: 'null'
        departure:
          anyOf:
            - type: string
            - type: 'null'
        arrival:
          anyOf:
            - type: string
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        stops:
          anyOf:
            - type: integer
            - type: 'null'
        segments:
          items:
            $ref: '#/components/schemas/HopperFlightSegment'
          type: array
          default: []
      type: object
    HopperFlightFare:
      properties:
        '@type':
          type: string
          default: HopperFlightFare
        brand_name:
          anyOf:
            - type: string
            - type: 'null'
        cabin:
          anyOf:
            - type: string
            - type: 'null'
        available_seats:
          anyOf:
            - type: integer
            - type: 'null'
        price:
          anyOf:
            - type: number
            - type: 'null'
        base_amount:
          anyOf:
            - type: number
            - type: 'null'
        taxes_and_fees:
          anyOf:
            - type: number
            - type: 'null'
        currency:
          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
    HopperFlightSegment:
      properties:
        '@type':
          type: string
          default: HopperFlightSegment
        origin:
          anyOf:
            - type: string
            - type: 'null'
        destination:
          anyOf:
            - type: string
            - type: 'null'
        marketing_airline:
          anyOf:
            - type: string
            - type: 'null'
        operating_airline:
          anyOf:
            - type: string
            - type: 'null'
        flight_number:
          anyOf:
            - type: string
            - type: 'null'
        departure:
          anyOf:
            - type: string
            - type: 'null'
        arrival:
          anyOf:
            - type: string
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        layover_minutes:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````