TL;DR : for security reasons and analytics.
API stands for application programming interface. When you use our location services (our APIs), we need a way to identify that it's your application that's making the request to use the service (API). Thanks to the API Key we can:
However in examples that require access to multiple services you need to check if the API key that you are using is a key valid for all the products required by the example. If not, you will have to use two keys like in the example below: