# Trip.com API

> Trip.com returns hotel prices, guest ratings, and flight fares as a workflow and API.

Trip.com returns hotel listings with prices, reviews, and booking links; Search hotels needs a city and check-in and check-out dates. Trip.com returns priced flight options and itinerary details; Search flights needs an origin, destination, and departure date.

- Page: https://fous.com/workflows/trip-com
- Handle: `@trip-com`
- Category: [Travel](https://fous.com/workflows/category/travel)
- Source website: https://trip.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with Trip.com.

## Methods

### Search flights

Operation `search_flights`, version 1. 1 credit per call.

Find priced flights between two places on selected dates, cheapest first. Round-trip choices pair each outbound flight with available returns; fares can change before booking. Links open the matching Trip.com flight search.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `cabin` | string | no |  | Seat class, e.g. business. |
| `adults` | integer | no |  | Number of adult travellers, e.g. 2. |
| `origin` | string | yes | `"Singapore"` | Departure city or airport, e.g. Singapore or SIN. |
| `currency` | string | no |  | Three-letter display currency, e.g. USD. |
| `destination` | string | yes | `"Seoul"` | Arrival city or airport, e.g. Seoul or ICN. |
| `max_results` | integer | no | `3` | Maximum priced flight options, e.g. 20. |
| `return_date` | string | no | `"2026-10-27"` | Return date for a round trip, e.g. 2026-10-22. |
| `nonstop_only` | boolean | no | `true` | Only show flights without stops, e.g. true. |
| `departure_date` | string | yes | `"2026-10-15"` | Departure date, e.g. 2026-10-15. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "origin",
    "destination",
    "departure_date"
  ],
  "properties": {
    "cabin": {
      "enum": [
        "economy",
        "premium_economy",
        "business",
        "first"
      ],
      "type": "string",
      "default": "economy",
      "description": "Seat class, e.g. business."
    },
    "adults": {
      "type": "integer",
      "default": 1,
      "maximum": 9,
      "minimum": 1,
      "description": "Number of adult travellers, e.g. 2."
    },
    "origin": {
      "type": "string",
      "title": "From",
      "minLength": 2,
      "description": "Departure city or airport, e.g. Singapore or SIN.",
      "examples": [
        "Singapore",
        "SIN",
        "Tokyo"
      ]
    },
    "currency": {
      "type": "string",
      "default": "USD",
      "pattern": "^[A-Za-z]{3}$",
      "description": "Three-letter display currency, e.g. USD."
    },
    "destination": {
      "type": "string",
      "title": "To",
      "minLength": 2,
      "description": "Arrival city or airport, e.g. Seoul or ICN.",
      "examples": [
        "Seoul",
        "ICN",
        "Osaka"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum priced flight options, e.g. 20.",
      "x-fous-developer": true,
      "examples": [
        3,
        4
      ]
    },
    "return_date": {
      "type": "string",
      "format": "date",
      "description": "Return date for a round trip, e.g. 2026-10-22.",
      "examples": [
        "2026-10-27"
      ]
    },
    "nonstop_only": {
      "type": "boolean",
      "default": false,
      "description": "Only show flights without stops, e.g. true.",
      "examples": [
        true
      ]
    },
    "departure_date": {
      "type": "string",
      "format": "date",
      "description": "Departure date, e.g. 2026-10-15.",
      "examples": [
        "2026-10-15",
        "2026-10-21",
        "2026-11-05"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "origin": "Singapore",
      "destination": "Seoul",
      "departure_date": "2026-10-15"
    },
    {
      "origin": "SIN",
      "destination": "ICN",
      "max_results": 3,
      "return_date": "2026-10-27",
      "departure_date": "2026-10-21"
    },
    {
      "origin": "Tokyo",
      "destination": "Osaka",
      "max_results": 4,
      "nonstop_only": true,
      "departure_date": "2026-11-05"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `flights` | array |  |  |
| `flights[].currency` | string | `"USD"` |  |
| `flights[].return_stops` | integer | `0` |  |
| `flights[].trip_com_url` | string | `"https://www.trip.com/flights/showfarefirst?dcity=sin&acity=icn&ddate=2026-10-21&triptype=rt&class=y&quantity=1&nonstopo` |  |
| `flights[].outbound_stops` | integer | `0` |  |
| `flights[].return_airlines` | array |  |  |
| `flights[].outbound_airlines` | array |  |  |
| `flights[].return_travel_time` | string or null | `"7 h 0 min"` | Journey duration, e.g. 7 h 25 min. |
| `flights[].price_per_traveller` | number | `258` | Displayed fare per adult including taxes. |
| `flights[].return_arrival_time` | string or null | `"2026-10-28T00:10:00+08:00"` | Local arrival time, ISO 8601 with UTC offset. |
| `flights[].outbound_travel_time` | string or null | `"6 h 45 min"` | Journey duration, e.g. 7 h 25 min. |
| `flights[].return_stop_airports` | array |  | Connecting airports as name (code). |
| `flights[].outbound_arrival_time` | string or null | `"2026-10-22T06:45:00+09:00"` | Local arrival time, ISO 8601 with UTC offset. |
| `flights[].return_departure_time` | string or null | `"2026-10-27T18:10:00+09:00"` | Local departure time, ISO 8601 with UTC offset. |
| `flights[].return_flight_numbers` | array |  |  |
| `flights[].outbound_stop_airports` | array |  | Connecting airports as name (code). |
| `flights[].outbound_departure_time` | string or null | `"2026-10-21T23:00:00+08:00"` | Local departure time, ISO 8601 with UTC offset. |
| `flights[].outbound_flight_numbers` | array |  |  |
| `flights[].return_travel_time_minutes` | integer or null | `420` |  |
| `flights[].return_arrival_airport_code` | string or null | `"SIN"` |  |
| `flights[].return_arrival_airport_name` | string or null | `"Singapore Changi Airport"` |  |
| `flights[].outbound_travel_time_minutes` | integer or null | `405` |  |
| `flights[].outbound_arrival_airport_code` | string or null | `"ICN"` |  |
| `flights[].outbound_arrival_airport_name` | string or null | `"Incheon International Airport"` |  |
| `flights[].return_departure_airport_code` | string or null | `"ICN"` |  |
| `flights[].return_departure_airport_name` | string or null | `"Incheon International Airport"` |  |
| `flights[].outbound_departure_airport_code` | string or null | `"SIN"` |  |
| `flights[].outbound_departure_airport_name` | string or null | `"Singapore Changi Airport"` |  |

**Example input**

```json
{
  "origin": "SIN",
  "destination": "ICN",
  "max_results": 3,
  "return_date": "2026-10-27",
  "departure_date": "2026-10-21"
}
```

**Example output**

```json
{
  "flights": [
    {
      "currency": "USD",
      "return_stops": 0,
      "trip_com_url": "https://www.trip.com/flights/showfarefirst?dcity=sin&acity=icn&ddate=2026-10-21&triptype=rt&class=y&quantity=1&nonstoponly=off&locale=en-XX&curr=USD&rdate=2026-10-27",
      "outbound_stops": 0,
      "return_airlines": [
        "Jeju Air"
      ],
      "outbound_airlines": [
        "Trinity Airways"
      ],
      "return_travel_time": "7 h 0 min",
      "price_per_traveller": 258,
      "return_arrival_time": "2026-10-28T00:10:00+08:00",
      "outbound_travel_time": "6 h 45 min",
      "return_stop_airports": [],
      "outbound_arrival_time": "2026-10-22T06:45:00+09:00",
      "return_departure_time": "2026-10-27T18:10:00+09:00",
      "return_flight_numbers": [
        "7C2623"
      ],
      "outbound_stop_airports": [],
      "outbound_departure_time": "2026-10-21T23:00:00+08:00",
      "outbound_flight_numbers": [
        "TW162"
      ],
      "return_travel_time_minutes": 420,
      "return_arrival_airport_code": "SIN",
      "return_arrival_airport_name": "Singapore Changi Airport",
      "outbound_travel_time_minutes": 405,
      "outbound_arrival_airport_code": "ICN",
      "outbound_arrival_airport_name": "Incheon International Airport",
      "return_departure_airport_code": "ICN",
      "return_departure_airport_name": "Incheon International Airport",
      "outbound_departure_airport_code": "SIN",
      "outbound_departure_airport_name": "Singapore Changi Airport"
    }
  ]
}
```

### Search hotels

Operation `search_hotels`, version 1. 1 credit per call.

Find hotels in a city for your dates with prices, reviews, and booking links. Only initial public listings are available, so large result limits may return fewer hotels; prices can change.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `city` | string | yes | `"Tokyo"` | City name, for example Tokyo. |
| `sort` | string | no | `"lowest_price"` | Listing order, for example lowest_price. |
| `rooms` | integer | no | `1` | Number of rooms, for example 1. |
| `adults` | integer | no | `1` | Number of adults, for example 2. |
| `check_in` | string | yes | `"2026-10-20"` | Check-in date, for example 2026-10-20. |
| `currency` | string | no | `"EUR"` | Three-letter currency code, for example USD. |
| `check_out` | string | yes | `"2026-10-22"` | Check-out date, for example 2026-10-22. |
| `min_stars` | integer | no | `4` | Minimum hotel stars, for example 4. |
| `max_results` | integer | no | `5` | Maximum hotels to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "city",
    "check_in",
    "check_out"
  ],
  "properties": {
    "city": {
      "type": "string",
      "description": "City name, for example Tokyo.",
      "examples": [
        "Tokyo",
        "Paris"
      ]
    },
    "sort": {
      "enum": [
        "recommended",
        "lowest_price",
        "top_rated"
      ],
      "type": "string",
      "default": "recommended",
      "description": "Listing order, for example lowest_price.",
      "examples": [
        "lowest_price",
        "top_rated"
      ]
    },
    "rooms": {
      "type": "integer",
      "default": 1,
      "minimum": 1,
      "description": "Number of rooms, for example 1.",
      "examples": [
        1
      ]
    },
    "adults": {
      "type": "integer",
      "default": 2,
      "minimum": 1,
      "description": "Number of adults, for example 2.",
      "examples": [
        1
      ]
    },
    "check_in": {
      "type": "string",
      "format": "date",
      "description": "Check-in date, for example 2026-10-20.",
      "examples": [
        "2026-10-20",
        "2026-11-10"
      ]
    },
    "currency": {
      "type": "string",
      "default": "USD",
      "pattern": "^[A-Za-z]{3}$",
      "description": "Three-letter currency code, for example USD.",
      "examples": [
        "EUR"
      ]
    },
    "check_out": {
      "type": "string",
      "format": "date",
      "description": "Check-out date, for example 2026-10-22.",
      "examples": [
        "2026-10-22",
        "2026-11-12"
      ]
    },
    "min_stars": {
      "type": "integer",
      "maximum": 5,
      "minimum": 1,
      "description": "Minimum hotel stars, for example 4.",
      "examples": [
        4
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum hotels to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        5,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "city": "Tokyo",
      "check_in": "2026-10-20",
      "check_out": "2026-10-22"
    },
    {
      "city": "Paris",
      "sort": "lowest_price",
      "rooms": 1,
      "adults": 1,
      "check_in": "2026-11-10",
      "currency": "EUR",
      "check_out": "2026-11-12",
      "min_stars": 4,
      "max_results": 5
    },
    {
      "city": "Tokyo",
      "sort": "top_rated",
      "check_in": "2026-10-20",
      "check_out": "2026-10-22",
      "max_results": 3
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `hotels` | array |  |  |
| `hotels[].area` | string or null | `"Central Tokyo \| Near Japan National Stadium"` |  |
| `hotels[].link` | string | `"https://www.trip.com/hotels/detail/?hotelId=35541585&checkIn=2026-10-20&checkOut=2026-10-22&adult=2&crn=1&curr=USD"` |  |
| `hotels[].name` | string | `"Mitsui Garden Hotel Jingugaien Tokyo Premier"` |  |
| `hotels[].stars` | integer or null | `5` |  |
| `hotels[].currency` | string | `"USD"` |  |
| `hotels[].hotel_id` | string | `"35541585"` |  |
| `hotels[].total_price` | number | `571` |  |
| `hotels[].guest_rating` | number or null | `9.2` |  |
| `hotels[].review_count` | integer or null | `1211` |  |
| `hotels[].nightly_price` | number | `259` |  |
| `hotels[].free_cancellation` | boolean | `true` |  |
| `hotels[].guest_rating_label` | string or null | `"Great"` |  |
| `hotels[].distance_to_city_centre` | string or null |  |  |

**Example input**

```json
{
  "city": "Tokyo",
  "check_in": "2026-10-20",
  "check_out": "2026-10-22"
}
```

**Example output**

```json
{
  "hotels": [
    {
      "area": "Central Tokyo | Near Japan National Stadium",
      "link": "https://www.trip.com/hotels/detail/?hotelId=35541585&checkIn=2026-10-20&checkOut=2026-10-22&adult=2&crn=1&curr=USD",
      "name": "Mitsui Garden Hotel Jingugaien Tokyo Premier",
      "stars": 5,
      "currency": "USD",
      "hotel_id": "35541585",
      "total_price": 571,
      "guest_rating": 9.2,
      "review_count": 1211,
      "nightly_price": 259,
      "free_cancellation": true,
      "guest_rating_label": "Great",
      "distance_to_city_centre": null
    },
    {
      "area": "Near Shinjuku City | Ikebukuro",
      "link": "https://www.trip.com/hotels/detail/?hotelId=5214781&checkIn=2026-10-20&checkOut=2026-10-22&adult=2&crn=1&curr=USD",
      "name": "JR-EAST HOTEL METS MEJIRO",
      "stars": 3,
      "currency": "USD",
      "hotel_id": "5214781",
      "total_price": 337,
      "guest_rating": 9.5,
      "review_count": 434,
      "nightly_price": 153,
      "free_cancellation": true,
      "guest_rating_label": "Amazing",
      "distance_to_city_centre": null
    },
    {
      "area": "Kanda | Near Nihonbashi",
      "link": "https://www.trip.com/hotels/detail/?hotelId=12663342&checkIn=2026-10-20&checkOut=2026-10-22&adult=2&crn=1&curr=USD",
      "name": "Sotetsu Fresa Inn Tokyo Kanda",
      "stars": 3,
      "currency": "USD",
      "hotel_id": "12663342",
      "total_price": 325,
      "guest_rating": 9.1,
      "review_count": 271,
      "nightly_price": 148,
      "free_cancellation": true,
      "guest_rating_label": "Great",
      "distance_to_city_centre": null
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@trip-com",
  "visibility": "public",
  "operation": "search_flights",
  "version": 1,
  "input": {
    "origin": "Singapore",
    "destination": "Seoul",
    "departure_date": "2026-10-15"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@trip-com\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_flights\",\n  \"version\": 1,\n  \"input\": {\n    \"origin\": \"Singapore\",\n    \"destination\": \"Seoul\",\n    \"departure_date\": \"2026-10-15\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@trip-com",
  "visibility": "public",
  "operation": "search_flights",
  "version": 1,
  "input": {
    "origin": "Singapore",
    "destination": "Seoul",
    "departure_date": "2026-10-15"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@trip-com","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare hotel prices and guest ratings for a city stay
- Find hotels by star rating and cancellation availability
- Compare flight fares between two cities
- Review flight stops, airlines, and journey times
- Plan round trips using departure and return dates

## FAQ

### Is Fous affiliated with Trip.com?

No. Fous is not affiliated with Trip.com. This workflow reads the public trip.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Trip.com account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from trip.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What hotels are available for my dates?

Search hotels returns hotel listings for a city and check-in and check-out dates, including prices, ratings, and booking links.

### Which hotels have the lowest prices?

Search hotels can sort listings by lowest price and returns nightly and total prices.

### What flights are available between two cities?

Search flights returns priced options for an origin, destination, and departure date, with airline, stop, and travel-time details.

## Related

- [Expedia API](https://fous.com/workflows/expedia.md): Expedia helps travelers find hotels, vacation stays, and travel deals, with hotel prices and flight options for selected destinations and dates; flight listings may be limited.
- [Tripadvisor API](https://fous.com/workflows/tripadvisor.md): Tripadvisor provides traveler-ranked first-page city listings of attractions, restaurants and hotels, plus latest reviews; hotel prices and booking sites depend on supplied stay dates and availability.
- [Kayak API](https://fous.com/workflows/kayak.md): Kayak compares flight and hotel prices across booking sites and current rental car offers; hotel rates assume two adults per room and cover public location pages, while prices and availability can change at booking.
- [Booking.com API](https://fous.com/workflows/booking-com.md): Booking.com helps find stays, property details and public guest reviews; prices and cancellation terms depend on selected dates, and displayed prices may exclude taxes and fees.
- [Google Hotels API](https://fous.com/workflows/google-hotels.md): Google Hotels finds stays, guest details and reviews, and compares booking-site totals, cancellation and links for up to six adults; prices and availability can change, and some prices or topic ratings may be unavailable.
- [Google Flights API](https://fous.com/workflows/google-flights.md): Google Flights returns route schedules, public fares, monthly lowest prices, and flight or destination options with times, stops, emissions, and fares that may change.
- [Agoda API](https://fous.com/workflows/agoda.md): Agoda finds stays and room prices for selected dates; displayed prices exclude taxes and fees, and availability, prices, and cancellation terms may change before booking.
- [FlixBus API](https://fous.com/workflows/flixbus.md): Find and book bus and train trips on FlixBus.
- [All Travel workflows](https://fous.com/workflows/category/travel)
