{"id":2192,"date":"2020-01-19T13:29:26","date_gmt":"2020-01-19T13:29:26","guid":{"rendered":"https:\/\/www.codeastar.com\/?p=2192"},"modified":"2020-01-19T15:16:34","modified_gmt":"2020-01-19T15:16:34","slug":"cheap-flights-checker-flight-for-your-dream","status":"publish","type":"post","link":"https:\/\/www.codeastar.com\/cheap-flights-checker-flight-for-your-dream\/","title":{"rendered":"Cheap Flights Checker – Flight for your dream"},"content":{"rendered":"\n

We love travel and we love easy stuff. So we have our easy flight prices checker :]] . When we start to plan our vacation, flight ticket is always the first item we purchase. It would be great if we can have a look on cheap flight tickets around our desired date. No worries, the wait is over. This time, we are using Python (as always) to make a cheap flights checker.<\/p>\n\n\n\n

Get the Cheap Flights<\/h3>\n\n\n\n

First things first, we do not get cheap flight prices from thin air. So we have to get the price info from somewhere. Ideally, we should get anything from Google, but the reality is, Google cut their flight fare API<\/a> in April 2018. <\/p>\n\n\n\n

There are several travel search sites, like Skyscanner, Expedia and Kayak. We should possibly get the cheap flight prices from APIs on those sites. The good thing is, they do provide APIs for getting flight prices, but the bad thing is, they only open those APIs to travel agencies and partners. Well, CodeAStar never gonna let you down<\/a>. We can’t get the API from those travel search sites directly, but we can still be able to get it from an API marketplace and it is FREE<\/strong>.<\/p>\n\n\n\n

So we start our journey from the API marketplace, RapidAPI<\/a>.<\/p>\n\n\n\n

Setup your API account<\/h3>\n\n\n\n

RapidAPI is a place where developers can purchase API access from different providers. There are several free APIs as well and the flight prices API is one of them. So we need to create an account there (again, it is free). After that we can go to the flight prices API page<\/a> which is connected to Skyscanner<\/a> API.<\/p>\n\n\n\n

The actual sequence should look like:<\/p>\n\n\n\n

\"RapidAPI<\/figure><\/div>\n\n\n\n

Once the account has been done, the rests are straight forward. We can use Python modules, requests and JSON, to get flight prices, likes the way we did in getting weather info from AccuWeather<\/a>.<\/p>\n\n\n\n

Design before Develop Cheap Flights<\/h3>\n\n\n\n

From our past exercises, we learnt how to make applications with programming. But it will be much better if we make useful<\/em> applications with programming. In order to make our flight prices checker application, we should design the app using user’s perspectives. As a cheap flights seeker, I would like to know:<\/p>\n\n\n\n