Code not working

I have written exactly the same code but it is not working .it is showing ‘You must use an API key to authenticate each request to Google Maps Platform APIs’

You need to generate a unique key for using google’s api. The given link contains the information about the steps involved in obtaining that key.
https://developers.google.com/maps/documentation/geocoding/get-api-key

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.