#100DaysOfWeb in Python Transcripts
Chapter: Days 17-20: Calling APIs in Flask
Lecture: Investigating the Poke API
0:00 Welcome back.
0:01 This time we are going to work with the Pokemon API.
0:05 This one's actually pretty exciting
0:07 because it's a lot of fun.
0:09 There's a lot of data for you to play with
0:11 it's not just pulling some random joke
0:13 from the Chuck Norris API.
0:15 That was a simple response, right?
0:18 With this API, we actually get to choose
0:20 what kind of data we pull out from the database
0:25 and that's probably the more common scenario
0:28 you're going to face when you're using API's in your Flask cap.
0:33 This is really cool because you get to choose Pokemon names
0:36 you get to choose anything you want that they have.
0:39 So we'll go into the documentation's into V2
0:42 I'll show you what we're going to pull down.
0:44 We're looking at Pokemon colors
0:47 and what we're going to do here is we're going
0:49 to allow the user on our website to enter a certain color
0:55 and it is going to send a request, a get request
0:59 after this API with that color substituted in here
1:03 as the ideal name, and then it's going to return us a list
1:07 of all the Pokemon that have that color as an attribute
1:12 and then it will print that on our page.
1:15 So it's a simple submit something from the user
1:18 so collect that from the user, submit it to the API
1:21 return result, print it on the page.
1:23 There's a couple of little steps there in Flask
1:25 that we haven't covered yet
1:27 and I will spend a little bit more time on that
1:29 Because we've covered the API aspect
1:31 and we sort of get that.
1:33 So head onto the next video and let's get cracking.