# Trip.com Flight Search API Documentation

<p><strong>Trip.com Flight Search API Documentation</strong> Search flights between two airports or cities, one-way or round trip. Each itinerary has the price with taxes and currency, the cabin, seats left, stops, total duration in minutes, carriers and the segments with flight number, airline, aircraft, airports, terminals and local times in ISO 8601. Itineraries are sorted by price, up to 50. Add return_date for a round trip: the answer lists the outbound options (leg: outbound) and the price of each is the price of the whole round trip. Every round-trip option has a policy_id. Send it again with the same search to get the return legs of that option (leg: return). Cost: 1 credit for a one-way search. 3 credits for each successful round-trip call. Failed calls cost 0.</p>

- **Documentation:** [https://scrappa.co/docs/tripcom-api/tripcom_flights_search](https://scrappa.co/docs/tripcom-api/tripcom_flights_search)
- **API group:** Trip.com API
- **Endpoint:** `GET https://scrappa.co/api/tripcom/flights/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string | Yes | Departure IATA airport or city code, uppercase. Example: LON. |
| `to` | string | Yes | Arrival IATA airport or city code, uppercase. Example: NYC. |
| `date` | string | Yes | Departure date, YYYY-MM-DD, today or later. Example: 2027-03-14. |
| `return_date` | string | No | Return date for a round trip, YYYY-MM-DD, on or after date. Example: 2027-03-21. Without it the search is one way. |
| `policy_id` | string | No | policy_id of one outbound option from a round-trip answer. Returns the return legs of that option. Needs return_date. |
| `adults` | integer | No | Number of adults, 1 to 9. Defaults to 1. |
| `cabin_class` | string | No | economy (default), premium_economy or business. |
| `currency` | string | No | Price currency: USD, EUR, GBP, JPY or KRW. Defaults to USD. Every price in the answer has this currency. |

## Example response

```json
{
    "data": {
        "to": "NYC",
        "date": "2027-03-14",
        "from": "LON",
        "total": 2,
        "adults": 1,
        "currency": "USD",
        "cabin_class": "economy",
        "itineraries": [
            {
                "cabin": "Economy class",
                "price": 406,
                "stops": 1,
                "taxes": 371.8,
                "carriers": [
                    "TAP Air Portugal"
                ],
                "currency": "USD",
                "segments": [
                    {
                        "airline": "TAP Air Portugal",
                        "arrival": {
                            "city": "Lisbon",
                            "time": "2026-12-15T11:05:00",
                            "airport": "Humberto Delgado Airport",
                            "terminal": "T1",
                            "airport_code": "LIS"
                        },
                        "aircraft": "Airbus A320-212",
                        "departure": {
                            "city": "London",
                            "time": "2026-12-15T08:15:00",
                            "airport": "Heathrow Airport",
                            "terminal": "T2",
                            "airport_code": "LHR"
                        },
                        "airline_code": "TP",
                        "flight_number": "TP1351",
                        "duration_minutes": 170
                    },
                    {
                        "airline": "TAP Air Portugal",
                        "arrival": {
                            "city": "New York",
                            "time": "2026-12-15T22:15:00",
                            "airport": "Newark Liberty International Airport",
                            "terminal": "B",
                            "airport_code": "EWR"
                        },
                        "aircraft": "Airbus A321neo",
                        "departure": {
                            "city": "Lisbon",
                            "time": "2026-12-15T18:40:00",
                            "airport": "Humberto Delgado Airport",
                            "terminal": "T1",
                            "airport_code": "LIS"
                        },
                        "airline_code": "TP",
                        "flight_number": "TP203",
                        "duration_minutes": 515
                    }
                ],
                "seats_left": 9,
                "arrival_time": "2026-12-15T22:15:00",
                "departure_time": "2026-12-15T08:15:00",
                "arrival_airport": "EWR",
                "duration_minutes": 1140,
                "departure_airport": "LHR"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "flight_search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | The id is unknown. This response is not billable. |
| 502 | Unexpected Upstream Answer | Trip.com answered with a page or payload Scrappa cannot read. This response is not billable. Retry later. |
| 503 | Upstream Unavailable | Trip.com did not answer after one retry. This response is not billable. Retry later. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
