Figure 2-6Anatomy of a Google API QueryIn this
Syntax of a Google Search RequestThe doGoogleSearchmethod enables you to execute a Google search request. Atypical Google APIsearch request using doGoogleSearchis structured as follows: SearchResult = Search.doGoogleSearch(Key, q, _ Start, MaxResults, Filter, Restrict, SafeSearch, lr, ie, oe) .Keyis the developer key that Google provided for you. .qis the search string text of your search command, which can be just a simple search or caninclude the advanced options reviewed earlier in this chapter. .Start is the starting index where you want the results to start. You should use 0 if you wantthe first set of results. .MaxResultsis the maximum number of results to return. It can be a value from 1 to 10. .Filteris a Boolean value that specifies whether your results go through automatic query filtering. .Restrictis a text value that will restrict your search to a specific country or one of Google stopical searches. This field is usually left blank to leave the search unrestricted. .SafeSearchis a Boolean value that specifies whether the results will be filtered to removeadult content. .lrstands for language restrictand allows you to limit your search results to a particular language. .iestands for input encoding and allows you to specify the type of character encoding that yourquery will use. Google s documentation says that request data should use the UTF-8 format. You can leave this field blank. .oestands for output encoding, which should be UTF-8. You can leave this field blank. Syntax of a Google Search ResponseThe most important aspects of the search response are returned in a resultElementslist that containselements such as the following: .