flights

Parse a natural language flight query into structured search params

Free — no credit charge. Powered by Gemini. Returns resolved IATA codes, dates, passenger count, time preferences, and a list of any fields still missing. Pass the resolved params to POST /flights/search or POST /flights/discover.

post/flights/parse-query

Request

  • Base URL: https://letsfg.co/developers/api/v1
  • URL: https://letsfg.co/developers/api/v1/flights/parse-query
  • Auth: API key in header X-API-Key

Request body

querystring required

Natural language flight query.

todaystring date

Override today's date (YYYY-MM-DD). Defaults to server date.

mode'full' | 'clarify'

full = parse everything; clarify = return only missing fields.

Example request

{
  "query": "morning flight from New York to LA next Friday, 2 adults"
}

Response

Parsed flight intent.

originstring nullable

Resolved origin IATA code.

destinationstring nullable

Resolved destination IATA code.

departure_datestring date nullable
return_datestring date nullable
adultsinteger nullable
depart_afterstring nullable

Earliest departure HH:MM (24h).

depart_beforestring nullable

Latest departure HH:MM (24h).

cabin_classstring nullable
follow_up_topicsstring[]

Fields still missing from the query.

follow_up_questionsobject[]
date_is_flexibleboolean

Changes

No recorded changes to this operation across all 1 revision of this API.