Add the City IATA Codes to your Google Sheet

In order to search for flights, we need an International Air Transport Association (IATA) code. This code helps to identify airports and metropolitan areas.

Some airports are so famous that people even refer to the IATA code in normal conversation. e.g LAX and JFK.

Some cities have multiple airports so they have their own city IATA code which is different from the airport IATA code. e.g. LON (London) - LHR (Heathrow)/ LGW(Gatwick) etc.

The goal for this step is to add the missing IATA codes for each city to the Google Sheet.

1. Delete the "TESTING" values in the Google sheet again. Our code thus far only writes to the Google sheet if the cells are empty.


Make requests using the Kiwi Partners Tequila API

NOTE: You'll have to sign up (free) for an account with Tequila to access their flight search API. Double check the instructions in Step 1 to make sure you've selected the correct options. Then take a look at the locations API -> search by query.

2. Pass each city name in sheet_data one-by-one to the FlightSearch class to get the corresponding IATA code for that city using the Flight Search API. You should use the code you get back to update the sheet_data dictionary.

Print the updated sheet_data dictionary and you should see:

When you run your code again, you should see the Google Sheet update with the IATA code for each city.

SOLUTION

STEP 3 SOLUTION IN REPL.IT PROJECT