Google Images api

Community, I am having problems using the Google Search api (images), where it does not return me the possible results, for example, I do a search related to car and it returns me images that are not of cars and does not return the minimum amount that is defined as standard which is 10.

I'm using this example from Google itself: https://developers.google.com/custom-search/v1/using_rest

Where mine is as follows shape:

 <!DOCTYPE html> <html>

<html>
  <head>
    <title>JSON Custom Search API Example</title>
  </head>
  <body>
    <div id="content"></div>
    <script>
      function hndlr(response) {
      for (var i = 0; i < response.items.length; i++) {
        var item = response.items[i];
        // in production code, item.htmlTitle should have the HTML entities escaped.
        document.getElementById("content").innerHTML += "<br>" + item.htmlTitle;
      }
    }
    </script>
    <script src="https://www.googleapis.com/customsearch/v1?searchType=image&key=MINHA_KEY&cx=MINHA_ID_MACHINE&q=carros&callback=hndlr">
    </script>
  </body>
</html>

My Machine id is already enabled the option of images, even if in this case it does not return anything, it gives the following error:

Uncaught TypeError: Cannot read property 'length' of undefined
    at hndlr (testePesquisa.html:50)
    at v1?

Any light please?

EDIT:

Ahhh, I kind of managed to find the problem, where has the option "sites the search" I was putting: www.google.com I did the deletion and added *. com and*. com.br and assi I managed to satisfy my research, but the problem is, I have even that by these terms (. com and. br....) or have any generic terms? for I tested leaving empty and nothing returned.

Author: H C, 2019-06-10