A tool to automatically alert you to Southwest price drops!
For those who read this blog regularly, you'll know that I have two passions: business intelligence and travel hacking. Nothing excites me more than being able to combine the two in novel ways; this post is the third entry in our "Travel Hacking" series that does just that!
Southwest Airlines has one of the most generous ticket change and cancellation policies in the world. Included in that policy is a truly unique gem. If the price of a flight you have already booked happens to go down, Southwest will refund the price difference to a flight credit that you can use on future bookings.
The only problem is Southwest draws the line at actually alerting you about price drops. If you happen to find that the price has gone down on your own, you are entitled to claim your credit; but Southwest will not proactively email you that a better deal is available. That's completely understandable...but means that if you don't happen to be checking Southwest for each of your booked itineraries on a regular basis you are likely to miss out on price drops opportunities.
That's where this tool comes in! It's completely free and just requires a Windows computer. All you need to do is (a) download it, (b) unzip it to C:\SouthwestTracker, and (3) follow the PDF instructions provided. It takes about 5 - 10 minutes to set up. Once it is up and running you will start getting email alerts like this whenever one of your flights drops in price!
In anticipation of a couple questions techies are likely to have after examining the tool:
- Isn't this a really complex way to get data? Wouldn't a REST query be more efficient? Absolutely it would. But Southwest's REST API has one of the most robust security schemes I have ever seen. They have gone to absurd lengths to prevent automated queries against their databases. Short of hacking, browser macro automation is the only practical approach.
- Why does this use QlikView? Isn't Qlik Sense a newer and better tool? It is, but QlikView is available as a standalone executable which doesn't require a license to open and run local applications.
So I have this all set up as instructed. I don’t seem to have any errors. When you run the test how long should it take to get results?
Results are instant. If you want to test that it’s working, simply set the price to track in the CSV file to higher than what a flight is currently selling for. That should trigger an email next time the tool runs (you can run it right away in Task Scheduler by clicking “Run”).
I must be doing something wrong I’ve tried in on 3 different computers and can’t get it to work.
Try to narrow down at which point it stops working. When you run it do you see the browser open and go through its routine (go to southwest.com, save one page at a time)? If you look at the “HTMLOutput” folder after it runs do you see HTML files in there? The order of the script is: (a) output HTML files, (b) reload QlikView app, (c) email if price drop detected.
So i have double checked the process to make sure i have everything set correctly and it appears i do. when i run a test on the task scheduler. all i get is a blue screen that pops up and then goes away. I dont see anything else and there is no data saved in the HTMLOutput folder
Sounds like it’s not running the Chrome macro at all. Open Chrome, click on the extensions (puzzle piece) icon, open UI.Vision RPA. On the bottom, switch Storage Mode to “File system”. You should see a single macro there called SouthwestTracker. Try to run it. If you’re not seeing that macro, you might not have performed Step 5 in the instructions.
OK, I changed the mode to file system and reinstalled XModules. Then ran the Macro by clicking the SouthwestTracker. IT appeared to go through the process. I saw Chrome open go to the SW site enter in my date (which i changed the date format on the excel sheet) and it closed everything out as it should.
So I again tried to run it from the task scheduler and i still only get the blue screen that flashes and nothing else.
I do want to say Thank you for your time and patience and also quick reply’s.
Follow UP…. I got it working.
The one Simple thing I not include..
On step 10 when you add Arguments:
I only added the path “C:\Southwest….” not the full Argument -Execution policy Bypass …….
Again, Thank you for your help. this is amazing.
Hi Vlad,
I have your tool installed, but the task is unable to move forward when trying to save the HTML file, returning an “invalid file name” dialogue. I believe this has to do with the forward slashes included in the “Date” column in the CSV file. Windows does not allow forward slashes to be part of the file name. I believe this is the information retrieved on line 139 of the SouthwestTracker.json file, specifically the “COL4” argument. Are you able to correct this so that the file name doesn’t include the forward slashes from the date? Thank you!
Dates shouldn’t include slashes, they should be formatted as YYYY-MM-DD. See the instruction document for more details.
Ok great, I missed that, thank you! Just to let you know, the sample rows in the SouthwestTracker.csv file contain dates with forward slashes. Thank you!
Hi, Matt. That’s not the case. Here are the contents of the sample CSV:
FlightNumber,Origin,Destination,Date,FareType,PriceType,PriceToTrack
1973,BWI,ORD,2023-05-03,Wanna Get Away,USD,124
1096 / 1935,BWI,ORD,2023-05-04,Wanna Get Away,POINTS,12646
The slash is to represent connecting flights, it’s not in the date column. The instruction document should help you out.
Sounds good, I think it was just Excel auto-formatting the date column and adding in slashes. Thank you!
That’s a really good point I didn’t mention in the instructions, you shouldn’t use Excel to edit the CSV for exactly that reason. Will amend the instruction document.
This is great, thank you! I have a question… if I have a flight booked at the Wanna Get Away plus rate (because Wanna Get Away wasn’t available), can I set up two alerts for the same flight? In other words, one alert if the Wanna Get Away plus rate drops and another if Wanna Get Away becomes available? Or is it one alert per flight? Thanks again! Amazing work.
I just checked and it works fine to set up two alerts for the same flight.
this is amazing, BUT I have a mac and I’m assuming I can’t use it 🙁 any way to get a mac compatible version?
Not with this method, Nicole. It’s probably possible to adapt this using a technology other than QlikView, which only runs on Windows, but that’s outside the scope of what I can take on.
Very thorough instructions. Took me about 10 minutes and works exactly as described. Thank you!
Vlad,
First, thank you very much for the tool. I have been looking for this exact thing for a very long time. I got everything setup and working without issue. I have several flights loaded to monitor (7) and it is bombing out (It worked/works fine with 5). In UI.Vision I’m seeing the error “25 commands limit reached”. Is that just a limitation of the Ui or is there something to adjust that will allow more to run?
Thank you,
Bret
Oh that’s interesting, I didn’t know there was a limit. But you are correct, a Google search reveals that the limit applies to “XType” commands in the macro. The macro has 5 XType commands per run, so 5 flights will put you at the limit of 25. You can get around this by buying the full version of UIVision RPA (“personal edition”) for $89. I suppose you could also break the PowerShell script up so half runs in Chrome and half runs in Edge, that shouldn’t be too hard and will let you track up to 10 flights.
Thank you for the reply. I found that as well. I also considered Making a second directory and running a second task, but the Edge ide ais probably easier. Thanks again.
how do you do this, create a 2nd task scheduler for the edge browser – do you need to create a 2nd southwesttracker.csv file with flight #6-#10? if so do you have to modify the powershell script to point to this new .csv file?
There would be a bit of work involved. You would need to create a second CSV, yes (name it SouthwestTracker2.csv). You would need to create a new copy of SouthwestTracker.json (the macro definition) to point to the new CSV. You would also need a second copy of start-SouthwestTracker.html that points to the new macro file. You wouldn’t need to create a new PowerShell, you could just use SouthwestTracker_Edge.ps1 that’s included in the zip, but you would need to modify line 87 to point to the new HTML file you created. Finally, you would need to open PriceAnalysis.qvw, open the script editor (CTRL + E), go to the Alerts tab, delete lines 3 – 15, and replace with this:
csvtemp:
LOAD * FROM Southwest*.csv (txt, codepage is 28591, embedded labels, delimiter is ‘,’, msq);
INNER JOIN (Data) LOAD
purgechar(FlightNumber,’ ‘) as FlightNumber,
FlightNumber as FlightNumberFormatted, //for alert
Origin,
Destination,
Date,
upper(FareType) as FareClass,
FareType as FareClassFormatted, //for alert
PriceType as FareType,
PriceToTrack
RESIDENT csvtemp;
DROP TABLE csvtemp;
Awesome tool but having some issues getting it up and running. It looks like the HTML pull is only grabbing the front splash search screen and not the results page.
Possible change from Southwest to combat this tool?
Doubt Southwest cares about a peasant like me 🙂 I think this is likely being caused by defaults on your own computer. Namely that you might have last saved a site from your Chrome in HTML Only mode. Try to save any random webpage as Complete one time and then run the tool again. I think that might change your browser behavior back to default.
Also, if Chrome is giving you trouble you can try Edge, I included both scripts in the Zip file.
It seems like something isn’t working quite right for me at the end of the script or the QlikView step.
I set the price to something much higher than the current fare to test, but I’m not getting an email.
Here’s the end of the macro log:
…
[info] Executing: | comment | Store dummy CSV file to let PowerShell know that macro has completed (more reliable than Macro log and also lets us keep log file for examination in the event of an error) | |
[info] Executing: | store | Dummy | !csvLine |
[info] Executing: | csvSave | C:\SouthwestTracker\HTMLOutput\Done.csv | |
[info] Macro completed (Runtime 94.98s)
There are files in HTMLOutput, but the content of Done.csv is just “Dummy”
Thanks for any insight you may have — this tool looks awesome 🙂
I should add, I’m running in Edge and I do have my email address in the Edge ps1 file and I do point to the _Edge file in the task arguments
If dummy.csv is being generated but not deleted (which happens automatically as part of the PowerShell script), then I’d say something is likely going wrong with the execution of the PowerShell script itself. The deletion happens on line 103 and QlikView isn’t until line 108, so the problem wouldn’t be with QlikView. It could be that paths aren’t set properly, but honestly it could be a lot of things. I would recommend you go back through the installation manual and make sure you’re following it precisely.
The process after hitting run seems to almost be working perfectly but the blue screen stays open and a Script Error screen appears saying File not found error. Cannot open file: C:\SouthwestTracker\HTMLOutput\….
Do you know what I could have done wrong?
I will say that I had to uninstall everything and reinstall. The only step that seems to be different than what your instructions say is Step #7. When I perform that stop it doesn’t ask me if I want to continue anymore. I know it says that this action needs to only be performed once but after uninstalling everything and starting from Step #1 this appears to be the only that doesn’t exactly follow your steps.
Thank you!
You would need to make sure you have populated the CSV with flights you actually want to track. The example CSV that was included had flights that are now in the past, so the script wouldn’t run successfully with those.
Regarding step 7, the step only needs to be performed once per computer. So even if you uninstall and reinstall you don’t need to do it again.
Thank you!!! Super clear instructions. Worked beautifully first try. Windows 11 Home 22000.2295 v21H2
Vlad,
Thanks for creating this. One question, how long does it typically take to get an email alert? I tested and it was around 5-10 minutes after I ran the script. Also, didn’t know how many times Southwest changes prices daily so I’m running script several times a day.
In my experience pretty much instant, but this can obviously vary depending on both the SMTP server used and the receiving email server.
I have mine set to run several times after 3am. Is it normal for the chrome windows to still be open once I come back to the computer? When I test it the window normally closes.
I found that sometimes happens with Chrome for no discernable reason. Personally I switched to the Edge solution and found that runs more reliably without ghosts in the works.
Vlad – awesome tool. I have been looking for something like this for a while. Would it be possible to add two emails to the tracking? I tried putting two emails in an array to store in that variable but had no such luck. @(“email1@gmail.com”,”email2@gmail.com) — would that be correct implementation?
Hi, Reid. Glad you like the tool. You’d need to modify the Powershell code if you want the script to accept multiple email addresses. A simple workaround though is to create a distribution list with your email provider. That DL will have a single email address and will distribute/forward emails to all members.
Hi Vlad,
I got it set up and it’s running, I think. I don’t see any alerts by changing prices higher and lower than the published fare. Also, I noticed the UI stopped running after a few minutes. Here is the log. Does it mean the program stopped?
[info] Macro completed (Runtime 103.93s)
Bruce
Hi, Bruce. That’s not much to go on, I’m not really sure. I would advise to start over again from scratch and make sure to follow the instructions precisely.
Hi Vlad. It’s working this morning and I didn’t do anything different. I ran it many many times trying to follow the macros to see what it’s doing. I read through all the comments here maybe I missed something. I even stepped line by line using the UI hoping to see something. One thing though there is no Done.csv file. Is that file supposed to exist? Anyway many thanks for this cool tool.
Glad it’s working for you! Done.csv is automatically deleted by the PowerShell script after execution is complete.
The script is running and saving the files, but an email isn’t sent when there are lower price flights. I have set the prices well above the current price to test it, but it does not send.
I double checked the email address in the powershell file and it’s correct. I also noticed that the html files from the southwest sites are being cancelled before downloading, I’m not savvy enough to understand whether that is a part of the code or not (sorry..).
Any ideas? Much appreciated!
If the files are being canceled before downloading completes that could be an indication you have a slow internet connection. You can modify the JSON file that has the macro definition to give it a bit more time: C:\SouthwestTracker\uivision\macros\SouthwestTracker.json. Line 169 is the one to change. It’s currently set to 20000 (20 seconds) so you might want to try to change that to 30000 and see if that helps.
Thank you Vlad! I feel like I’ve wasted my question because the script is now working and I love it, but unfortunately it isn’t working when I am logged off. I’ve checked the windows task scheduler and the settings seem to be correct. Any ideas?
That’s correct, this only works when the computer is unlocked and logged onto. Says so right in the instructions 🙂
awesome too – thank you. I’m getting a ‘confirm save as’ dialog box that pops up: “Select Flights _ Southwest Airlines.htm already exists. Do you want to replace it?
Anyway to avoid having this pop up? Not sure if it affects the email results
That shouldn’t be happening, the macro takes care of that prompt. Make sure you are not touching your computer while the tool is running. Hands off the keyboard and mouse 🙂
Hmm, I just cleared everything, closed all windows and the browser, then opened task scheduler, started task and walked away. A couple minutes later got the email about price drop, walked back in the office and that dialog box save as came up again. Any idea what I can check?
You might have another instance of the script running in the background or something? Maybe try a reboot.
Unfortunately it’s still there after reboot. I trying changing between Edge & Chrome also but it’s still there. It still seems to work fine, yesterday’s email had different prices that today’s – will just have to close all the open dialog boxes and chrome windows every so often. This already saved me $50 on a flight! – thanks so much!
So I have been using this for months now and it is great. I deleted a couple of flights (they are in the past now), and it quit. I don’t think I messed up the file when I deleted the flights. I also tried removing all the flights and just leaving one at a time to detect where the error is occurring and I can’t figure it out. Any idea what to change with this error message?
Field not found error
Field ‘PriceType’ not found
INNER JOIN (Data) LOAD
purgechar(FlightNumber,’ ‘) as FlightNumber,
FlightNumber as FlightNumberFormatted,
Origin,
Destination,
Date,
upper(FareType) as FareClass,
FareType as FareClassFormatted,
PriceType as FareType,
PriceToTrack
FROM
SouthwestTracker.csv
(txt, codepage is 28591, embedded labels, delimiter is ‘,’, msq)
This is the flight that brought up that error message:
FlightNumber,Origin,Destination,Date,FareType,PriceType(POINTS/USD),PriceToTrack
3562 / 1857,BWI,NAS,2024-01-17,Wanna Get Away,USD,120
You probably deleted an extra character or two accidentally and misformatted the CSV file. I recommend downloading the template CSV and editing it from scratch.
Redownloading a fresh CSV fixed it! Thanks so much.