In this example, we’ll demonstrate how to leverage our Trip API to extract flights data from trip.com
Note
Make sure the origin and destination is a valid place code from trip.com
Simple Example
One Way Trip Flights
in this example, we’ll scrape flights data from trip.com trip from Jakarta (CGK) to Singapore (SIN) at 12 April 2025.
Follow the steps bellow to use our scraper API
Use the request bellow:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/trip/async' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"market": "SG",
"tripType": "OW",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-04-12",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
}'
Replace “Authorization” with your API token
The request above will return the following JSON response:
{
"success" : true ,
"message" : "URLs saved to queue" ,
"data" : {
"result_id" : <result_id>
}
}
After sending the request you can check your scraper result with this following request:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/scraper/async/result/<result_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>'
Replace the token with your API Token and replace the result_id with the result_id from number 3.
The request above will return these following JSON responses
If the scraper is still running:
{
"success" : false ,
"message" : "Result still in pending status, try again later" ,
"data" : {
"status" : "PENDING"
}
}
If the result are not found in our server:
{
"success" : false ,
"message" : "Not found" ,
"data" : "Result not found"
}
If the scraper finished and result are found in our server:
{
"success" : true ,
"message" : "urls successfully netted" ,
"data" : [
{
"country" : "en-SG" ,
"currency" : "SGD" ,
"brand_id" : "3K" ,
"departure_brand_id" : "3K" ,
"departure_time" : "21:50:00" ,
"departure_date" : "2025-04-12" ,
"departure_duration_minute" : "120" ,
"departure_arrival_time" : "00:50:00" ,
"departure_arrival_date" : "2025-04-13" ,
"departure_flight_number" : "206" ,
"departure_route_airport" : "CGK SIN" ,
"departure_stop" : "0" ,
"fare" : "46" ,
"flight_class" : "ECONOMY" ,
"client_interface" : "MOBILE-ANDROID" ,
"site" : "tripcomapp" ,
"trip_type" : "ONE_WAY" ,
"login_type" : "NON_LOGIN" ,
"return_brand_id" : null ,
"return_date" : null ,
"return_departure_time" : null ,
"return_arrival_date" : null ,
"return_arrival_time" : null ,
"return_flight_number" : null ,
"return_route_airport" : null ,
"return_stop" : null ,
"return_duration_minute" : null ,
"route_airport" : "CGK SIN" ,
"scrape_date" : "2025-03-28" ,
"scrape_time" : "14:55:46.572Z" ,
"scraping_type" : "SCHEDULED" ,
"type" : "ECONOMY" ,
"num_adult" : 1 ,
"num_child" : null ,
"num_infant" : null
},
...rest
]
}
Round Trip Flights
in this example, we’ll scrape flights data from trip.com trip from Jakarta (CGK) to Singapore (SIN) at 12 April 2025 and return at 16 April 2025.
Follow the steps bellow to use our scraper API
Use the request bellow:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/trip/async' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"market": "SG",
"tripType": "RT",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-04-12",
"returnDate": "2025-04-16",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
}'
Replace “Authorization” with your API token
The request above will return the following JSON response:
{
"success" : true ,
"message" : "URLs saved to queue" ,
"data" : {
"result_id" : <result_id>
}
}
After sending the request you can check your scraper result with this following request:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/scraper/async/result/<result_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>'
Replace the token with your API Token and replace the result_id with the result_id from number 3.
The request above will return these following JSON responses
If the scraper is still running:
{
"success" : false ,
"message" : "Result still in pending status, try again later" ,
"data" : {
"status" : "PENDING"
}
}
If the result are not found in our server:
{
"success" : false ,
"message" : "Not found" ,
"data" : "Result not found"
}
If the scraper finished and result are found in our server:
{
"success" : true ,
"message" : "urls successfully netted" ,
"data" : [
{
"country" : "en-SG" ,
"currency" : "SGD" ,
"brand_id" : "XX" ,
"departure_brand_id" : "3K" ,
"departure_time" : "21:50:00" ,
"departure_date" : "2025-04-12" ,
"departure_duration_minute" : "120" ,
"departure_arrival_time" : "00:50:00" ,
"departure_arrival_date" : "2025-04-13" ,
"departure_flight_number" : "206" ,
"departure_route_airport" : "CGK SIN" ,
"departure_stop" : "0" ,
"fare" : "130" ,
"flight_class" : "ECONOMY" ,
"client_interface" : "MOBILE-ANDROID" ,
"site" : "tripcomapp" ,
"trip_type" : "ROUND_TRIP" ,
"login_type" : "NON_LOGIN" ,
"return_brand_id" : "QZ" ,
"return_date" : "2025-04-16" ,
"return_departure_time" : "12:00:00" ,
"return_arrival_date" : "2025-04-16" ,
"return_arrival_time" : "12:50:00" ,
"return_flight_number" : "267" ,
"return_route_airport" : "SIN CGK" ,
"return_stop" : "0" ,
"return_duration_minute" : "110" ,
"route_airport" : "CGK SIN" ,
"scrape_date" : "2025-03-28" ,
"scrape_time" : "15:01:32.534Z" ,
"scraping_type" : "SCHEDULED" ,
"type" : "ECONOMY" ,
"num_adult" : 1 ,
"num_child" : null ,
"num_infant" : null
},
...rest
]
}
Batch Mode
In Batch mode you can add more than 1 payload in a single request, for example purpose we only add 2 payload to the request.
One Way Trip Flights (batch)
in this example, we’ll scrape flights data from trip.com trip from Jakarta (CGK) to Singapore (SIN) at 12 April 2025 and 12 May 2025.
Follow the steps bellow to use our scraper API
Use the request bellow:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/trip/async/batch' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '[
{
"market": "SG",
"tripType": "OW",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-04-12",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
},
{
"market": "SG",
"tripType": "OW",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-05-12",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
}
]'
Replace “Authorization” with your API token
The request above will return the following JSON response:
{
"success" : true ,
"message" : "URLs saved to queue" ,
"data" : {
"batch_id" : 14753470 ,
"metadata" : [
{
"id" : 14754934 ,
"params" : {
"dcity" : "cgk" ,
"acity" : "sin" ,
"ddate" : "2025-04-12" ,
"rdate" : "" ,
"triptype" : "ow" ,
"class" : "y" ,
"lowpricesource" : "searchform" ,
"searchboxarg" : "t" ,
"nonstoponly" : "off" ,
"quantity" : "1" ,
"locale" : "en-SG" ,
"curr" : "SGD"
}
},
{
"id" : 14754935 ,
"params" : {
"dcity" : "cgk" ,
"acity" : "sin" ,
"ddate" : "2025-05-12" ,
"rdate" : "" ,
"triptype" : "ow" ,
"class" : "y" ,
"lowpricesource" : "searchform" ,
"searchboxarg" : "t" ,
"nonstoponly" : "off" ,
"quantity" : "1" ,
"locale" : "en-SG" ,
"curr" : "SGD"
}
}
]
}
}
After sending the request you can check your scraper result with this following request:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/scraper/async/result/batch/<batch_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>'
Replace the token with your API Token and replace the batch_id with the batch_id from number 3.
The request above will return these following JSON responses
If the scraper is still running:
{
"success" : false ,
"message" : "Result still in pending status, try again later" ,
"data" : [
{
"id" : 14754934 ,
"url" : "https://www.skyscanner.co.kr/transport/flights/per/sin/250514/250518?adultsv2=5&cabinclass=economy¤cy=KRW" ,
"status" : "PENDING"
},
...rest
]
}
If the result are not found in our server:
{
"success" : false ,
"message" : "Not found" ,
"data" : "Result not found"
}
If the scraper finished and result are found in our server:
{
"success" : true ,
"message" : "urls successfully netted" ,
"data" : [
{
id : 230947 ,
data : [
{
"country" : "en-SG" ,
"currency" : "SGD" ,
"brand_id" : "XX" ,
"departure_brand_id" : "3K" ,
"departure_time" : "21:50:00" ,
"departure_date" : "2025-04-12" ,
"departure_duration_minute" : "120" ,
"departure_arrival_time" : "00:50:00" ,
"departure_arrival_date" : "2025-04-13" ,
"departure_flight_number" : "206" ,
"departure_route_airport" : "CGK SIN" ,
"departure_stop" : "0" ,
"fare" : "130" ,
"flight_class" : "ECONOMY" ,
"client_interface" : "MOBILE-ANDROID" ,
"site" : "tripcomapp" ,
"trip_type" : "ROUND_TRIP" ,
"login_type" : "NON_LOGIN" ,
"return_brand_id" : "QZ" ,
"return_date" : "2025-04-16" ,
"return_departure_time" : "12:00:00" ,
"return_arrival_date" : "2025-04-16" ,
"return_arrival_time" : "12:50:00" ,
"return_flight_number" : "267" ,
"return_route_airport" : "SIN CGK" ,
"return_stop" : "0" ,
"return_duration_minute" : "110" ,
"route_airport" : "CGK SIN" ,
"scrape_date" : "2025-03-28" ,
"scrape_time" : "15:01:32.534Z" ,
"scraping_type" : "SCHEDULED" ,
"type" : "ECONOMY" ,
"num_adult" : 1 ,
"num_child" : null ,
"num_infant" : null
},
...rest
]
},
...rest
]
}
Round Trip Flights (batch)
in this example, we’ll scrape flights data from trip.com trip from Jakarta (CGK) to Singapore (SIN) at 12 April 2025, return at 16 April 2025 and depart at 12 May 2025, return at 16 May 2025.
Follow the steps bellow to use our scraper API
Use the request bellow:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/trip/async/batch' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '[
{
"market": "SG",
"tripType": "RT",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-04-12",
"returnDate": "2025-04-16",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
},
{
"market": "SG",
"tripType": "RT",
"locale": "en-SG",
"currency": "SGD",
"origin": "CGK",
"destination": "SIN",
"departureDate": "2025-05-12",
"returnDate": "2025-05-16",
"class": "Economy",
"adults": 1,
"childs": 0,
"infants": 0
}
]'
Replace “Authorization” with your API token
The request above will return the following JSON response:
{
"success" : true ,
"message" : "URLs saved to queue" ,
"data" : {
"batch_id" : 14753470 ,
"metadata" : [
{
"id" : 14754934 ,
"params" : {
"dcity" : "cgk" ,
"acity" : "sin" ,
"ddate" : "2025-04-12" ,
"rdate" : "2025-04-16" ,
"triptype" : "rt" ,
"class" : "y" ,
"lowpricesource" : "searchform" ,
"searchboxarg" : "t" ,
"nonstoponly" : "off" ,
"quantity" : "1" ,
"locale" : "en-SG" ,
"curr" : "SGD"
}
},
{
"id" : 14754935 ,
"params" : {
"dcity" : "cgk" ,
"acity" : "sin" ,
"ddate" : "2025-05-12" ,
"rdate" : "2025-05-16" ,
"triptype" : "rt" ,
"class" : "y" ,
"lowpricesource" : "searchform" ,
"searchboxarg" : "t" ,
"nonstoponly" : "off" ,
"quantity" : "1" ,
"locale" : "en-SG" ,
"curr" : "SGD"
}
}
]
}
}
After sending the request you can check your scraper result with this following request:
curl --location 'https://trip.queue.scraper.mrscraper.com/api/scraper/async/result/batch/<batch_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>'
Replace the token with your API Token and replace the batch_id with the batch_id from number 3.
The request above will return these following JSON responses
If the scraper is still running:
{
"success" : false ,
"message" : "Result still in pending status, try again later" ,
"data" : [
{
"id" : 14754934 ,
"url" : "https://www.skyscanner.co.kr/transport/flights/per/sin/250514/250518?adultsv2=5&cabinclass=economy¤cy=KRW" ,
"status" : "PENDING"
},
...rest
]
}```
#### If the result are not found in our server:
```json
{
"success" : false ,
"message" : "Not found" ,
"data" : "Result not found"
}
If the scraper finished and result are found in our server:
{
"success" : true ,
"message" : "urls successfully netted" ,
"data" : [
{
id : 230947 ,
data : [
{
"country" : "en-SG" ,
"currency" : "SGD" ,
"brand_id" : "XX" ,
"departure_brand_id" : "3K" ,
"departure_time" : "21:50:00" ,
"departure_date" : "2025-04-12" ,
"departure_duration_minute" : "120" ,
"departure_arrival_time" : "00:50:00" ,
"departure_arrival_date" : "2025-04-13" ,
"departure_flight_number" : "206" ,
"departure_route_airport" : "CGK SIN" ,
"departure_stop" : "0" ,
"fare" : "130" ,
"flight_class" : "ECONOMY" ,
"client_interface" : "MOBILE-ANDROID" ,
"site" : "tripcomapp" ,
"trip_type" : "ROUND_TRIP" ,
"login_type" : "NON_LOGIN" ,
"return_brand_id" : "QZ" ,
"return_date" : "2025-04-16" ,
"return_departure_time" : "12:00:00" ,
"return_arrival_date" : "2025-04-16" ,
"return_arrival_time" : "12:50:00" ,
"return_flight_number" : "267" ,
"return_route_airport" : "SIN CGK" ,
"return_stop" : "0" ,
"return_duration_minute" : "110" ,
"route_airport" : "CGK SIN" ,
"scrape_date" : "2025-03-28" ,
"scrape_time" : "15:01:32.534Z" ,
"scraping_type" : "SCHEDULED" ,
"type" : "ECONOMY" ,
"num_adult" : 1 ,
"num_child" : null ,
"num_infant" : null
},
...rest
]
},
...rest
]
}
Demo Example
VIDEO