 Another really cool use of a dictionary is using something known as a JSON API. That's super tech words, but the entire idea to a JSON API is websites exist out there in the world. Specifically, I'm going to be referencing openweathermap.org. I love this just because, again, it's a cool little demonstration. But again, you can see that they have this thing called an API. And why this is important is if we dig a little deeper and they have a lot, but let me just say if I wanted to look up the current weather data for any particular location, they happen to have a great way to do this. Go to this website, api.org, slash data, 2.5. You just put in what the city name is and then your magical API key, which we'll talk about in a second. And congratulations, you now have the weather of that particular location. Let me see if they give any examples. There's one that didn't help. Here we are. So it'll give you sort of an example of some response. In their case, they are using, I believe, Mountain View, California. But you can see it looks very similar to a dictionary going on there. Now, just for our sake, an API and that magical thing, you're not sponsored by these people, but you can get a free one where you can use literally 60 calls a minute or a million calls. Don't buy, you know, don't pay for this unless you're building like an app. Anyways, my entire point is that we have a website that allows us to make a request via a web URL and it will give us a dictionary back. And well, if it's a dictionary, we can process it. So I've already removed mine because unfortunately, I've done this video a few times and people will copy my API and then I get charged for that and I don't like that. So anyways, the entire idea is go sign up, make your own one. But let's say, for example, I wanted to get the weather for Raleigh. So in this case, oh, well, there's that URL. And then I'm going to specify my city. And I'm digging a little deeper because there are multiple Raleigh's or if you're looking up something like London or Paris, right? They are very common. Everyone knows like Paris, France, but I think there's a Paris, Texas, right? So I'm just specifying the city-state location. I am getting rid of those spaces afterwards. URLs don't really like them. Python handles it nowadays, but again, I'll do it. And then I just want to specify a unit of measure. You don't need to, but this is sort of if you were to dig a little deeper into the API, you can specify if I want Imperial, Metric, Kelvin. And then I'm just building out my URL. So in this case, that URL again, this location. And some fancy super tech stuff, but basically to pass in all these values, you're using a question mark. Q, Q is just going to be representing, in our case, the city that we're dealing with. Units or rather units is how we are going to pass in our measure. And then the API key is that super fancy number that open weather map will give you to say, you need to have this so we can charge your account if you have a, you know, or a free account. Either way, then just format it. I'm printing it out. Now, as you can sort of see, there's some more information going on here. So there is a library in Python called requests. It's a great library sort of handles a lot of the URL handling when you try and download a website. So get in this case, remember requests is just my URL. So requests dot go download my data. Now, one thing to take note of is when I get sort of this data, even though it looks like a dictionary, it is still processed or still handled as a string. So we have to do a little bit of formatting. And that's where I come in with something like JSON. JSON is another library that you can use. So that'll do all of the handling. It says, oh, I know that that is a JSON response, you know, that you've grabbed. Let me translate that into a dictionary. So it does just that. And then I've just got some print statements going on here. So you can see what the rest does. It's not going to do anything because it's just sort of an object where we're in the contents or at least the first 100 characters of the contents because it's a lot. And then what are those dictionary keys? Because again, we're dealing with a dictionary. So you can see there's the URL and there's my API, but I'm just going to have to delete it. Anyways, you can see, well, there's the response. Here's the first 100 characters of, you know, our Raleigh data. And here are the dictionary keys that I happen to have access to. Coord, weather, main, visibility, wind. And again, read up on what each one of these do. There's a listing. But the entire idea here is that I can then grab those entries. So for example, main. Main, if we were to take a look at the main entry R and just to zoom in on that. Main, too big. Main is just another dictionary. Dictionaries can have dictionaries in them. Who knew? But the entire idea here is you can see that that main has its own entries. One of those happens to be temp. I'm assuming that they are using Kelvin for these entries. Do they say? I digress. But you can see that, you know, here is an entry for a very hot location. Well, we can do the same thing. We can extract or get the main dictionary. And then we can do some simple parsing to see if that dictionary exists. So in this case, where they're aliens, we can check. Then we can see what the temperature is and then what the humidity is. And since I've already exposed my API key. Why not? Let's go ahead and load it in so you someone on the internet can copy it. So we load that into memory. Again, you saw that we got our entry. So now let's go see again. Aliens, it'll check in. And if we don't see aliens because it's not in the API, we'll just say some joke stuff. But when we get to our temperature, we'll get the temperature. And when we ask for something like humidity, we'll get humidity. And so the current weather here in Raleigh, North Carolina is a nice warm 85.2 degrees Fahrenheit with a humidity of 49%. And aliens, aliens.