Giter Club home page Giter Club logo

plane-ticket-scraper's Introduction

Flight Ticket Scraper

A highly experimental script for scraping flight ticket prices from Google Flights. Decodes the protobuf data returned by Google Flights and returns a JSON array with the results.

Usage

In the input object (index.js), you can specify the following:

  • fromIATAs - an array of IATA codes of the airports from which you want to fly. For example ["LAX", "SFO"].
  • toIATAs - an array of IATA codes of the airports to which you want to fly. For example ["LHR", "LGW"].
  • currency - a currency in which you want to see the prices. For example USD.
  • Date options:
    • Departure:
      • dateFrom - a date from which you want to fly TO your destination. For example 2024-12-03.
      • dateUntil - a date until which you want to fly TO your destination. For example 2024-12-10.
        • If you want to search only flights on a specific date, you can keep this one undefined.
    • Return:
      • dateFromRet - a date from which you want to return FROM your destination. For example 2024-12-03.
        • If you want to search only one-way flights, leave this field undefined.
      • dateUntilRet - a date until which you want to return FROM your destination. For example 2024-12-10.
        • If you want to search only return flights on a specific date, you can keep this one undefined.
  • maxTransfers - set how many transfers you want to have on your flight (0 up to 2, any other value will be ignored and no constraint will be applied).

Note that with large date ranges, the script may take a long time to run - it efficiently calculates a cross product of all the possible combinations of the specified parameters - all the source airports, target airports and dates.

Output

The tool outputs a JSON array with date of the flight, its length, number of transfers, price, IATA of the aircraft and more.

JSON array with results

Finding the actual tickets

While this tool returns a lot of data, it doesn't retrieve the actual links to the airline tickets.

However, searching for the tickets on Google Flights usually yields very similar results - at least at the time of scraping the data.

plane-ticket-scraper's People

Contributors

barjin avatar

Stargazers

Dmitry Simonov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.