- Head over to https://console.developers.google.com/home/dashboard and create a new project.
- Select 'API Manager' from the hamburger menu
- Hit 'URL Shortener API' under 'Other Popular APIs'
- Click 'Enable'
- In 'Credentials' section, click 'Create Credentials' and select 'API key'. Select the 'Browser key' option.
And you'll get a shiny, new API key!
Now, all you need to do is put the API key in the var api_key in the script you can download from here: Github.
Google Developers Guide