From the course: OpenAI API for Python Developers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Challenge: Connect to a public API

Challenge: Connect to a public API

From the course: OpenAI API for Python Developers

Challenge: Connect to a public API

(bright music) - [Instructor] The next step will be in the form of a challenge. After defining functions, the challenge for you is to connect to an API, and this will be openweathermap.org, which is an online service that provides global weather data and that also provides a nice API for developers who need to integrate current weather data into their web applications. And this web service is very generous because it allows a thousand calls per day and for free, which is more than enough to test out the different API endpoints that you're going to find right here in order to get, for example, the current weather data. So we're going to check out the documentation right here very quickly. And in order to make an API call to get the current weather data for one location, you need to call this endpoint and specify the latitude and longitude and also an API key. So this is mandatory in order to be authorized to make API calls. So here, after you create an account, you need to go here, my…

Contents