# Expedia Flight ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/expedia/flight` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/expedia-flight | ## Description Search Expedia flights by airport route and dates, or by a flight search URL. Each offer includes the airline, times, stops, and displayed price. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/expedia/flight' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### JFK to LAX on 15 Nov 2026 ```json { "results": [ { "price": "$269", "stops": "Nonstop", "origin": "JFK", "airline": "Delta", "duration": "6h 13m", "cabin_class": "economy", "destination": "LAX", "arrival_time": "6:33pm", "departure_time": "3:20pm" } ], "pagination": { "next": null, "page": 1, "per_page": 1, "total_pages": null, "total_results": null } } ``` ## Documentation ## Overview Search Expedia flights by an airport route or by a full Flights-Search URL. ## Quickstart One way ``` GET https://api.piloterr.com/v2/expedia/flight?query=JFK-LAX&departure_date=2026-11-15&adults=1 ``` Round trip ``` GET https://api.piloterr.com/v2/expedia/flight?query=JFK-LAX&departure_date=2026-11-15&return_date=2026-11-22 ``` ## Parameters | Parameter | Type | Required | Default | What to pass | What changes in the JSON | |---|---|---|---|---|---| | `query` | string | yes | empty, which returns 400 | `JFK-LAX`, `JFK to LAX`, or a full Flights-Search URL | Sets `origin` and `destination` on each offer. A full URL is opened as given. `price` stays the label on the page. | | `departure_date` | string | no | `2026-11-15` for a route | `YYYY-MM-DD` | Sets the departure on a route. A bad format returns 400. Ignored for a full URL. | | `return_date` | string | no | omitted, so the trip is one way | `YYYY-MM-DD` | Adds the return leg. A bad format returns 400. Ignored for a full URL. | | `adults` | integer | no | 1 | A positive integer | Sets the passenger count on a route. Ignored for a full URL. | | `cabin_class` | string | no | `economy` | Any short label, such as `economy` | Copied onto every result as `cabin_class`. It does not filter the Expedia URL. | | `region` | string | no | empty, which uses www.expedia.com | `us`, `ca`, `uk`, `au`, `fr`, `de`, `es`, `it`, `nl`, or `mx` | Picks the host, so the currency symbol on `price` follows that site. Any other value returns 400. Ignored for a full URL. | ## Response fields Each offer has `origin`, `destination`, `airline`, `price`, `departure_time`, `arrival_time`, and can include `duration`, `stops`, and `cabin_class`. `price` is a display string. `pagination.page` is 1, `pagination.per_page` is the number of offers, and `pagination.next` is null. ## Use cases - Compare one-way fares between two airports - List offers for a departure date - Pair a flight search with a hotel search for the same dates ## Error codes | Code | Meaning | |---|---| | 400 | Missing route, a bad date, an unknown region, or a URL outside Expedia | | 404 | The rendered page had no flight offers | | 500 | The page could not be rendered |