---
updatedAt: 2026-11-09T13:25:40.000Z
agentTools:
  projectIndex: https://docs.liteapi.travel/llms.txt
---

# Search Flights (Rates)

How to call POST /flights/rates: auth header, legs-based request shape, one-way and round-trip examples, and common errors.

This page is the partner-facing guide for **flight search**. The OpenAPI operation `post_flights-rates` is the source of truth for field names and types — quote that reference if anything here disagrees.

## Auth and base URL

| Item          | Value                                                          |
| ------------- | -------------------------------------------------------------- |
| Base URL      | `https://api.liteapi.travel/v3.0`                              |
| Auth          | Header `X-API-Key: <your_api_key>` (same key family as hotels) |
| Method / path | `POST /flights/rates`                                          |

Flights must be **enabled** for the key and environment. A **401** on flights while hotels work usually means flights is not enabled for that key — not a wrong header name. Request enablement via the dashboard (**Request Assistance**); do not paste API keys into tickets or chat.

Keep production keys on a trusted server. Do not embed them in browser or mobile apps.

## Request shape (required)

Required top-level fields (OpenAPI):

* `legs` (array) — ordered itinerary
* `adults` (integer) — passengers aged 12+
* `currency` (string) — ISO 4217

Each leg requires:

* `origin` — airport or city IATA
* `destination` — airport or city IATA
* `date` — `YYYY-MM-DD` (not more than 11 months from today)

Optional but commonly used: `children`, `infants`, `childrenAges`, `infantAges`, `cabinClass`, `country` (point of sale), `filters`, `sort`, `margin`.

**Not supported** at the top level: `origin`, `destination`, `departureDate`, `returnDate`. Put those on each `legs[]` entry.

| Trip type  | `legs`                                                               |
| ---------- | -------------------------------------------------------------------- |
| One-way    | One entry                                                            |
| Round-trip | Outbound then inbound (`direction`: `OUTBOUND` / `INBOUND` optional) |
| Multi-city | One entry per segment, in travel order                               |

## Example — one-way

```bash
curl -X POST "https://api.liteapi.travel/v3.0/flights/rates" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "legs": [
      {
        "origin": "JFK",
        "destination": "LHR",
        "date": "2026-12-10"
      }
    ],
    "adults": 1,
    "currency": "USD",
    "country": "US"
  }'
```

## Example — round-trip

```bash
curl -X POST "https://api.liteapi.travel/v3.0/flights/rates" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "legs": [
      {
        "origin": "JFK",
        "destination": "CDG",
        "date": "2026-07-01",
        "direction": "OUTBOUND"
      },
      {
        "origin": "CDG",
        "destination": "JFK",
        "date": "2026-08-02",
        "direction": "INBOUND"
      }
    ],
    "adults": 1,
    "currency": "USD",
    "country": "US",
    "filters": {
      "maxStops": 1,
      "refundableOnly": false
    },
    "sort": {
      "sortBy": "price",
      "sortOrder": "asc"
    }
  }'
```

## What you get back

A successful **200** returns `data` with journeys and offers from the live search. Use each offer’s `offerId` verbatim for verify → prebook → book (see [Build a Flight Booking Experience](./build-a-flight-booking-experience.md)).

Pricing on offers follows the Flights `FlightPrice` schema:

* `base`, `taxes`, `fees` — **supplier** amounts (never include partner markup)
* `total` — **selling** price including partner markup (and platform fees when present)

Offers can expire. Prefer SSE (`Accept: text/event-stream`) when you want incremental provider batches.

## Common errors

| HTTP      | Meaning (typical)                                                        |
| --------- | ------------------------------------------------------------------------ |
| 400       | Missing or invalid search parameters                                     |
| 401       | Missing/invalid key, or flights not enabled for this key                 |
| 429       | Account / key rate limit — see [Rate Limiting](https://docs.liteapi.travel/reference/rate-limiting) |
| 502 / 503 | Provider or service unavailable — retry with backoff                     |

Search failure code **51099** (“unable to process search request”) is a search failure you cannot self-trace from Ask Connect — collect UTC time, env, request body shape (redacted), and open **Request Assistance**.

## Next steps

1. Pick an `offerId` from search.
2. **Verify** the offer.
3. **Prebook**, optionally attach seats/bags, then **book**.

Canonical schema and examples: [POST /flights/rates](https://docs.liteapi.travel/reference/post_flights-rates).