Skip to content
Scrappa Get API key
Trip.com API 1-3 credits / request

Trip.com Flight Search API Documentation

GET https://scrappa.co/api/tripcom/flights/search

Trip.com Flight Search API Documentation 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.

Trip.com Flight Search API Documentation 1-3 credits / request

Endpoint

Request preview
GET
https://scrappa.co/api/tripcom/flights/search
Auth header
x-api-key
Cost
1-3 credits / request
from = example to = example date = 2026-06-15
Response preview
200 OK
{
    "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,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

3 required parameters needed before sending a request.

5 optional filters available.

from string Required

Departure IATA airport or city code, uppercase. Example: LON.

Example value example
to string Required

Arrival IATA airport or city code, uppercase. Example: NYC.

Example value example
date string Required

Departure date, YYYY-MM-DD, today or later. Example: 2027-03-14.

Example value 2026-06-15
return_date string Optional

Return date for a round trip, YYYY-MM-DD, on or after date. Example: 2027-03-21. Without it the search is one way.

Example value 2026-06-15
policy_id string Optional

policy_id of one outbound option from a round-trip answer. Returns the return legs of that option. Needs return_date.

Example value 1234567890
adults integer Optional

Number of adults, 1 to 9. Defaults to 1.

Example value 10
cabin_class string Optional

economy (default), premium_economy or business.

Example value example
currency string Optional

Price currency: USD, EUR, GBP, JPY or KRW. Defaults to USD. Every price in the answer has this currency.

Example value USD

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "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

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A query parameter is missing or invalid. This response is not billable.

{
    "errors": {
        "from": [
            "A departure airport or city code is required, e.g. LON."
        ]
    },
    "message": "The request validation failed"
}
404

Resource Not Found

The id is unknown. This response is not billable.

{
    "meta": {
        "billable": false,
        "retryable": false,
        "endpoint_family": "trip_com"
    },
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested Trip.com resource was not found."
    },
    "success": false
}
502

Unexpected Upstream Answer

Trip.com answered with a page or payload Scrappa cannot read. This response is not billable. Retry later.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "trip_com"
    },
    "error": {
        "code": "PARSER_DRIFT",
        "message": "The Trip.com API is temporarily unavailable. Please retry."
    },
    "success": false
}
503

Upstream Unavailable

Trip.com did not answer after one retry. This response is not billable. Retry later.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "trip_com"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Trip.com API is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.