https://github.com/xredax/flights-api
https://github.com/xredax/flights-api
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/xredax/flights-api
- Owner: XredaX
- Created: 2024-05-21T22:00:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-21T22:45:52.000Z (12 months ago)
- Last Synced: 2024-05-22T12:39:51.652Z (12 months ago)
- Language: TypeScript
- Size: 14.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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:
If you need any assistance with the code, feel free to contact me via email [email protected]
Or through LinkedIn Reda El Bettioui
If you appreciate the work, please consider giving it a star ⭐