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

# Get top flight deals

> Returns the best flight deals from the nearest airport based on the user's location. All prices are in Rove Miles.



## OpenAPI

````yaml https://api.staging.rovemiles.com/functions/v1/openapi get /flights/deals
openapi: 3.0.3
info:
  title: Rove Miles API
  version: 0.1.0
  description: Data Utils, Flights, Hotels & Miles endpoints.
servers:
  - url: https://api.staging.rovemiles.com/functions/v1
security:
  - bearerAuth: []
tags:
  - name: Data
    description: Operations related to reference data like airports and places
  - name: Flights
    description: Operations related to flight search and booking
  - name: Hotels
    description: Operations related to hotel search and booking
  - name: Miles
    description: Operations related to miles and points management
  - name: Deals
    description: Operations related to special offers and promotions for flights and hotels
paths:
  /flights/deals:
    get:
      tags:
        - Deals
      summary: Get top flight deals
      description: >-
        Returns the best flight deals from the nearest airport based on the
        user's location. All prices are in Rove Miles.
      parameters:
        - name: zipcode
          in: query
          description: >-
            The location zipcode, either `zipcode` or `ip_address` must be
            provided but not both
          schema:
            type: string
        - name: ip_address
          in: query
          description: >-
            The location ip address, either `zipcode` or `ip_address` must be
            provided but not both
          schema:
            type: string
        - name: sort
          in: query
          required: true
          description: >-
            `cheapest` to sort by lowest miles needed, `best` to sort by the
            highest cents-per-miles value
          schema:
            type: string
            enum:
              - cheapest
              - best
        - name: offset
          in: query
          description: The offset for pagination
          schema:
            type: integer
            default: 0
        - name: limit
          in: query
          description: The limit for pagination
          schema:
            type: integer
            default: 20
        - name: fare_class
          in: query
          description: >-
            The fare class to filter by, can be `Y`, `W`, `J`, `F`. If not
            provided, all fare classes are returned.
          schema:
            type: array
            items:
              type: string
              enum:
                - 'Y'
                - W
                - J
                - F
          style: form
          explode: true
        - name: destinations
          in: query
          description: >-
            The list of destination airport codes to filter by. If not provided,
            all destinations are returned.
          schema:
            type: array
            items:
              type: string
          style: form
          explode: true
      responses:
        '200':
          description: Successfully retrieved flight deals
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlightDeals'
              example:
                start_date: '2025-11-01'
                end_date: '2025-11-30'
                nearest_airport: NYC
                data:
                  - cpm: 1.32
                    date: '2025-11-05'
                    route:
                      source: virginatlantic
                      distance: 3446
                      num_days_out: 120
                      origin_region: North America
                      origin_airport: JFK
                      destination_region: Europe
                      destination_airport: LHR
                    direct: true
                    source: direct-booking
                    airlines:
                      - OG
                    fare_class: 'Y'
                    cash_price:
                      price: 250.08
                      flight_details:
                        cabin_class: economy
                        departing_at: '2025-11-05T18:15:00'
                        departure_date: '2025-11-05'
                        operating_carrier:
                          name: PLAY Airlines
                          iata_code: OG
                    city_image: >-
                      https://api.rovemiles.com/storage/v1/object/public/images/LHR/london-640x427.jpg
                    total_taxes: 0
                    mileage_cost: 19000
                    coordinates:
                      - -0.461941
                      - 51.4706
                    taxes_currency: USD
                    total_taxes_usd: 0
                    remaining_seats: 9
                pagination:
                  total: 23
                  offset: 0
                  limit: 20
                  hasMore: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    FlightDeals:
      type: object
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        nearest_airport:
          type: string
        data:
          type: array
          items:
            type: object
            properties:
              cpm:
                type: number
              date:
                type: string
                format: date
              route:
                type: object
                properties:
                  source:
                    type: string
                  distance:
                    type: integer
                  num_days_out:
                    type: integer
                  origin_region:
                    type: string
                  origin_airport:
                    type: string
                  destination_region:
                    type: string
                  destination_airport:
                    type: string
              direct:
                type: boolean
              source:
                type: string
              airlines:
                type: array
                items:
                  type: string
              fare_class:
                type: string
              cash_price:
                type: object
                properties:
                  price:
                    type: number
                  flight_details:
                    type: object
                    properties:
                      cabin_class:
                        type: string
                      departing_at:
                        type: string
                        format: date-time
                      departure_date:
                        type: string
                        format: date
                      operating_carrier:
                        type: object
                        properties:
                          name:
                            type: string
                          iata_code:
                            type: string
              city_image:
                type: string
                format: uri
              total_taxes:
                type: number
              mileage_cost:
                type: integer
              coordinates:
                type: array
                items:
                  type: number
                minItems: 2
                maxItems: 2
              taxes_currency:
                type: string
              total_taxes_usd:
                type: number
              remaining_seats:
                type: integer
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of records available
            limit:
              type: integer
              description: Number of records in current page
            offset:
              type: integer
              description: Current offset in pagination
            hasMore:
              type: boolean
              description: Whether more records are available
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 400
            message: Bad Request
    Unauthorized:
      description: Unauthorized - Invalid or missing token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            message: Unauthorized - Invalid or missing token
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 500
            message: Internal Server Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key for authentication. Add your API key to the Authorization header
        with this format: 'Bearer your_api_key_here'

````