Linux Format

OpenWeathe­rMap: how to get your API key

-

Adding extra functional­ity to our project, we used a popular open data provider to provide precise weather data for our assistant. The Open Weather Map website, http://openweathe­rmap.org, offers a free (Applicatio­n Programmin­g Interface) API for use with many different languages. For our project we used Python 3 and installed the pyowm library for a pythonic method of using the API.

In order to use the service you will need to sign up as a registered user. This is a free service. Once signed in go to API Keys and create a new key and remember to give it a name. You can

have multiple keys at any one time, but most users just need the one. Your API key will need to inserted into the Python code for this project, remember we had a line of code marked: owm = pyowm.OWM("API KEY")

Well, all you need to do is paste your key inside (“API KEY”) , save and run your code to connect to the OpenWeathe­rMap service and retrieve the weather for your town or city.

Don’t share your API key or post it online. This code is unique to you and any misuse by other parties may lead to consequenc­es being addressed to you.

 ??  ?? Only one sensor required.
Only one sensor required.

Newspapers in English

Newspapers from Australia