This repo followed implemented by this article : หาตั๋วเครื่องบินราคาถูกล่วงหน้าด้วย Javascript และ Puppeteer
-
npm i
-
touch .env to create .env file to setup env
PORT = 3000; YELLOW_AIRLINE = "YellowAir"; RED_AIRLINE = "RedAir"; YELLOW_AIRLINE_URL = "https://www.yellowair.com/Flight/GetCalendarFare"; RED_AIRLINE_URL = "https://www.redair.com/th/th";
-
npm start
-
use postman
-
GET : /v1/{yellowairline|redairline}: to get yellow airline or red airline fares with these query params
- from = departure
- to = destination
- fromDate = MM/DD/YYYY
- toDate = MM/DD/YYYY
- currency
- expectPrice
-
example
/v1/yellowairline?from=DMK&to=NRT&fromDate=08/1/2019&toDate=08/31/2019¤cy=THB&expectPrice=7000
-