4.9.2 Lab - Integrate A REST API in A Python Application
4.9.2 Lab - Integrate A REST API in A Python Application
Objectives
Part 1: Launch the DEVASC VM
Part 2: Demonstrate the MapQuest Directions Application
Part 3: Get a MapQuest API Key
Part 4: Build the Basic MapQuest Direction Application
Part 5: Upgrade the MapQuest Directions Application with More Features
Part 6: Test Full Application Functionality
Background / Scenario
In this lab, you will create an application in Visual Studio Code (VS Code) that retrieves JSON data from the
MapQuest Directions API, parses the data, and formats it for output to the user. You will use the GET Route
request from the MapQuest Directions API. Review the GET Route Directions API documentation here:
https://developer.mapquest.com/documentation/directions-api/route/get/
Note: If the above link no longer works, search for “MapQuest API Documentation”.
Required Resources
1 PC with operating system of your choice
Virtual Box or VMWare
DEVASC Virtual Machine
Instructions
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Kilometers: 61.32
Fuel Used (Ltr): 6.24
=============================================
Start out going north on 6th St/US-50 E/US-1 N toward Pennsylvania Ave/US-1 Alt N.
(1.28 km)
Turn right onto New York Ave/US-50 E. Continue to follow US-50 E (Crossing into
Maryland). (7.51 km)
Take the Balt-Wash Parkway exit on the left toward Baltimore. (0.88 km)
Merge onto MD-295 N. (50.38 km)
Turn right onto W Pratt St. (0.86 km)
Turn left onto S Calvert St/MD-2. (0.43 km)
Welcome to BALTIMORE, MD. (0.00 km)
=============================================
Note: To see the JSON for the above output, you can copy the URL in a browser tab. However, you will need
to replace your_api_key with the MapQuest API key you obtain in Part 3.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
e. After clicking Sign Me Up, you are redirected to the Manage Keys page. If you are redirected elsewhere,
click Manage Keys from the list of options on the left.
f. Click Approve All Keys.
g. Expand My Application.
h. Copy your Consumer Key to a text file for future use. This will be the key you use for the rest of this lab.
Note: MapQuest may change the process for obtaining a key. If the steps above are no longer valid, search
the internet for “steps to generate mapquest api key”.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
f.
Step 3: Build the URL for the request to the MapQuest directions API.
The first step in creating your API request is to construct the URL that your application will use to make the
call. Initially, the URL will be the combination of the following variables:
main_api - the main URL that you are accessing
orig - the parameter to specify your point of origin
dest - the parameter to specify your destination
key - the MapQuest API key you retrieved from the developer website
a. Create variables to build the URL that will be sent in the request. In the following code, replace
your_api_key with the Consumer Key you copied from your MapQuest developer account.
main_api = "https://www.mapquestapi.com/directions/v2/route?"
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
b. Combine the four variables main_api, orig, dest, and key to format the requested URL. Use the
urlencode method to properly format the address value. This function builds the parameters part of the
URL and converts possible special characters in the address value into acceptable characters (e.g. space
into “+” and a comma into “%2C”).
c.
d. Create a variable to hold the reply of the requested URL and print the returned JSON data. The
json_data variable holds a Python’s Dictionary representation of the json reply of the get method of the
requests module. The requests.get will make the API call to the MapQuest API. The print statement will
be used temporarily to check the returned data. You will replace this print statement with more
sophisticated display options later in the lab.
json_data = requests.get(url).json()
print(json_data)
e. Your final code should look like this, but with a different value for the key.
import urllib.parse
import requests
main_api = "https://www.mapquestapi.com/directions/v2/route?"
orig = "Washington, D.C."
dest = "Baltimore, Md"
key = "fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ" #Replace with your MapQuest key
json_data = requests.get(url).json()
print(json_data)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
devasc@labvm:~/labs/devnet-src/mapquest$
c. Change the orig and dest variables. Rerun the script to get different results. To ensure the results you
want, it is best to include both the city and the state for cities in the USA. When referring to cities in other
countries, you can usually use either the English name for the city and country or the native name. For
example:
orig = "Rome, Italy"
dest = "Frascati, Italy"
or
orig = "Roma, Italia"
dest = "Frascati, Italia"
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Step 5: Print the URL and check the status of the JSON request.
Now that you know the JSON request is working, you can add some more functionality to the application.
a. Save your script as mapquest_parse-json_2.py.
b. Delete the print(json_data) statement as you no longer need to test that the request is properly
formatted.
c. Add the statements below, which will do the following:
o Print the constructed URL so that the user can see the exact request made by the application.
o Parse the JSON data to obtain the statuscode value.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
o Start an if loop that checks for a successful call, which is indicated by a returned value of 0. Add a
print statement to display the statuscode value and its meaning. The \n adds a blank line below the
output.
Later in this lab, you will add elif and else statements for different statuscode values.
print("URL: " + (url))
json_data = requests.get(url).json()
json_status = json_data["info"]["statuscode"]
if json_status == 0:
print("API Status: " + str(json_status) + " = A successful route call.\n")
b. Save and run your mapquest_parse-json_2.py script and verify it works. Troubleshoot your code, if
necessary. You should get output similar to the following. Notice your key is embedded in the URL
request.
devasc@labvm:~/labs/devnet-src/mapquest$ python3 mapquest_parse-json_2.py
URL: https://www.mapquestapi.com/directions/v2/route?
key=fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ&from=Washington%2C+D.C.&to=Baltimore%2C+Md
API Status: 0 = A successful route call.
devasc@labvm:~/labs/devnet-src/mapquest$
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
main_api = "https://www.mapquestapi.com/directions/v2/route?"
key = "fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ"
while True:
orig = input("Starting Location: ")
dest = input("Destination: ")
url = main_api + urllib.parse.urlencode({"key": key, "from":orig, "to":dest})
print("URL: " + (url))
json_data = requests.get(url).json()
json_status = json_data["info"]["statuscode"]
if json_status == 0:
print("API Status: " + str(json_status) + " = A successful route call.\n")
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
KeyboardInterrupt
devasc@labvm:~/labs/devnet-src/mapquest$
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
devasc@labvm:~/labs/devnet-src/mapquest$
b. Paste the URL in the Chromium browser address field
c.
.
d. Collapse the JSONView data by selecting the dash "-" before route, you will see that there are two root
dictionaries: route and info.
{
- route:{
hasTollRoad: false,
hasBridge: true,
<output omitted>
You will see that there are two root dictionaries: route and info. Notice that info has the statuscode
key/value paired used in your code.
{
+ route: {},
- info: {
statuscode: 0,
- copyright: {
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
e. Expand the route dictionary (click on the plus sign "+" before route) and investigate the rich data. There
are values to indicate whether the route has toll roads, bridges, tunnels, highways, closures, or crosses
into other countries. You should also see values for distance, the total time the trip will take, and fuel
usage. To parse and display this data in your application, you would specify the route dictionary and then
select key/value pair you want to print. You will do some parsing of the route dictionary in the next part of
the lab.
Step 1: Display trip summary information to include duration, distance, and fuel used.
a. Save your script as mapquest_parse-json_5.py.
b. Below the API status print command, add several print statements that display the from and to locations,
as well as the formattedTime, distance, and fuelUsed keys.
The additional statements also include print statements that will display a double line before the next
request for a starting location. Make sure these statements are embedded in the while True function.
if json_status == 0:
print("API Status: " + str(json_status) + " = A successful route call.\n")
print("=============================================")
print("Directions from " + (orig) + " to " + (dest))
print("Trip Duration: " + (json_data["route"]["formattedTime"]))
print("Miles: " + str(json_data["route"]["distance"]))
print("Fuel Used (Gal): " + str(json_data["route"]["fuelUsed"]))
print("=============================================")
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Washington, D.C. to Baltimore, Md
Trip Duration: 00:49:29
Miles: 38.089
Fuel Used (Gal): 1.65
=============================================
Starting Location: q
devasc@labvm:~/labs/devnet-src/mapquest$
d. By defauilt, MapQuest uses the imperial system and there is not a request parameter to change data to
the metric system. Therefore, you should probably convert your application to display metric values, as
shown below.
print("Kilometers: " + str((json_data["route"]["distance"])*1.61))
print("Fuel Used (Ltr): " + str((json_data["route"]["fuelUsed"])*3.78))
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Destination: Baltimore, Md
URL: https://www.mapquestapi.com/directions/v2/route?
key=fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ&from=Washington%2C+D.C.&to=Baltimore%2C+Md
API Status: 0 = A successful route call.
=============================================
Directions from Washington, D.C. to Baltimore, Md
Trip Duration: 00:49:29
Kilometers: 61.32329
Fuel Used (Ltr): 6.236999999999999
=============================================
Starting Location: q
devasc@labvm:~/labs/devnet-src/mapquest$
f. The extra decimal places for Kilometers and Fuel Used are not helpful. Use the "{:.2f}".format argument
to format the float values to 2 decimal places before converting them to string values, as shown below.
Each statement should be on one line.
print("Kilometers: " + str("{:.2f}".format((json_data["route"]
["distance"])*1.61)))
print("Fuel Used (Ltr): " + str("{:.2f}".format((json_data["route"]
["fuelUsed"])*3.78)))
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Washington, D.C. to Baltimore, Md
Trip Duration: 00:49:29
Kilometers: 61.32
Fuel Used (Ltr): 6.24
=============================================
Starting Location: q
devasc@labvm:~/labs/devnet-src/mapquest$
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
b. Inside the route dictionary, locate the legs list. The legs list includes one big dictionary with most of the
JSON data. Find the maneuvers list and collapse each of the seven dictionaries inside, as shown below
(click the "-" minus sign to toggle it to a "+" plus sign). If you are using different locations, you will
probably have a different number of maneuver dictionaries.
- legs: [
- {
hasTollRoad: false,
hasBridge: true,
destNarrative: "Proceed to BALTIMORE, MD.",
distance: 38.089,
hasTimedRestriction: false,
hasTunnel: false,
hasHighway: true,
index: 0,
formattedTime: "00:49:29",
origIndex: -1,
hasAccessRestriction: false,
hasSeasonalClosure: false,
hasCountryCross: false,
- roadGradeStrategy: [
[ ]
],
destIndex: 3,
time: 2969,
hasUnpaved: false,
origNarrative: "",
- maneuvers: [
+ {…},
+ {…},
+ {…},
+ {…},
+ {…},
+ {…},
+ {…}
],
hasFerry: false
}
],
- options: {
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
c. Expand the first dictionary in the maneuvers list. Each dictionary contains a narrative key with a value,
such as “Start out going north...”, as shown below. You need to parse the JSON data to extract the value
for the narrative key to display inside your application.
- legs: [
- {
hasTollRoad: false,
hasBridge: true,
destNarrative: "Proceed to BALTIMORE, MD.",
distance: 38.089,
hasTimedRestriction: false,
hasTunnel: false,
hasHighway: true,
index: 0,
formattedTime: "00:49:29",
origIndex: -1,
hasAccessRestriction: false,
hasSeasonalClosure: false,
hasCountryCross: false,
- roadGradeStrategy: [
[ ]
],
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
destIndex: 3,
time: 2969,
hasUnpaved: false,
origNarrative: "",
- maneuvers: [
- {
distance: 0.792,
- streets: [
"6th St",
"US-50 E",
"US-1 N"
],
narrative: "Start out going north on 6th St/US-50E/US-1 N toward
Pennsylvania Ave/US-1 Alt N.",
turnType: 0,
- startPoint: {
lng: -77.019913,
lat: 38.892063
},
index: 0,
formattedTime: "00:02:06",
directionName: "North",
maneuverNotes: [ ],
linkIds: [ ],
- signs: [
- {
extraText: "",
ext: "50",
type: 2,
<output omitted>
Note: Word wrap was added for the value in the narrative for display purposes.
Step 4: Add a for loop to iterate through the maneuvers JSON data.
Complete the following steps to upgrade the application to display the value for the narrative key. You will do
this by creating a for loop to iterate through the maneuvers list, displaying the narrative value for each
maneuver from starting location to destination.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 20 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Washington, D.C. to Baltimore, Md
Trip Duration: 00:49:29
Kilometers: 61.32
Fuel Used (Ltr): 6.24
=============================================
Start out going north on 6th St/US-50 E/US-1 N toward Pennsylvania Ave/US-1 Alt N.
(1.28 km)
Turn right onto New York Ave/US-50 E. Continue to follow US-50 E (Crossing into
Maryland). (7.51 km)
Take the Balt-Wash Parkway exit on the left toward Baltimore. (0.88 km)
Merge onto MD-295 N. (50.38 km)
Turn right onto W Pratt St. (0.86 km)
Turn left onto S Calvert St/MD-2. (0.43 km)
Welcome to BALTIMORE, MD. (0.00 km)
=============================================
Starting Location: q
devasc@labvm:~/labs/devnet-src/mapquest$
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 21 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
if json_status == 0:
print("API Status: " + str(json_status) + " = A successful route call.\n")
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 22 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
But what happens if the statuscode is not equal to 0? For example, the user might enter an invalid location or
might not enter one or more locations. If so, then the application displays the URL and asks for a new starting
location. The user has no idea what happened.
a. To cause your application to fail without user notification, try the following values in your application. You
should see similar results.
devasc@labvm:~/labs/devnet-src/mapquest$ python3 mapquest_parse-json_6.py
Starting Location: Washington, D.C.
Destination: Beijing, China
URL: https://www.mapquestapi.com/directions/v2/route?
key=fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ&from=Washington%2C+D.C.&to=Beijing%2C+China
Starting Location: Washington, D.C.
Destination: Bal
URL: https://www.mapquestapi.com/directions/v2/route?
key=fZadaFOY22VIEEemZcBFfxl5vjSXIPpZ&from=Washington%2C+D.C.&to=Bal
Starting Location: q
devasc@labvm:~/labs/devnet-src/mapquest$
b. Copy one of the URLs to a Chromium browser tab. Notice that the only entry in route dictionary is a
routeError dictionary with the errorCode 2. In the info dictionary, the statuscode is 402. Therefore, your
if loop never executed the code for when the statuscode is 0.
c. Save your script as mapquest_parse-json_7.py.
d. To provide error information when statuscode is equal to 402, 611, or another value, add two elif
statements and an else statement to your if loop. Your elif and else statements must align with the
previous if statement. After the last double line print statement under the if json_status == 0, add the
following elif and else statements:
if json_status == 0:
<statements omitted>
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 23 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
The first elif statement prints if the statuscode value is 402 for an invalid location. The second elif
statement prints if the statuscode value is 611 because the user did not provide an entry for one or both
locations. The else statement prints for all other statuscode values, such as when the MapQuest site
returns an error. The else statement ends the if/else loop and returns the application to the while loop.
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 24 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Washington, D.C. to Baltimore, Md
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 25 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Moscow, Russia to Beijing, China
Trip Duration: 84:31:10
Kilometers: 7826.83
Fuel Used (Ltr): 793.20
=============================================
Start out going west on Кремлёвская набережная/Kremlin Embankment. (0.37 km)
Turn slight right onto ramp. (0.15 km)
Turn slight right onto Боровицкая площадь. (0.23 km)
<output omitted>
Turn slight left onto 前门东大街/Qianmen East Street. (0.31 km)
Turn left onto 广场东侧路/E. Guangchang Rd. (0.82 km)
广场东侧路/E. Guangchang Rd becomes 东长安街/E. Chang'an Str. (0.19 km)
Welcome to BEIJING. (0.00 km)
=============================================
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 26 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
**********************************************
Status Code: 402; Invalid user inputs for one or both locations.
**********************************************
=============================================
Directions from Washington, D.C. to Baltimore, Md
Trip Duration: 00:48:47
Kilometers: 65.56
=============================================
Head toward Jefferson Dr SW on 14th St NW (US-1). Go for 0.2 mi. (0.31 km)
Turn left onto Independence Ave SW. Go for 0.4 mi. (0.67 km)
Turn slightly right and take ramp onto 9th St SW toward I-395 S. Go for 0.3
mi. (0.54 km)
Take left ramp onto I-395 N (Southwest Fwy) toward I-695. Go for 0.3 mi. (0.49
km)
Continue on I-695 E (Southeast Fwy). Go for 1.9 mi. (3.04 km)
Take exit 2B toward US-50 onto DC-295 N (Anacostia Fwy). Go for 4.5 mi. (7.19
km)
Continue on MD-295 N. Go for 31.6 mi. (50.87 km)
Keep left onto Russell St (MD-295 N). Go for 0.6 mi. (0.89 km)
Turn right onto W Pratt St toward I-83. Go for 0.6 mi. (1.05 km)
Turn left onto Commerce St. Go for 430 ft. (0.13 km)
Continue on Commerce St. Go for 0.1 mi. (0.21 km)
Continue on N Holliday St. Go for 282 ft. (0.09 km)
Turn right onto E Fayette St. Go for 272 ft. (0.08 km)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 27 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
=============================================
Directions from Moscow, Russia to Beijing, China
Trip Duration: 81:37:21
Kilometers: 7500.94
=============================================
Head toward Mokhovaya ulitsa on Tverskaya ulitsa. Go for 33 ft. (0.01 km)
Turn left onto ulitsa Okhotniy Ryad. Go for 0.2 mi. (0.30 km)
Continue on Teatral'niy proezd. Go for 0.3 mi. (0.42 km)
Turn left onto Lubyanskaya ploshchad' toward Bol'shaya Lubyanka
ulitsa/Sretenka ulitsa. Go for 486 ft. (0.15 km)
Continue on ulitsa Bol'shaya Lubyanka. Go for 0.5 mi. (0.73 km)
Turn right onto Sretenskiy bul'var. Go for 0.2 mi. (0.38 km)
Make a U-Turn onto Turgenevskaya ploshchad'. Go for 371 ft. (0.11 km)
Turn right onto prospekt Akademika Sakharova. Go for 0.6 mi. (0.95 km)
Continue on ulitsa Mashi Poryvaevoy. Go for 0.3 mi. (0.43 km)
Turn right onto Kalanchyovskaya ulitsa. Go for 371 ft. (0.11 km)
Turn left onto Komsomol'skaya ploshchad' toward Komsomol'skaya square. Go for
0.8 mi. (1.33 km)
Turn right onto ulitsa Gavrikova toward Spartakovskaya
ploshchad'/Spartakovskaya square/3-e kol'tso/M8/Mira pr-t/M7/Entuziastov sh.
Go for 223 ft. (0.07 km)
Keep right toward 3-e kol'tso-Nalevo/M8/Mira pr-t. Go for 269 ft. (0.08 km)
Continue on ulitsa Gavrikova. Go for 0.2 mi. (0.27 km)
Turn right onto Lesnoryadskiy pereulok. Go for 0.4 mi. (0.63 km)
Turn right onto Rusakovskaya ulitsa. Go for 0.1 mi. (0.17 km)
Turn right onto ulitsa Zhebrunova. Go for 0.5 mi. (0.79 km)
Continue on ulitsa Matrosskaya Tishina. Go for 194 ft. (0.06 km)
Turn right onto ulitsa Gastello. Go for 0.5 mi. (0.83 km)
Take ramp toward Preobrazhenskaya naberezhnaya. Go for 466 ft. (0.14 km)
Turn right onto Semyonovskaya naberezhnaya. Go for 125 ft. (0.04 km)
Continue on Preobrazhenskaya naberezhnaya. Go for 56 ft. (0.02 km)
Turn right and take ramp. Go for 174 ft. (0.05 km)
Turn left toward Elektrozavodskaya ulitsa. Go for 75 ft. (0.02 km)
Turn left onto Elektrozavodskaya ulitsa. Go for 0.1 mi. (0.19 km)
Turn right onto ploshchad' Zhuravlyova. Go for 0.1 mi. (0.17 km)
Continue on Malaya Semyonovskaya ulitsa. Go for 0.4 mi. (0.64 km)
Turn right onto Semyonovskiy pereulok. Go for 449 ft. (0.14 km)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 28 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Turn left onto Izmaylovskaya ulitsa. Go for 0.2 mi. (0.25 km)
Turn right onto ulitsa Izmaylovskiy Val. Go for 0.1 mi. (0.17 km)
Turn left onto Semyonovskaya ploshchad' toward Shcherbakovskaya
ulitsa/Shcherbakovskaya street. Go for 0.1 mi. (0.23 km)
Continue on Shcherbakovskaya ulitsa toward Ibragimova ulitsa/Ibragimova
street/Mazhorov pereulok/Mazhorov side-street. Go for 0.8 mi. (1.27 km)
Continue on Izmaylovskoe shosse. Go for 266 ft. (0.08 km)
Turn right and take ramp onto Severo-Vostochnaya Khorda. Go for 1.5 mi. (2.44
km)
Take the exit toward Entuziastov sh./M7/Svobodniy pr-t onto shosse
Entuziastov. Go for 49.5 mi. (79.72 km)
Keep left onto Gor'kovskoe shosse (M7). Go for 16.0 mi. (25.78 km)
Turn right and take ramp onto M12. Go for 36.4 mi. (58.60 km)
Take the exit onto M7 (Volga). Go for 0.2 mi. (0.37 km)
Take ramp onto Volga (M7) toward Murom/N.Novgorod. Go for 34.0 mi. (54.66 km)
Take ramp onto Volga (M7) toward Nizh. Novgorod/Nizh. Novgorod. Go for 110 mi.
(176.65 km)
Take ramp onto M7 (Yuzhniy obkhod Nizhnego Novgoroda) toward
Avtozavod/Pavlovo/Kazan'. Go for 33.0 mi. (53.15 km)
Take the 1st exit from roundabout onto 22K-0007 toward Kazan'. Go for 4.3 mi.
(6.97 km)
Take ramp onto Volga (M7) toward Kazan'. Go for 147 mi. (237.33 km)
Take the 2nd exit from roundabout onto Volga (M7) toward Ufa/Ufa. Go for 229
mi. (369.21 km)
Turn right onto Orlovskoe kol'tso (M7) toward Ufa/Ufa. Go for 522 ft. (0.16
km)
Keep right onto Menzelinskiy trakt (M7). Go for 2.1 mi. (3.39 km)
Take the 1st exit from roundabout onto Menzelinskiy trakt (M7) toward Ufa. Go
for 1.5 mi. (2.34 km)
Take the 1st exit from roundabout onto Metallurgicheskaya ulitsa (M7). Go for
1.6 mi. (2.55 km)
Turn right onto Volga (M7). Go for 158 mi. (254.61 km)
Take ramp onto E017 toward zapovednik Shul'gan-Tash/Shulgan-Tash state nature
reserve/Gornolyzhnye Tsentry/Ski Centers. Go for 16.6 mi. (26.79 km)
Keep left onto R240 toward Ufa/M5/Chelyabinsk. Go for 0.2 mi. (0.38 km)
Take ramp onto Ural (M5) toward Ufa/Chelyabinsk. Go for 250 mi. (401.83 km)
Take ramp onto Baykal (AH6/AH7) toward Troitsk. Go for 10.1 mi. (16.21 km)
Continue on 75K-205. Go for 0.4 mi. (0.58 km)
Take ramp onto Baykal (AH6/AH7) toward Chelyabinsk/Kurgan. Go for 2.9 mi.
(4.64 km)
Take ramp onto Baykal (AH6/AH7) toward Ekaterinburg/Kurgan. Go for 11.2 mi.
(18.10 km)
Continue on Baykal (AH6/AH7) toward Ekaterinburg/M51/Kurgan. Go for 15.6 mi.
(25.13 km)
Take ramp onto Irtysh (AH6) toward Kurgan. Go for 62.3 mi. (100.28 km)
Take the 2nd exit from roundabout onto Irtysh (AH6) toward Omsk. Go for 28.1
mi. (45.28 km)
Continue on Irtysh (AH6) toward Kurgan. Go for 55.3 mi. (89.11 km)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 29 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Pass 3 roundabouts and continue on Irtysh (AH6). Go for 86.1 mi. (138.66 km)
Take the 2nd exit from roundabout onto Irtysh (AH6) toward Omsk. Go for 29.1
mi. (46.87 km)
Take the 2nd exit from roundabout onto Irtysh (AH6) toward
M51/Omsk/Petropavlovsk. Go for 13.9 mi. (22.38 km)
Continue on M-51. Go for 18.9 mi. (30.35 km)
Keep left onto M-51. Go for 18.6 mi. (29.88 km)
Turn left toward Ombi. Go for 0.1 mi. (0.21 km)
Keep right onto M-51 toward Ombi. Go for 161 ft. (0.05 km)
Turn right onto M-51. Go for 2.7 mi. (4.32 km)
Make a U-Turn onto M-51. Go for 1.4 mi. (2.32 km)
Take the 2nd exit from roundabout onto M-51 toward Ombi. Go for 1.6 mi. (2.65
km)
Take the 3rd exit from roundabout onto M-51 toward Ombi. Go for 74.8 mi.
(120.45 km)
Continue on Irtysh (AH6). Go for 77.5 mi. (124.75 km)
Turn right and take ramp onto Irtysh (AH6) toward Pavlodar/A320/Novosibirsk.
Go for 20.0 mi. (32.17 km)
Pass 2 roundabouts and continue on Irtysh (AH6). Go for 50.4 mi. (81.20 km)
Take the 1st exit from roundabout onto Irtysh (AH6) toward Novosibirsk. Go for
3.1 mi. (4.93 km)
Take the 2nd exit from roundabout onto Irtysh (AH6) toward Novosibirsk. Go for
3.2 mi. (5.22 km)
Take the 2nd exit from roundabout onto Irtysh (AH6) toward Novosibirsk. Go for
323 mi. (520.15 km)
Keep left onto Severniy Ob'ezd (AH6) toward Kemerovo/R255/Tomsk. Go for 28.6
mi. (46.08 km)
Take ramp onto Severniy Ob'ezd (AH6). Go for 134 mi. (215.72 km)
Take the 3rd exit from roundabout onto Sibir' (R255). Go for 12.5 mi. (20.15
km)
Continue on Sevskaya ulitsa. Go for 0.1 mi. (0.19 km)
Turn left onto ulitsa Marata toward Mariinsk/R-255/Yashkino. Go for 331 ft.
(0.10 km)
Continue on Prigorodnaya ulitsa toward Tsentr. Go for 3.1 mi. (4.98 km)
Continue on Zheleznodorozhnaya ulitsa. Go for 0.6 mi. (0.92 km)
Turn right onto ulitsa Sakko. Go for 0.2 mi. (0.29 km)
Turn left onto Rabochaya ulitsa. Go for 1.0 mi. (1.60 km)
Turn right onto Krasnoarmeyskaya ulitsa toward Mariinsk/Yashkino/Tsentr. Go
for 0.8 mi. (1.25 km)
Turn left onto Kuznetskiy prospekt toward Mariinsk/R-255/Yashkino. Go for 1.0
mi. (1.61 km)
Continue on Kuznetskiy most. Go for 0.8 mi. (1.30 km)
Continue on Logovaya ulitsa. Go for 0.7 mi. (1.07 km)
Continue on ulitsa Nakhimova. Go for 12.5 mi. (20.06 km)
Turn right onto Sibir' (AH6) toward Irkutsk/Mariinsk. Go for 197 mi. (316.72
km)
Turn left toward Nagornovo. Go for 5.6 mi. (8.97 km)
Turn right toward Ostrovnaya ulitsa. Go for 0.1 mi. (0.23 km)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 30 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 31 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
Take ramp onto Kultukskiy trakt (AH6) toward Chita/Chita. Go for 122 mi.
(195.94 km)
Continue on Baykal (AH6). Go for 145 mi. (232.85 km)
Take ramp onto A165 (AH3) toward Kyakhta. Go for 134 mi. (216.32 km)
Turn slightly right. Go for 0.4 mi. (0.58 km)
Turn left. Go for 276 ft. (0.08 km)
Turn right toward A165/AH3. Go for 36 ft. (0.01 km)
Turn right onto A165 (AH3). Go for 56 ft. (0.02 km)
Continue straight ahead. Go for 36 ft. (0.01 km)
Turn right toward Дархан Сүхбаатар. Go for 0.2 mi. (0.40 km)
Turn left onto Дархан Сүхбаатар. Go for 0.2 mi. (0.28 km)
Turn right onto Дархан Сүхбаатар. Go for 42.9 mi. (69.13 km)
Continue on Дархан-Сүхбаатар. Go for 16.5 mi. (26.50 km)
Turn left onto Дархан-Сүхбаатар. Go for 14.3 mi. (22.97 km)
Continue on A0401. Go for 1.3 mi. (2.09 km)
Continue on Улаанбаатар-Дархан. Go for 104 mi. (167.04 km)
Continue on А0401. Go for 2.2 mi. (3.59 km)
Continue on Улаанбаатар-Дархан. Go for 21.7 mi. (34.88 km)
Keep right onto А0301. Go for 387 ft. (0.12 km)
Continue on Товчооны Зам. Go for 6.3 mi. (10.07 km)
Turn right onto Enkh Tayvan Avenue. Go for 3.4 mi. (5.45 km)
Continue on Peace Avenue. Go for 4.6 mi. (7.43 km)
Keep right toward Enkh Tayvan Avenue. Go for 318 ft. (0.10 km)
Continue on Enkh Tayvan Avenue. Go for 0.2 mi. (0.24 km)
Continue on Peace Avenue. Go for 358 ft. (0.11 km)
Take the 2nd exit from roundabout onto Police Academy Avenue. Go for 0.3 mi.
(0.51 km)
Continue on Enkh Tayvan Avenue. Go for 20.6 mi. (33.12 km)
Continue on А0101. Go for 31.0 mi. (49.85 km)
Continue on А0101. Go for 7.1 mi. (11.45 km)
Continue on А0101. Go for 52.7 mi. (84.84 km)
Continue on А0101. Go for 9.9 mi. (16.01 km)
Continue on А0101. Go for 17.5 mi. (28.11 km)
Continue on А0101. Go for 60.2 mi. (96.86 km)
Turn right. Go for 436 ft. (0.13 km)
Keep left. Go for 75.8 mi. (122.06 km)
Turn left. Go for 2.1 mi. (3.32 km)
Turn left. Go for 0.3 mi. (0.49 km)
Keep right. Go for 0.6 mi. (0.94 km)
Turn right. Go for 4.4 mi. (7.00 km)
Turn left. Go for 10.7 mi. (17.21 km)
Turn left. Go for 18.8 mi. (30.32 km)
Keep right. Go for 0.5 mi. (0.77 km)
Keep right. Go for 0.5 mi. (0.83 km)
Turn right. Go for 35.5 mi. (57.22 km)
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 32 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 33 of 34 www.netacad.com
Lab - Integrate a REST API in a Python Application
**********************************************
End of document
2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 34 of 34 www.netacad.com