Travel fare aggregation: collect flight and hotel prices by market

Fares and room rates change with the market you search from. Collect them country by country, on a steady schedule.

By DINPROXY Team · · 8 min read

On this page

A fare or room rate only means something when you know where it was searched from. Airlines, hotels and booking sites price by point of sale, so a proxy for travel fare aggregation has one main job: make every search come from the country, or the city, whose prices you want to record. This page shows how to plan those searches, run them on DINPROXY residential proxies, hand the toughest booking sites to the Web Unlocker, and keep the results comparable from one day to the next.

What a fare depends on: market, dates and travellers

Point of sale is the market a booking is made from. The same return flight can be quoted in pounds on a British search and in euros on a German one, with different taxes shown, different card fees and sometimes a different fare altogether. Hotel sites vary the room rate, the currency and whether taxes are included in the headline figure. Your proxy location sets the market; everything else comes from the search itself.

Fix the search parameters before you collect anything, and store them with every result:

ParameterFlightsHotelsTip
WhereOrigin and destination airport codesCity, area or propertyUse airport codes rather than city names, so two airports in one city stay apart
WhenDeparture and return datesCheck-in date and number of nightsTrack rolling lead times, such as 7, 14, 30, 60 and 90 days ahead
WhoAdults, children, infants, cabin classAdults, children, roomsKeep one standard party per route, such as one adult in economy
MarketCountry, language and currency of the searchCountry, language and currency of the searchSet the country in the proxy username and keep the site's language and currency fixed
Trip typeOne-way, return or multi-cityNot neededStore one-way and return fares as separate series

Join these values into a search key, such as FRA-JFK|2027-03-14|2027-03-21|1A|economy|de, and save it with each result. The key lets you line up results from different days and sites, and shows at once when a site has changed the search, for example by offering a nearby airport instead.

Country targeting is enough for most fare work. Add a state or city when you want to see what travellers in one region are offered, such as people who live near a regional airport, using the @state= and @city= options described in the location options guide.

Residential proxies first, the Web Unlocker for the toughest sites

Run most travel searches on Rotating Residential Proxies, which let you pick the market for each request and hold one IP for a whole search. Choose residential over Mobile Proxies for this work, because ticketing sites are among the categories the mobile network does not carry. Move a site to the Web Unlocker when its results appear only after scripts run, or when it challenges ordinary requests.

TaskUseSession and marketReason
Search flow: start page, results, fare detailsRotating Residential ProxiesSticky, 10 to 20 minutes, by countryThe site links the steps with cookies, so they belong to one visitor
Fare calendars or price pages you can open by URLRotating Residential ProxiesRotating, country of the searchEach request stands alone, so a new IP per request spreads the load
Hotel results for one city and dateRotating Residential ProxiesRotating, or a short sticky session, by country or cityOne page per search; go sticky if the site sets a session first
Results drawn by JavaScriptWeb Unlockercountry, wait_selectorHolds the response until the result list is on the page
Booking sites with strict anti-bot checksWeb Unlockercountry, auto_runsRetries and works around the checks; only successful results are billed

If you are weighing the two products for a particular site, our article Web Unlocker vs residential proxies sets out how each one handles a request.

A booking site usually turns one search into several requests. The start page sets cookies, the results page or results API is tied to those cookies, and the fare details page expects the same visitor again. Give the whole flow one residential IP with a sticky session, then begin the next search on a fresh one:

  1. Create a session ID for each search, such as a short random string, and add it to the username together with the market: 1024~myuser@country=de@session=fra0314a@time=15.
  2. Set time to cover the longest flow you expect. A window of 10 to 20 minutes is ample for search, results and details; the maximum is 120.
  3. Keep a cookie jar for the session, so the site's cookies travel from one step to the next.
  4. Move through the steps without long gaps. A sticky session left idle for 60 seconds can move to a new IP.
  5. When the search ends, discard the cookies and use a new session ID for the next search.

This flight price scraper runs one search from Germany in a single sticky session:

// npm install undici// Save as search.mjs and run: node search.mjsimport { fetch, ProxyAgent } from "undici";import { randomBytes } from "node:crypto";
const sessionId = randomBytes(6).toString("hex");const username = `1024~myuser@country=de@session=${sessionId}@time=15`;const token = `Basic ${Buffer.from(`${username}:YOUR_PASSWORD`).toString("base64")}`;const dispatcher = new ProxyAgent({ uri: "http://proxy.dinproxy.com:8800", token });const cookies = new Map();
// Sends the cookies collected so far and stores any new ones.async function get(url) {  const headers = { "accept-language": "de-DE,de;q=0.9" };  if (cookies.size) headers.cookie = [...cookies].map(([name, value]) => `${name}=${value}`).join("; ");  const response = await fetch(url, { dispatcher, headers, signal: AbortSignal.timeout(30000) });  for (const line of response.headers.getSetCookie()) {    const [pair] = line.split(";");    const at = pair.indexOf("=");    if (at > 0) cookies.set(pair.slice(0, at).trim(), pair.slice(at + 1));  }  return { status: response.status, body: await response.text() };}
const search = new URLSearchParams({ from: "FRA", to: "JFK", depart: "2027-03-14", return: "2027-03-21", adults: "1" });await get("https://travel.example.com/");const results = await get(`https://travel.example.com/flights/search?${search}`);console.log("results", results.status, results.body.length);const details = await get("https://travel.example.com/flights/offer/OFFER_ID");console.log("details", details.status, details.body.length);await dispatcher.close();

Swap in your own connection username and password for 1024~myuser and YOUR_PASSWORD. The addresses are placeholders: use the search and details URLs of the site you work with, as your browser shows them, and parse the fares from the saved pages. The Accept-Language header matches the German market, as a local browser's would. For more on session types, read when to rotate and when to stay sticky.

Let fares finish loading before you read them

Many booking sites send a bare results page first and fill in the fares with JavaScript a few seconds later. For those sites, call the Web Unlocker: it renders the page, and wait_selector holds the response until an element you name, such as the price in the first result card, has appeared. Add country to fetch from the market you are recording. This hotel price scraper asks for two nights in Berlin as seen from Germany:

// Node.js 18+. Save as hotels.mjs and run: node hotels.mjsconst auth = Buffer.from("1024~myuser:YOUR_PASSWORD").toString("base64");
const response = await fetch("https://app.dinproxy.com/api/unblocker/request", {  method: "POST",  headers: {    Authorization: `Basic ${auth}`,    "Content-Type": "application/json",    "Idempotency-Key": "BER-20270314-2n-2A-de-2026112009",  },  body: JSON.stringify({    target_url: "https://hotels.example.com/search?city=berlin&checkin=2027-03-14&nights=2&adults=2",    country: "de",    wait_selector: ".result-card .price",    response_format: "html",  }),  signal: AbortSignal.timeout(130_000),});
const result = await response.json();console.log(result.success ? result.data.html.length : `Not charged: ${response.status} ${result.code}`);

A request can take up to 2 minutes, so each example allows 130 seconds. The Idempotency-Key lets you repeat a request after a timeout and collect the stored result without paying twice. Build it from the search key plus the hour of collection, so a later refresh of the same search gets a key of its own. If the selector is not enough, wait_ms adds a fixed extra wait. Every parameter is listed in the API reference.

Compare fares like for like

Two prices from two sites can only be compared when they describe the same trip. Normalise every result before it reaches a chart, a report or a traveller:

  • The total, not the headline. Record base fare, taxes and fees separately where the site shows them, together with the total a traveller would pay. Some markets put taxes in the headline price; others add them at a later step.
  • Currency as displayed. Keep the amount and currency each market showed, and convert with a dated exchange rate only when you compare. Converting during collection hides genuine market differences.
  • Per night or per stay. Hotel sites show either. Bring everything to the same basis and keep the number of nights in the key.
  • What the price includes. For flights: cabin bag, checked bag, seat choice and change or refund rules. For hotels: room only or breakfast, and the cancellation policy. A cheaper fare without luggage is a different product.
  • The same party. Compare one adult in economy with one adult in economy, not with a family search divided by heads.
  • Local and UTC times. Departure times are in each airport's local time; record your collection time in UTC.

Store one row per offer rather than one per page: search key, site, market, airline or hotel, the price fields above, and the collection time. Keep the raw page alongside, so that when a site changes its layout you can parse old results again instead of losing a gap in your history.

Caching, refresh cadence and cost

The same search rarely needs fetching every few minutes. Cache each result under its search key with the time it was collected, answer from the cache while it is fresh, and refresh according to how soon the trip is:

  • Departures or check-ins within the next 7 days: every few hours, since fares close to the date often change quickly.
  • 8 to 30 days ahead: once or twice a day.
  • More than 30 days ahead: every few days.
  • Popular routes and peak dates: one notch faster than their lead time suggests.

Spread refreshes through the day instead of running them in one burst. Each account can keep up to 100 proxy connections open and run up to 100 Web Unlocker requests at once, so size your workers to fit, and slow down when a site answers with 429 or 503. Our guide to avoiding blocks while scraping goes further into pacing.

At $1 / GB for residential traffic and $1 / 1k results for the Web Unlocker, an example month looks like this, with the assumptions spelled out:

  • Flights on residential proxies: 40 routes × 5 lead times × 3 markets is 600 searches per refresh. If a full search flow (start page, results and details) adds up to about 1 MB, one refresh uses about 0.6 GB. Twice a day for 30 days makes 36 GB, or $36.00.
  • Hotels on the Web Unlocker: 15 cities × 4 check-in dates × 2 stay lengths × 2 markets is 240 results per refresh. Once a day for 30 days makes 7,200 results, or $7.20.

Check the flow size before you trust that estimate: run ten searches on one route, read the traffic on the dashboard's Overview, and scale from there. Residential traffic you buy never expires, and Web Unlocker requests that fail cost nothing.

Legitimate uses and where to draw the line

Fare data supports well-established work:

  • Fare and rate comparison, showing travellers what the same trip costs on different sites and in different markets.
  • Revenue management, where airlines and hotels watch competitors' public prices and check that their own rates appear consistently across booking channels.
  • Market research, such as tracking how fares on a route move with season, lead time and demand.

Keep collection to public search results that any visitor can see without signing in, respect each site's terms and the law wherever you operate, and treat any personal data you come across in line with data protection rules. Automated booking, holding seats or rooms in a basket and buying tickets in bulk are outside what DINPROXY is for.

Ready to try it? Follow the quick start, then run one route from two markets and compare the results. If you also watch retail prices and stock, see the price monitoring use case.

Frequently asked questions

It is collecting flight and hotel prices from many sites and markets into one dataset, so you can compare fares, watch competitors or study how prices move. Each result is stored with its route or property, dates, travellers and the market it was searched from.

Rotating residential proxies, because you can set the country or city of each search and keep one IP for the whole search with a sticky session. Use them rather than mobile proxies for travel sites, and use the Web Unlocker for booking sites that load fares with JavaScript or run strict anti-bot checks.

Use the requests library with a residential proxy username that includes the country and a session ID, keep the site's cookies in a requests.Session across the search, results and details steps, and save every result with its search parameters. For sites that render fares with JavaScript, call the Web Unlocker API with wait_selector instead.

Refresh by lead time: every few hours for trips in the next 7 days, once or twice a day for 8 to 30 days ahead, and every few days beyond that. Cache each result under its search key so repeated searches are answered from the cache.

Whether it is lawful depends on where you operate, the site's terms and what you collect, and we cannot give legal advice. Collect only public search results that need no login, do not automate bookings, respect site terms and local law, and treat any personal data in line with data protection rules.

Keep reading