{
 "openapi": "3.1.0",
 "info": {
  "title": "Turn Left Fares fare data",
  "version": "1.0.0",
  "description": "Whether a flight price is good, from a year of Google Flights prices per route: Business, First and Premium Economy from Australia and Asia, and Economy from Australia. Read only, no key. The same tools are on the MCP server at https://turnleftfares.com/mcp. Prices are fares we have seen, not live quotes; every answer links the page it comes from.",
  "contact": {
   "name": "Turn Left Fares",
   "url": "https://turnleftfares.com/ai",
   "email": "hello@turnleftfares.com"
  }
 },
 "servers": [
  {
   "url": "https://turnleftfares.com"
  }
 ],
 "paths": {
  "/api/v1/check-fare": {
   "get": {
    "operationId": "check_fare",
    "summary": "Check a fare",
    "description": "Use when a traveller has a flight price and asks whether it is good, cheap, a deal or worth booking, or asks what a route usually costs in Business, First, Premium Economy or Economy. Judges the price against the route's own history: the usual fare (median of up to 52 weekly medians of Google Flights prices), the good-fare bar (30% below usual), how far the price is above or below usual, the cheapest fare seen in the last 7 days, and a link to the route page.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "Where the trip starts: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "Where it goes: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "cabin",
      "in": "query",
      "required": false,
      "description": "Cabin class.",
      "schema": {
       "type": "string",
       "enum": [
        "business",
        "first",
        "premium_economy",
        "economy"
       ],
       "default": "business"
      }
     },
     {
      "name": "price",
      "in": "query",
      "required": true,
      "description": "The fare to judge, for one adult, all taxes included.",
      "schema": {
       "type": "number",
       "exclusiveMinimum": 0
      }
     },
     {
      "name": "currency",
      "in": "query",
      "required": false,
      "description": "The price's currency.",
      "schema": {
       "type": "string",
       "enum": [
        "AUD",
        "USD",
        "NZD",
        "EUR",
        "GBP"
       ],
       "default": "AUD"
      }
     },
     {
      "name": "trip",
      "in": "query",
      "required": false,
      "description": "Round trip or one way.",
      "schema": {
       "type": "string",
       "enum": [
        "round_trip",
        "one_way"
       ],
       "default": "round_trip"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer, in words and as data. `answer` is a paragraph to quote; the other fields are the same as the MCP tool's structured result.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Answer"
        }
       }
      }
     },
     "400": {
      "description": "A parameter is missing or wrong; `error` says which.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Too many calls from one address in an hour."
     }
    }
   }
  },
  "/api/v1/deals": {
   "get": {
    "operationId": "find_deals",
    "summary": "Find current deals",
    "description": "Use when someone asks for flight deals, cheap Business or First fares, or sales from a city or from Australia. Current deals, best value first, from a city, airport or 'Australia', optionally to a destination and in one cabin. A deal is a fare at least 25% below its route's usual price in Business, 30% in First, 50% in Premium Economy and 25% in Economy, re-checked before it is posted. Today's free fares come in full with their deal page; the others are counted (they are for members).",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Departing from: an IATA code, a city name, or 'Australia'.",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Going to: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "cabin",
      "in": "query",
      "required": false,
      "description": "Only this cabin (any premium cabin when left out).",
      "schema": {
       "type": "string",
       "enum": [
        "business",
        "first",
        "premium_economy",
        "economy"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "limit",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 10,
       "default": 5
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer, in words and as data. `answer` is a paragraph to quote; the other fields are the same as the MCP tool's structured result.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Answer"
        }
       }
      }
     },
     "400": {
      "description": "A parameter is missing or wrong; `error` says which.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Too many calls from one address in an hour."
     }
    }
   }
  },
  "/api/v1/best-months": {
   "get": {
    "operationId": "best_time_to_fly",
    "summary": "Cheapest months to fly",
    "description": "Use when someone asks when to fly, the cheapest month or time of year, or when fares drop on a route. The average and lowest fare by departure month on a route, from the prices we have seen, with the cheapest and dearest months named only where there are enough prices to compare.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "Where the trip starts: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": true,
      "description": "Where it goes: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "cabin",
      "in": "query",
      "required": false,
      "description": "Cabin class.",
      "schema": {
       "type": "string",
       "enum": [
        "business",
        "first",
        "premium_economy",
        "economy"
       ],
       "default": "business"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer, in words and as data. `answer` is a paragraph to quote; the other fields are the same as the MCP tool's structured result.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Answer"
        }
       }
      }
     },
     "400": {
      "description": "A parameter is missing or wrong; `error` says which.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Too many calls from one address in an hour."
     }
    }
   }
  },
  "/api/v1/cheapest-destinations": {
   "get": {
    "operationId": "cheapest_destinations",
    "summary": "Cheapest places to fly",
    "description": "Use when someone asks where they can fly for the least from a city, in Business, First, Premium Economy or Economy (for example \"cheapest business class destinations from Sydney\"). The cheapest fare we saw to each destination in the last 7 days, cheapest first, with the lowest we have seen and the deals alerted in 90 days. Only routes with enough price history to judge.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "description": "Departing from: an IATA airport code (SYD, LHR) or a city name (Sydney, London).",
      "schema": {
       "type": "string",
       "minLength": 2,
       "maxLength": 60
      }
     },
     {
      "name": "cabin",
      "in": "query",
      "required": false,
      "description": "Cabin class.",
      "schema": {
       "type": "string",
       "enum": [
        "business",
        "first",
        "premium_economy",
        "economy"
       ],
       "default": "business"
      }
     },
     {
      "name": "trip",
      "in": "query",
      "required": false,
      "description": "Round trip or one way.",
      "schema": {
       "type": "string",
       "enum": [
        "round_trip",
        "one_way"
       ],
       "default": "round_trip"
      }
     },
     {
      "name": "currency",
      "in": "query",
      "required": false,
      "description": "Currency for the prices.",
      "schema": {
       "type": "string",
       "enum": [
        "AUD",
        "USD",
        "NZD",
        "EUR",
        "GBP"
       ],
       "default": "AUD"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "limit",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20,
       "default": 10
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The answer, in words and as data. `answer` is a paragraph to quote; the other fields are the same as the MCP tool's structured result.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Answer"
        }
       }
      }
     },
     "400": {
      "description": "A parameter is missing or wrong; `error` says which.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Too many calls from one address in an hour."
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Answer": {
    "type": "object",
    "properties": {
     "answer": {
      "type": "string"
     },
     "found": {
      "type": "boolean"
     },
     "source": {
      "type": "string"
     }
    },
    "required": [
     "answer",
     "source"
    ],
    "additionalProperties": true
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string"
     }
    },
    "required": [
     "error"
    ]
   }
  }
 },
 "externalDocs": {
  "url": "https://turnleftfares.com/ai",
  "description": "Turn Left Fares for AI assistants"
 }
}