1- visit https://console.developers.google.com/ and create your first project if it is the first time to use the API
2- at the “Library” tab search for “Custom Search”
3- Click the “Custom Search API”
4- You should find a “Create project” button if you don’t have a project, click it to create a project and if you already have a project, skip this step
5- Enable the API
6- Click the Credentials tab and click “Create credentials” then “API Key”
7- Once clicked, The API key will appear.
8-Just copy it to the plugin settings page then click “Done”
Important: please do not set any refer restrictions.