Skyscanner Flight Tickets Data

Vytenis Kaubrė
Last updated on
2025-03-12
3 min read
Vytenis Kaubrė
Last updated on
2025-03-12
3 min read
OxyCopilot allows users to easily generate scraping and parsing instructions to collect public Skyscanner data without a need for manual coding. Simply describe your requirements in plain English, and the system will generate an API request code with logic for parsing complex travel pages into structured, actionable insights.
We've created a sample showcasing how to use OxyCopilot and the necessary details to collect public flight ticket search data from Skyscanner.
Before using OxyCopilot, you need to register for our dashboard, claim a free trial (or choose a suitable plan) for our Web Scraper API, and create an API user. OxyCopilot lets you build scrapers while leveraging Oxylabs’ advanced scraping infrastructure, so you won’t be able to generate scraping and parsing instructions without the mentioned steps. You can find more information about it in the Getting Started part.
Copy
Parse the flight tickets search page. Get the total results count and pricing details for Best, Cheapest, Fastest tabs. Then, from each ticket, extract the following data:
- Price text
- Total deals count
- Departure time
- Departure airport
- Arrival time
- Arrival airport
- Duration time
- Stops label
- Aviation company name
- Ticket link
We regularly update this tutorial, but errors can still occur. Feel free to regenerate the prompt or contact us if you need help.
An overview of OxyCopilot after providing all the necessary details to get results
Once you complete all the steps and follow our recommendations for using OxyCopilot, this is the final result you will get:
Copy
{
"tickets": [
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": null,
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "United"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052210--32090-0-11616-2512061155?currency=USD&locale=en-US&market=US",
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/11442-2512051805--32090-0-11616-2512060725?currency=USD&locale=en-US&market=US",
"arrival_time": "7:25 AM",
"duration_time": "7h 20",
"departure_time": "6:05 PM",
"arrival_airport": "FRA",
"departure_airport": "EWR",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052210--31722-0-11616-2512061155?currency=USD&locale=en-US&market=US",
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 1,
"aviation_company_name": "United"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051545--32090-0-11616-2512060525?currency=USD&locale=en-US&market=US",
"arrival_time": "5:25 AM",
"duration_time": "7h 40",
"departure_time": "3:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": null,
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051545--31722-0-11616-2512060525?currency=USD&locale=en-US&market=US",
"arrival_time": "5:25 AM",
"duration_time": "7h 40",
"departure_time": "3:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 1,
"aviation_company_name": "United"
},
{
"price_text": "$524",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052015--31876-0-11616-2512060950?currency=USD&locale=en-US&market=US",
"arrival_time": "9:50 AM",
"duration_time": "7h 35",
"departure_time": "8:15 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Singapore Airlines"
},
{
"price_text": "$570",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051625--32415-0-11616-2512060555?currency=USD&locale=en-US&market=US",
"arrival_time": "5:55 AM",
"duration_time": "7h 30",
"departure_time": "4:25 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 18,
"aviation_company_name": "Condor"
},
{
"price_text": "$620",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/11442-2512052155--32090-0-11616-2512061150?currency=USD&locale=en-US&market=US",
"arrival_time": "11:50 AM",
"duration_time": "7h 55",
"departure_time": "9:55 PM",
"arrival_airport": "FRA",
"departure_airport": "EWR",
"total_deals_count": 14,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$476",
"stops_label": "1 stop",
"ticket_link": null,
"arrival_time": "10:40 AM",
"duration_time": "11h 55",
"departure_time": "4:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "ITA Airways"
}
],
"pricing_details": [
{
"price": "$443",
"tab_name": "Best"
},
{
"price": "$221",
"tab_name": "Cheapest"
},
{
"price": "$443",
"tab_name": "Fastest"
}
],
"total_results_count": 361
}
OxyCopilot generates a parsing schema that defines the data structure, including object types, field names, and descriptions. AI uses this schema to generate instructions, which you can modify in the Web Scraper API Playground to match your parsing needs.
Object type | Name | Description |
---|---|---|
Number | total_results_count | Total results count from the flight tickets search page. |
Array of objects | pricing_details | Pricing details for Best, Cheapest, Fastest tabs. |
String | tab_name | Name of the tab (Best, Cheapest, Fastest). |
String | price | Price for the respective tab. |
Array of objects | tickets | List of tickets with detailed information. |
String | price_text | |
Number | total_deals_count | |
String | departure_time | |
String | departure_airport | |
String | arrival_time | |
String | arrival_airport | |
String | duration_time | |
String | stops_label | |
String | aviation_company_name | |
String | ticket_link |
If you've never used our Web Scraper API before, you need to sign up for a 1-week free trial or choose a suitable plan on the dashboard to get started.
Register on the Oxylabs dashboard, select the product, then navigate to the pricing, and click Start free trial:
Afterwards, you'll need to create your API user. Enter your preferred username, password, and click Create API User.
Remember to save your credentials as you'll need them to use the Web Scraper API and OxyCopilot for all scraping tasks.
We also have a video tutorial, explaining how to claim a free trial, create an API user, and more:
Once the setup is complete, find the Scraper APIs Playground button on your left. Click on it, and you'll be redirected to the playground, where you can use the OxyCopilot.
Once you're on the Scraper APIs Playground page, click the main OxyCopilot button in the top-left corner to begin creating your scraper and parser for collecting flight tickets data from Scyscanner.
After clicking this button, you'll see the table, where you need to enter URLs, Scraper Parameters, and Parsing instructions.
You can submit any Skyscanner URL to OxyCopilot. But for this example, let’s use the results page from a flight ticket search:
Copy
https://www.skyscanner.com/transport/flights/nyca/fran/251205/?currency=USD&locale=en-US&market=US
Define your preferred API parameters, such as geographic location settings. It's essential to enable JavaScript rendering to ensure all dynamic page content is captured. Below is an example that configures OxyCopilot to process requests with United States geolocation settings:
Copy
Scrape this URL from the United States location.
Next, to generate parsing instructions, provide a prompt describing the data points you want to extract from a specific Skyscanner page. Keep your prompt well-structured and clean, and resubmit it if needed to achieve the output you’re looking for. Here’s an example prompt for Skyscanner’s flight listings page:
Copy
Parse the flight tickets search page. Get the total results count and pricing details for Best, Cheapest, Fastest tabs. Then, from each ticket, extract the following data:
- Price text
- Total deals count
- Departure time
- Departure airport
- Arrival time
- Arrival airport
- Duration time
- Stops label
- Aviation company name
- Ticket link
OxyCopilot will process the input prompt and produce a set of JSON-formatted parsing instructions compatible with the API’s Custom Parser feature. These are the raw instructions that define how data is extracted from Skyscanner pages.
Save these instructions for use with future API calls, or simply click the "Save Instructions" button and then copy the full API request code in your preferred programming language.
Copy
{
"total_results_count": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
"//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[3]/div[1]/span/text()",
"//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@class=\"ResultsSummary_summaryContainer__MGYyO\"]/div[1]/span/text()",
"//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@id=\"content-wrap\"]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@id=\"pagewrap\"]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()",
"/html/body/div[1]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()"
]
},
{
"_fn": "amount_from_string"
}
]
},
"pricing_details": {
"_fns": [
{
"_fn": "xpath",
"_args": [
"//div[@class=\"BpkSegmentedControl_bpk-segmented-control-group__N2E1Y\"]/button",
"//div[@role=\"radiogroup\"]/button",
"//div[@class=\"FqsTabs_fqsTabsWithSparkle__M2IzN\"]/div/button",
"//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[4]/div/button",
"//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[4]/div/button",
"//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[4]/div/button",
"//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[4]/div/button",
"//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[4]/div/button",
"//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/button",
"//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/button"
]
}
],
"_items": {
"tab_name": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/p[1]/text()",
".//div/p[1]/text()",
".//p[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--footnote__ZGEwM FqsTab_fqsTabWithSparkleText__Yjc0M\"]/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"price": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--heading-4__OWJjY\"]/text()",
".//div[@class=\"Price_mainPriceContainer__YjNmN\"]/span/text()",
".//div[@aria-hidden=\"true\"]/div/span/text()",
".//div[@class=\"FqsTab_priceContainer__NWNlZ\"]/div/div/span/text()",
".//div[@class=\"FqsTab_priceContainer__NWNlZ\"]/div[1]/div/span/text()",
".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/div/div/div/span/text()",
".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/div/div[1]/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
}
}
},
"tickets": {
"_fns": [
{
"_fn": "xpath",
"_args": [
"//div[@class=\"FlightsResults_dayViewItems__MDhmZ\"]/div",
"//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[5]/div",
"//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[5]/div",
"//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[5]/div",
"//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[5]/div",
"//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[5]/div",
"//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div",
"//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div",
"//div[@id=\"content-wrap\"]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div",
"//div[@id=\"pagewrap\"]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div"
]
}
],
"_items": {
"price_text": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--lg__MmExZ\"]/text()",
".//div[@class=\"Price_mainPriceContainer__YjNmN\"]/span/text()",
".//div[@class=\"TicketStub_horizontalStubContainer__YTUxN\"]/span[2]/div/div/span/text()",
".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__stub__MmU5Y Ticket_stub__YWRmY BpkTicket_bpk-ticket__stub--padded__ZjViO BpkTicket_bpk-ticket__stub--horizontal__YzhiZ\"]/div/span[2]/div/div/span/text()",
".//div[@role=\"button\"]/div[2]/div/span[2]/div/div/span/text()",
".//div[@class=\"BpkTicket_bpk-ticket__MjE3Y\"]/div[2]/div/span[2]/div/div/span/text()",
".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/div/div[2]/div/span[2]/div/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"total_deals_count": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--xs__YjI4N DealsFrom_dealsText__YWVlN\"]/text()",
".//div[@class=\"TicketStub_horizontalStubContainer__YTUxN\"]/span[1]/text()",
".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__stub__MmU5Y Ticket_stub__YWRmY BpkTicket_bpk-ticket__stub--padded__ZjViO BpkTicket_bpk-ticket__stub--horizontal__YzhiZ\"]/div/span[1]/text()",
".//div[@role=\"button\"]/div[2]/div/span[1]/text()",
".//div[@class=\"BpkTicket_bpk-ticket__MjE3Y\"]/div[2]/div/span[1]/text()",
".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/div/div[2]/div/span[1]/text()",
".//div[@class=\"FlightsTicket_container__Y2QyN\"]/a/div/div[2]/div/span[1]/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
},
{
"_fn": "amount_from_string"
}
]
},
"departure_time": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"LegInfo_routePartialDepart__NjFhZ\"]/span[1]/div/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[1]/span[1]/div/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[1]/span[1]/div/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[1]/span[1]/div/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[1]/span[1]/div/span/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[1]/span[1]/div/span/text()",
".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[1]/span[1]/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"departure_airport": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"LegInfo_routePartialDepart__NjFhZ\"]/span[2]/div/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[1]/span[2]/div/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[1]/span[2]/div/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[1]/span[2]/div/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[1]/span[2]/div/span/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[1]/span[2]/div/span/text()",
".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[1]/span[2]/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"arrival_time": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"LegInfo_routePartialArrive__ZDM3M\"]/span[1]/div/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[3]/span[1]/div/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[3]/span[1]/div/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[3]/span[1]/div/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[3]/span[1]/div/span/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[3]/span[1]/div/span/text()",
".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[3]/span[1]/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"arrival_airport": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"LegInfo_routePartialArrive__ZDM3M\"]/span[2]/div/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[3]/span[2]/div/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[3]/span[2]/div/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[3]/span[2]/div/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[3]/span[2]/div/span/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[3]/span[2]/div/span/text()",
".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[3]/span[2]/div/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"duration_time": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--caption__YWNmZ Duration_duration__N2ZjM\"]/text()",
".//div[@class=\"LegInfo_stopsContainer__NDZmZ\"]/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[2]/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[2]/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[2]/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[2]/span/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[2]/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"stops_label": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--xs__YjI4N LegInfo_stopsLabelGreen__ZmJhM\"]/text()",
".//div[@class=\"LegInfo_stopsLabelContainer__NWZkZ\"]/span/text()",
".//div[@class=\"LegInfo_stopsContainer__NDZmZ\"]/div[2]/span/text()",
".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[2]/div[2]/span/text()",
".//div[@aria-hidden=\"true\"]/div[2]/div[2]/div[2]/span/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[2]/div[2]/span/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[2]/div[2]/span/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"aviation_company_name": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//div[@class=\"LogoImage_container__ZThkM LegLogo_logoContainer__ZjM1N UpperTicketBody_legLogo__ZmVkN\"]/span[1]/text()",
".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[1]/span[1]/text()",
".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[1]/span[1]/text()",
".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[1]/span[1]/text()",
".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[1]/span[1]/text()",
".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__main__Y2FhO BpkTicket_bpk-ticket__main--padded__YzdlM BpkTicket_bpk-ticket__main--horizontal__MmM5M\"]/div/div[1]/div[3]/div/div[1]/span[1]/text()",
".//div[@role=\"button\"]/div[1]/div/div[1]/div[3]/div/div[1]/span[1]/text()"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
},
"ticket_link": {
"_fns": [
{
"_fn": "xpath_one",
"_args": [
".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/@href",
".//div[@class=\"FlightsTicket_container__Y2QyN\"]/a/@href",
".//div[@class=\"FlightsTicketWrapper_itineraryContainer__YzcxM\"]/div/a/@href",
".//div/div/a/@href"
]
},
{
"_fn": "regex_search",
"_args": [
"^\\s*(.[\\s\\S]*?)\\s*$",
1
]
}
]
}
}
}
}
Here's the generated API request code you can use in your preferred IDE to gather flight tickets data from Skyscanner. Remember to enter the credentials you've got after creating your API user because you won't be able to use our Web Scraper API.
Copy
import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'universal',
'url': 'https://www.skyscanner.com/transport/flights/nyca/fran/251205/?currency=USD&locale=en-US&market=US',
'geo_location': 'United States',
'render': 'html',
'parse': True,
'parsing_instructions': {"total_results_count":{"_fns":[{"_fn":"xpath_one","_args":["//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[3]/div[1]/span/text()","//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@class=\"ResultsSummary_summaryContainer__MGYyO\"]/div[1]/span/text()","//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@id=\"content-wrap\"]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@id=\"pagewrap\"]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()","/html/body/div[1]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[3]/div[1]/span/text()"]},{"_fn":"amount_from_string"}]},"pricing_details":{"_fns":[{"_fn":"xpath","_args":["//div[@class=\"BpkSegmentedControl_bpk-segmented-control-group__N2E1Y\"]/button","//div[@role=\"radiogroup\"]/button","//div[@class=\"FqsTabs_fqsTabsWithSparkle__M2IzN\"]/div/button","//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[4]/div/button","//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[4]/div/button","//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[4]/div/button","//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[4]/div/button","//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[4]/div/button","//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/button","//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[4]/div/button"]}],"_items":{"tab_name":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/p[1]/text()",".//div/p[1]/text()",".//p[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--footnote__ZGEwM FqsTab_fqsTabWithSparkleText__Yjc0M\"]/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"price":{"_fns":[{"_fn":"xpath_one","_args":[".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--heading-4__OWJjY\"]/text()",".//div[@class=\"Price_mainPriceContainer__YjNmN\"]/span/text()",".//div[@aria-hidden=\"true\"]/div/span/text()",".//div[@class=\"FqsTab_priceContainer__NWNlZ\"]/div/div/span/text()",".//div[@class=\"FqsTab_priceContainer__NWNlZ\"]/div[1]/div/span/text()",".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/div/div/div/span/text()",".//div[@class=\"FqsTab_fqsTabWithSparkle__NjgxZ\"]/div/div[1]/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]}}},"tickets":{"_fns":[{"_fn":"xpath","_args":["//div[@class=\"FlightsResults_dayViewItems__MDhmZ\"]/div","//div[@class=\"FlightsDayView_results__OTY2M\"]/div[1]/div[5]/div","//div[@data-e2e=\"layout-columns\"]/div[2]/div[1]/div[5]/div","//div[@class=\"FlightsDayView_container__Mzg4Z\"]/div[2]/div[1]/div[5]/div","//div[@class=\"FlightsDayView_screen__ODlkY\"]/div[2]/div[2]/div[1]/div[5]/div","//div[@class=\"FlightsDayView_row__MjNjO\"]/div/div[2]/div[2]/div[1]/div[5]/div","//main[@id=\"app-root\"]/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div","//div[@id=\"content\"]/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div","//div[@id=\"content-wrap\"]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div","//div[@id=\"pagewrap\"]/div[6]/div/main/div/div[1]/div/div[2]/div[2]/div[1]/div[5]/div"]}],"_items":{"price_text":{"_fns":[{"_fn":"xpath_one","_args":[".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--lg__MmExZ\"]/text()",".//div[@class=\"Price_mainPriceContainer__YjNmN\"]/span/text()",".//div[@class=\"TicketStub_horizontalStubContainer__YTUxN\"]/span[2]/div/div/span/text()",".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__stub__MmU5Y Ticket_stub__YWRmY BpkTicket_bpk-ticket__stub--padded__ZjViO BpkTicket_bpk-ticket__stub--horizontal__YzhiZ\"]/div/span[2]/div/div/span/text()",".//div[@role=\"button\"]/div[2]/div/span[2]/div/div/span/text()",".//div[@class=\"BpkTicket_bpk-ticket__MjE3Y\"]/div[2]/div/span[2]/div/div/span/text()",".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/div/div[2]/div/span[2]/div/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"total_deals_count":{"_fns":[{"_fn":"xpath_one","_args":[".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--xs__YjI4N DealsFrom_dealsText__YWVlN\"]/text()",".//div[@class=\"TicketStub_horizontalStubContainer__YTUxN\"]/span[1]/text()",".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__stub__MmU5Y Ticket_stub__YWRmY BpkTicket_bpk-ticket__stub--padded__ZjViO BpkTicket_bpk-ticket__stub--horizontal__YzhiZ\"]/div/span[1]/text()",".//div[@role=\"button\"]/div[2]/div/span[1]/text()",".//div[@class=\"BpkTicket_bpk-ticket__MjE3Y\"]/div[2]/div/span[1]/text()",".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/div/div[2]/div/span[1]/text()",".//div[@class=\"FlightsTicket_container__Y2QyN\"]/a/div/div[2]/div/span[1]/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]},{"_fn":"amount_from_string"}]},"departure_time":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"LegInfo_routePartialDepart__NjFhZ\"]/span[1]/div/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[1]/span[1]/div/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[1]/span[1]/div/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[1]/span[1]/div/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[1]/span[1]/div/span/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[1]/span[1]/div/span/text()",".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[1]/span[1]/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"departure_airport":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"LegInfo_routePartialDepart__NjFhZ\"]/span[2]/div/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[1]/span[2]/div/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[1]/span[2]/div/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[1]/span[2]/div/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[1]/span[2]/div/span/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[1]/span[2]/div/span/text()",".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[1]/span[2]/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"arrival_time":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"LegInfo_routePartialArrive__ZDM3M\"]/span[1]/div/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[3]/span[1]/div/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[3]/span[1]/div/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[3]/span[1]/div/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[3]/span[1]/div/span/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[3]/span[1]/div/span/text()",".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[3]/span[1]/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"arrival_airport":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"LegInfo_routePartialArrive__ZDM3M\"]/span[2]/div/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[3]/span[2]/div/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[3]/span[2]/div/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[3]/span[2]/div/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[3]/span[2]/div/span/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[3]/span[2]/div/span/text()",".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[2]/div[3]/span[2]/div/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"duration_time":{"_fns":[{"_fn":"xpath_one","_args":[".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--caption__YWNmZ Duration_duration__N2ZjM\"]/text()",".//div[@class=\"LegInfo_stopsContainer__NDZmZ\"]/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[2]/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[2]/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[2]/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[2]/span/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[2]/div[2]/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"stops_label":{"_fns":[{"_fn":"xpath_one","_args":[".//span[@class=\"BpkText_bpk-text__NDNiZ BpkText_bpk-text--xs__YjI4N LegInfo_stopsLabelGreen__ZmJhM\"]/text()",".//div[@class=\"LegInfo_stopsLabelContainer__NWZkZ\"]/span/text()",".//div[@class=\"LegInfo_stopsContainer__NDZmZ\"]/div[2]/span/text()",".//div[@class=\"LegInfo_legInfo__ZDQzZ\"]/div[2]/div[2]/span/text()",".//div[@aria-hidden=\"true\"]/div[2]/div[2]/div[2]/span/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[2]/div[2]/div[2]/span/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[2]/div[2]/div[2]/span/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"aviation_company_name":{"_fns":[{"_fn":"xpath_one","_args":[".//div[@class=\"LogoImage_container__ZThkM LegLogo_logoContainer__ZjM1N UpperTicketBody_legLogo__ZmVkN\"]/span[1]/text()",".//div[@class=\"LegDetails_container__OGVhZ UpperTicketBody_leg__NGVmM\"]/div[1]/span[1]/text()",".//div[@class=\"UpperTicketBody_legsContainer__ZGUwO\"]/div/div[1]/span[1]/text()",".//div[@class=\"UpperTicketBody_container__YWRmN\"]/div[3]/div/div[1]/span[1]/text()",".//div[@class=\"FlightsTicketBody_container__MzJjZ\"]/div[1]/div[3]/div/div[1]/span[1]/text()",".//div[@class=\"BpkTicket_bpk-ticket__paper__MmI0Z BpkTicket_bpk-ticket__main__Y2FhO BpkTicket_bpk-ticket__main--padded__YzdlM BpkTicket_bpk-ticket__main--horizontal__MmM5M\"]/div/div[1]/div[3]/div/div[1]/span[1]/text()",".//div[@role=\"button\"]/div[1]/div/div[1]/div[3]/div/div[1]/span[1]/text()"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]},"ticket_link":{"_fns":[{"_fn":"xpath_one","_args":[".//a[@class=\"FlightsTicket_link__ZmE1Z\"]/@href",".//div[@class=\"FlightsTicket_container__Y2QyN\"]/a/@href",".//div[@class=\"FlightsTicketWrapper_itineraryContainer__YzcxM\"]/div/a/@href",".//div/div/a/@href"]},{"_fn":"regex_search","_args":["^\\s*(.[\\s\\S]*?)\\s*$",1]}]}}}}
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('YOUR_USERNAME', 'YOUR_PASSWORD'), # Your credentials go here
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with results.
pprint(response.json())
To find more information about using our Web Scraper API, such as parameter values, integration methods or features, check our detailed documentation.
The API response will return structured Skyscanner data based on the parsing instructions, as shown below:
Copy
{
"tickets": [
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": null,
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "United"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052210--32090-0-11616-2512061155?currency=USD&locale=en-US&market=US",
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/11442-2512051805--32090-0-11616-2512060725?currency=USD&locale=en-US&market=US",
"arrival_time": "7:25 AM",
"duration_time": "7h 20",
"departure_time": "6:05 PM",
"arrival_airport": "FRA",
"departure_airport": "EWR",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052210--31722-0-11616-2512061155?currency=USD&locale=en-US&market=US",
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 1,
"aviation_company_name": "United"
},
{
"price_text": "$443",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051545--32090-0-11616-2512060525?currency=USD&locale=en-US&market=US",
"arrival_time": "5:25 AM",
"duration_time": "7h 40",
"departure_time": "3:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": null,
"arrival_time": "11:55 AM",
"duration_time": "7h 45",
"departure_time": "10:10 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$451",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051545--31722-0-11616-2512060525?currency=USD&locale=en-US&market=US",
"arrival_time": "5:25 AM",
"duration_time": "7h 40",
"departure_time": "3:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 1,
"aviation_company_name": "United"
},
{
"price_text": "$524",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512052015--31876-0-11616-2512060950?currency=USD&locale=en-US&market=US",
"arrival_time": "9:50 AM",
"duration_time": "7h 35",
"departure_time": "8:15 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 19,
"aviation_company_name": "Singapore Airlines"
},
{
"price_text": "$570",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/12712-2512051625--32415-0-11616-2512060555?currency=USD&locale=en-US&market=US",
"arrival_time": "5:55 AM",
"duration_time": "7h 30",
"departure_time": "4:25 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": 18,
"aviation_company_name": "Condor"
},
{
"price_text": "$620",
"stops_label": "Direct",
"ticket_link": "/transport/flights/nyca/fran/251205/config/11442-2512052155--32090-0-11616-2512061150?currency=USD&locale=en-US&market=US",
"arrival_time": "11:50 AM",
"duration_time": "7h 55",
"departure_time": "9:55 PM",
"arrival_airport": "FRA",
"departure_airport": "EWR",
"total_deals_count": 14,
"aviation_company_name": "Lufthansa"
},
{
"price_text": "$476",
"stops_label": "1 stop",
"ticket_link": null,
"arrival_time": "10:40 AM",
"duration_time": "11h 55",
"departure_time": "4:45 PM",
"arrival_airport": "FRA",
"departure_airport": "JFK",
"total_deals_count": null,
"aviation_company_name": "ITA Airways"
}
],
"pricing_details": [
{
"price": "$443",
"tab_name": "Best"
},
{
"price": "$221",
"tab_name": "Cheapest"
},
{
"price": "$443",
"tab_name": "Fastest"
}
],
"total_results_count": 361
}
Object type | Name | Description |
---|---|---|
Number | total_results_count | Total results count from the flight tickets search page. |
Array of objects | pricing_details | Pricing details for Best, Cheapest, Fastest tabs. |
String | tab_name | Name of the tab (Best, Cheapest, Fastest). |
String | price | Price for the respective tab. |
Array of objects | tickets | List of tickets with detailed information. |
String | price_text | |
Number | total_deals_count | |
String | departure_time | |
String | departure_airport | |
String | arrival_time | |
String | arrival_airport | |
String | duration_time | |
String | stops_label | |
String | aviation_company_name | |
String | ticket_link |
Scale up your business with Oxylabs®
Proxies
Advanced proxy solutions
Data Collection
Datasets
Resources
Innovation hub