API (Key): What is an API and what is an API Key? Application Programming Interfaces (APIs)
are a well-defined way on how one piece of code can talk to another. This can be on the
same device, but often refers to the communication between two devices connected by a
network. For the WeatherStation we need to get current and forecast data in a machine-
readable format. To do this we will call the API of a service called OpenWeatherMap.
OpenWeatherMap has different price plans and we will use the Free plan which has
some limitations to distinguish it from the per-pay plan. To have better control over the
users who access the service we will have to get a short text value
-
the API key
-
before
we can call it. You should treat API keys like a password and be careful with them. For
instance, do not post them to a forum, and don’t commit them to a public code repository. If
you do your key may be cancelled, and all your projects will fail!
To get the OpenWeatherMap API key go to https://openweathermap.org/appid and click on
the sign up button. Then get your API key from this page: