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

# /google/flights/search

> Search flight itineraries between two airports for a date with optional return, cabin, and stops

**Price:** 5 credits per 20 results

**⚠️ Common errors:** 412: No flights found for the given route and date



## OpenAPI

````yaml /openapi/travel-hospitality.json post /api/google/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/google/flights/search:
    post:
      tags:
        - /google/flights
      summary: /google/flights/search
      description: >-
        Search flight itineraries between two airports for a date with optional
        return, cabin, and stops


        **Price:** 5 credits per 20 results


        **⚠️ Common errors:** 412: No flights found for the given route and date
      operationId: __api_google_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/GoogleFlightsSearchPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GoogleFlightsItinerary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GoogleFlightsSearchPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        origin:
          type: string
          pattern: ^[A-Za-z]{3}$
        destination:
          type: string
          pattern: ^[A-Za-z]{3}$
        depart_date:
          type: string
        return_date:
          anyOf:
            - type: string
            - type: 'null'
        adults:
          type: integer
          maximum: 9
          minimum: 1
          default: 1
        cabin:
          $ref: '#/components/schemas/GoogleFlightsCabin'
          default: economy
        stops:
          $ref: '#/components/schemas/GoogleFlightsStops'
          default: any
        count:
          type: integer
          minimum: 1
      type: object
      required:
        - origin
        - destination
        - depart_date
        - count
    GoogleFlightsItinerary:
      properties:
        '@type':
          type: string
          default: GoogleFlightsItinerary
        price:
          anyOf:
            - type: number
            - type: 'null'
        currency:
          type: string
          default: USD
        airline:
          anyOf:
            - type: string
            - type: 'null'
        carrier:
          anyOf:
            - type: string
            - type: 'null'
        origin:
          type: string
        destination:
          type: string
        departure_at:
          anyOf:
            - type: string
            - type: 'null'
        arrival_at:
          anyOf:
            - type: string
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        stops:
          type: integer
          default: 0
        layovers:
          items:
            $ref: '#/components/schemas/GoogleFlightsLayover'
          type: array
          default: []
        segments:
          items:
            $ref: '#/components/schemas/GoogleFlightsSegment'
          type: array
          default: []
        co2_grams:
          anyOf:
            - type: integer
            - type: 'null'
        co2_typical_grams:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - origin
        - destination
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    GoogleFlightsCabin:
      type: string
      enum:
        - economy
        - premium_economy
        - business
        - first
    GoogleFlightsStops:
      type: string
      enum:
        - any
        - nonstop
    GoogleFlightsLayover:
      properties:
        '@type':
          type: string
          default: GoogleFlightsLayover
        airport:
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
        city:
          anyOf:
            - type: string
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - airport
    GoogleFlightsSegment:
      properties:
        '@type':
          type: string
          default: GoogleFlightsSegment
        carrier:
          anyOf:
            - type: string
            - type: 'null'
        flight_number:
          anyOf:
            - type: string
            - type: 'null'
        airline:
          anyOf:
            - type: string
            - type: 'null'
        origin:
          type: string
        origin_name:
          anyOf:
            - type: string
            - type: 'null'
        destination:
          type: string
        destination_name:
          anyOf:
            - type: string
            - type: 'null'
        departure_at:
          anyOf:
            - type: string
            - type: 'null'
        arrival_at:
          anyOf:
            - type: string
            - type: 'null'
        duration_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        aircraft:
          anyOf:
            - type: string
            - type: 'null'
        legroom:
          anyOf:
            - type: string
            - type: 'null'
      type: object
      required:
        - origin
        - destination
    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

````