Skip to content

This is a web scraper built with Node.js and Puppeteer to retrieve the cheap flights information

Notifications You must be signed in to change notification settings

XredaX/flights-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight API - Find Cheap Flights in Morocco

This is a web scraper built with Node.js and Puppeteer to retrieve the cheap flights information.

Installation

Before running the application, make sure you have Node.js and npm installed on your machine.

Clone the repository

git clone https://github.com/XredaX/flights-api.git

Navigate to the project directory

cd flights-api

Install dependencies

npm install

Usage

Before starting the server, if you want to see the backend working, set headless to false:

headless: false

If not, leave it as true:

headless: true

To start the server, run the following command:

npm run start

Once the server is running, you can access the API endpoint to retrieve flight information.

API Endpoint

GET /flights

Query Parameters:

  • from: Departure city name
  • to: Arrival city name
  • date: Departure date in yyyy-mm-dd format

Example Request:

http://localhost:4000/flights?from=Oujda&to=Rabat&date=2024-07-15

Make sure to change the configuration to match your setup

The Result:

Result Image

If you need any assistance with the code, feel free to contact me via email redaelbettioui@gmail.com

Or through LinkedIn Reda El Bettioui

If you appreciate the work, please consider giving it a star ⭐

About

This is a web scraper built with Node.js and Puppeteer to retrieve the cheap flights information

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published