This is a web scraper built with Node.js and Puppeteer to retrieve the cheap flights information.
Before running the application, make sure you have Node.js and npm installed on your machine.
git clone https://github.com/XredaX/flights-api.git
cd flights-api
npm install
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.
GET /flights
Query Parameters:
from
: Departure city nameto
: Arrival city namedate
: 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:
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 ⭐