How to scrape flights data from Cheapflights using the Minexa API
Manually copying flight data from Cheapflights row by row is the kind of task that looks simple until you are three pages in and the prices have already changed. This guide shows how to connect the Minexa API to Cheapflights and pull structured flight data programmatically, starting from a single trained scraper.
What the data looks like before and after
Without automation, flight data from Cheapflights lives in a rendered page that updates dynamically. You can see the prices, airlines, and departure times, but you cannot query them, sort them across routes, or track them over time without copying each value manually. After training a scraper with the Minexa Chrome extension and calling the Minexa API, that same page becomes a structured JSON response with one row per flight result and one column per field.
Here is a sample of what the extracted data looks like:
[
{
"organization_name": "Plan International USA",
"location": "Providence, RI",
"rating_percentage": "97%",
"organization_category": "Economic development",
"annual_revenue_category": "$50M+ annual revenue",
"tax_exemption_status": "501(c)(03)"
},
{
"organization_name": "FIRST",
"location": "Manchester, NH",
"rating_percentage": "97%",
"organization_category": "Science",
"annual_revenue_category": "$50M+ annual revenue",
"tax_exemption_status": "501(c)(03)"
}
]The charity_focus_areas field returns a structured array of typed objects, each encoding a revenue tier label, a primary cause tag, and a secondary cause tag within a single traversable object per row. The cause_search_url field captures multiple filterable href values per record, letting you re-query by cause or size category without parsing any additional page. The rating_percentage field surfaces a plain numeric string per record, ready for threshold filtering or sorting across paginated runs without any transformation step.
Watch the full extraction walkthrough before going through the steps below:
Training the scraper: from page to configuration
Before the API can extract anything, a scraper needs to be trained once using the Minexa Chrome extension. Navigate to the Cheapflights search results page and open the extension.
Once the extension opens, confirm you are on the correct page. The extension detects the repeating result containers automatically.
The extension then shows the pagination options it detected. For the API workflow, you define the pagination logic yourself via a JS scenario rather than relying on automatic handling. Confirm and continue.
Choose whether to scrape the list only or to follow each result link and extract detail page data as well. For flight monitoring pipelines, the list view typically contains all the fields needed.
After the container is highlighted and confirmed, the extension generates all extracted columns automatically.
Calling the API: before manual triggers, after automated pulls
Once the scraper is saved, you get a stable scraper ID, for example 7214. Every API call references this ID. Pass your target URLs in the request body and the API returns structured JSON for each page.
Here is a ready-to-run Python snippet using the Minexa API:
import requests
url = "https://api.minexa.ai/data"
headers = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
payload = {
"scraper_id": 7214,
"urls": ["https://www.cheapflights.co.uk/flight-search/MNL-252cy/2026-07-10/2026-08-04"],
"columns": "top_40"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())For ongoing monitoring across multiple routes, set up a cron job on your own infrastructure and pass each route URL as a separate entry in the urls array. The API handles rendering and extraction; your cron job handles the trigger schedule.
Once the run completes, the full dataset is available for export to Excel or JSON directly from the Minexa dashboard.
To get started, visit minexa.ai and install the Chrome extension to train your first scraper. The API documentation is available at minexa.stoplight.io/docs/minexa.
For a related guide on building flight data pipelines, see: Scraping Azul Fidelidade flight deals with the Minexa.ai extension.


Comments