---
title: "Parse a natural language flight query into structured search params"
method: POST
path: "/flights/parse-query"
tags: ["flights"]
---

# Parse a natural language flight query into structured search params

`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`

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.

## Request body

- ParseQueryRequest
  - `query` string, required: Natural language flight query.
  - `today` string, date: Override today's date (YYYY-MM-DD). Defaults to server date.
  - `mode` 'full' | 'clarify': full = parse everything; clarify = return only missing fields.

## Response `200`

Parsed flight intent.

- ParseQueryResponse
  - `origin` string, nullable: Resolved origin IATA code.
  - `destination` string, nullable: Resolved destination IATA code.
  - `departure_date` string, date, nullable
  - `return_date` string, date, nullable
  - `adults` integer, nullable
  - `depart_after` string, nullable: Earliest departure HH:MM (24h).
  - `depart_before` string, nullable: Latest departure HH:MM (24h).
  - `cabin_class` string, nullable
  - `follow_up_topics` string[]: Fields still missing from the query.
  - `follow_up_questions` object[]
  - `date_is_flexible` boolean

---

[API](https://skmtc.dev/letsfg/apis/letsfg-public-developer-api.md) · [All operations](https://skmtc.dev/letsfg/apis/letsfg-public-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/letsfg/apis/letsfg-public-developer-api/revisions/516ab6ba1d2e?raw)
