How to get Search Engine ID
First of all, you need to create your Custom Search Engine at cse.google.com. To do it, you need to click Create a custom search engine.
Then a form to fill out will appear. You need to add your domain to Sites to search field. Name of the search engine will be filled out automatically with your domain name, however, you can change it if needed. After you fill the required fields, you need to click Create.
You've successfully created your Custom search engine!
Now you need to go back here and click on your name of the search engine.
On Basics tab you will see the information about your Search engine. You need to copy Search engine ID and paste it to the widget.