From the course: JavaScript: Async
Getting an OpenWeatherMap API key - JavaScript Tutorial
From the course: JavaScript: Async
Getting an OpenWeatherMap API key
- [Instructor] Finally, the videos in this course make use of data from openweathermap.org. Data requests from this service require an API key, which is a unique identifier that associates you with a request coming in. The service provides a limited amount of data for free and by having your own key rather than sharing one, you can ensure that you stay below the limit of free requests. To get data from this service, you need to sign up for an account with openweathermap.org and obtain an API key, which you'll use when creating your Ajax requests for data. So let's set that up now. Openweathermap.org makes weather information available under a creative commons license. Data is free for up to 60 requests per minute, which will work fine for this course. It's only more intensive uses that require a paid subscription. To get an API key, go to openweathermap.org in your browser and then up here at the top, click API. This documents the terms as well as endpoints that you can hit with your Ajax requests. So to sign up for an account, we can click the Sign Up link at the top, set up a username and password. For this course, I'm going to use the username asynccourse and create a password in both boxes. Make sure you're clear on what you're agreeing to here. Make sure they understand you're not a robot and create your account. They ask you some questions, which I am just going to cancel out of for now. And so now I'm logged in. And so we now have another navbar and I'm going to click API keys here, and that's going to show me the API key from my account. So I'm just going to double click there. I'm going to copy that to the clipboard and then I want to put it somewhere where I can access it easily. Now, I'm on a Mac. So I'm going to open up the Notes app. You could certainly use TextEdit on a Windows machine and in a new note, I'm just going to paste my API key in there, maybe give myself a little note. So that's my OpenWeatherMap API key. Now the key you'll see me using in the videos for this course has been deactivated. So it's important that you use your own key because this one won't work. So whenever you need to access your API key during this course, you can just go back to your note, copy the text of the key and continue coding. Now let's get started.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.