{"components":{"schemas":{"Deal":{"properties":{"active_reference":{"description":"Which reference led the blended rating: route history (route-primary) or the destination/region basket.","enum":["route","dest","region"],"type":"string"},"airline":{"type":"string"},"booking_urls":{"additionalProperties":{"type":"string"},"type":"object"},"cabin":{"type":"string"},"cheaper_than_pct":{"description":"Blended \"beats\" percentile (route-primary, basket-secondary). Consumer copy stays destination-level (\"cheaper than X% of fares to this city\").","type":"integer"},"deal_hash":{"type":"string"},"destination":{"type":"string"},"destination_city":{"type":"string"},"nonstop":{"type":"boolean"},"origin":{"type":"string"},"origin_city":{"type":"string"},"outbound_date":{"format":"date","type":"string"},"price_per_hour_usd":{"type":"integer"},"return_date":{"format":"date","type":"string"},"round_trip_usd":{"type":"integer"},"route_n":{"description":"Route observations (trailing 90d) behind the blend; route weight ramps 0\u21920.75 as this goes 20\u219260.","nullable":true,"type":"integer"},"trip_days":{"type":"integer"},"trip_label":{"type":"string"},"value_tier":{"description":"Top tier renamed Superb\u2192steal; \"superb\" is a retired alias accepted on input for \u22651 release cycle.","enum":["steal","great","good","fair","pricey"],"type":"string"}},"type":"object"},"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"detail":{},"message":{"type":"string"}},"type":"object"}},"type":"object"},"Health":{"properties":{"data_as_of":{"type":"string"},"deals_available":{"type":"integer"},"latest_scan":{"type":"object"},"status":{"type":"string"}},"type":"object"}}},"info":{"description":"Search nonstop, round-trip BUSINESS-class flight deals from US cities, each rated against that route's own price history. Read-only, free, served from a daily-refreshed cache. See /llms.txt for guidance.","title":"lie flat \u2014 business-class flight deals","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/airports":{"get":{"operationId":"listAirports","responses":{"200":{"description":"Airport map"}},"summary":"IATA code \u2192 city/country (resolve city names to codes first)"}},"/api/v1/deal/{deal_hash}":{"get":{"operationId":"getDeal","parameters":[{"in":"path","name":"deal_hash","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deal"}}},"description":"Full deal"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Deal no longer available"}},"summary":"Full detail for one deal \u2014 itinerary, value rating, all booking options"}},"/api/v1/discover":{"get":{"operationId":"discoverDestinations","parameters":[{"description":"Comma IATA origin codes","in":"query","name":"origin","schema":{"type":"string"}},{"description":"Max round-trip USD budget","in":"query","name":"max_total","schema":{"type":"number"}},{"description":"europe | asia pacific | south america | united states","in":"query","name":"region","schema":{"type":"string"}},{"description":"Comma departure months","in":"query","name":"months","schema":{"type":"string"}},{"in":"query","name":"trip_types","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":50,"type":"integer"}}],"responses":{"200":{"description":"Destination ideas, best value first"}},"summary":"Where can I go? Best deal per destination ('ideas for where to go under $Y')"}},"/api/v1/health":{"get":{"operationId":"health","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}},"description":"OK"}},"summary":"Liveness + data freshness (uptime, latest scan, deals available, data_as_of)"}},"/api/v1/search":{"get":{"operationId":"searchDeals","parameters":[{"description":"Comma IATA origin codes, e.g. SFO,JFK","in":"query","name":"origin","schema":{"type":"string"}},{"description":"Comma IATA destination codes, e.g. HND,NRT for Tokyo","in":"query","name":"dest","schema":{"type":"string"}},{"description":"Comma airline-name fragments, e.g. British,ANA","in":"query","name":"airline","schema":{"type":"string"}},{"description":"Max round-trip USD","in":"query","name":"max_total","schema":{"type":"number"}},{"description":"Min round-trip USD","in":"query","name":"min_total","schema":{"type":"number"}},{"description":"Max price per hour in the air (USD)","in":"query","name":"max_pph","schema":{"type":"number"}},{"description":"Min price per hour (USD)","in":"query","name":"min_pph","schema":{"type":"number"}},{"description":"Min trip length (days)","in":"query","name":"min_trip_days","schema":{"type":"integer"}},{"description":"Max trip length (days)","in":"query","name":"max_trip_days","schema":{"type":"integer"}},{"description":"Earliest outbound date YYYY-MM-DD","in":"query","name":"outbound_after","schema":{"format":"date","type":"string"}},{"description":"Latest outbound date YYYY-MM-DD","in":"query","name":"outbound_before","schema":{"format":"date","type":"string"}},{"description":"Earliest return date YYYY-MM-DD","in":"query","name":"return_after","schema":{"format":"date","type":"string"}},{"description":"Latest return date YYYY-MM-DD","in":"query","name":"return_before","schema":{"format":"date","type":"string"}},{"description":"Earliest outbound departure local time HH:MM (avoid red-eyes)","in":"query","name":"depart_after","schema":{"type":"string"}},{"description":"Latest outbound departure local time HH:MM","in":"query","name":"depart_before","schema":{"type":"string"}},{"description":"'Long Weekend' (4-5d) and/or 'Extended Trip' (9-10d); legacy 'Power Weekend'/'Global Reset' still accepted","in":"query","name":"trip_types","schema":{"type":"string"}},{"description":"Comma tiers: steal,great,good,fair,pricey (\"superb\" accepted as a retired alias for \"steal\")","in":"query","name":"deal_value","schema":{"type":"string"}},{"description":"Comma departure months, e.g. 8,9","in":"query","name":"months","schema":{"type":"string"}},{"in":"query","name":"sort","schema":{"enum":["value","price","soonest","pph","duration","trip_days"],"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data_as_of":{"type":"string"},"deals":{"items":{"$ref":"#/components/schemas/Deal"},"type":"array"},"returned":{"type":"integer"},"total_matches":{"type":"integer"}},"type":"object"}}},"description":"Matching deals, best value first"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid parameter"}},"summary":"Search business-class deals ('take me to X for under $Y')"}},"/api/v1/trends":{"get":{"operationId":"priceTrends","parameters":[{"description":"Destination IATA, e.g. LHR","in":"query","name":"dest","required":true,"schema":{"type":"string"}},{"in":"query","name":"origin","schema":{"type":"string"}},{"in":"query","name":"trip_days","schema":{"type":"integer"}},{"in":"query","name":"advance_days","schema":{"type":"integer"}}],"responses":{"200":{"description":"Historical percentiles + current best + verdict"}},"summary":"Is now a good time to buy? Today's best fare vs the route's own recent history"}},"/api/v1/watches":{"post":{"operationId":"createPriceWatch","requestBody":{"content":{"application/json":{"schema":{"properties":{"deal_value":{"type":"string"},"dest":{"type":"string"},"email":{"type":"string"},"max_pph":{"type":"number"},"max_total":{"type":"number"},"months":{"type":"string"},"origin":{"type":"string"},"region":{"type":"string"},"trip_types":{"type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Watch created; includes watch_token + check_url"}},"summary":"Create a price watch ('tell me when X drops under $Y'). Returns a watch_token."}},"/api/v1/watches/{token}":{"get":{"operationId":"checkPriceWatch","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Watch status + deal if triggered"}},"summary":"Poll a watch; 'active' until a matching fare appears, then 'triggered' with the deal"}}},"servers":[{"url":"https://lieflat.co"}]}
