56 Part I — Basics
Table 4-1(continued)
Parameter Description
Filter Activates filtering to remove similar results or results from the
same host.
Restrict Adds a restriction to the search database. Restrictions can be made
on a country-by-country basis or to specific topics. Check the API
documentation for a full list.
SafeSearch Enables SafeSearch, which filters adult content.
Language Restrict Restricts the search to return only matches within a specified source
language.
Input Encoding Now deprecated. Used to specify the input encoding; all requests
should be made in UTF-8.
Output Encoding Now deprecated. Used to specify the output encoding; all results
are now returned in UTF-8.
Some of these parameters have specific settings and formats that will alter the information that
is returned during a search. For example, the query stringparameter supports the query
specification available to you when you perform a search on the Google web site. That is, plac-
ing a plus sign before a word will require the word to be in the page; placing a minus sign
before a word will require that it be ignored; and enclosing a group of words in quotation
marks will allow you to specify a certain phrase to search for.
The easiest way to identify the right query string is to perform your search on the Google web
site itself. This way, you are not limited by the number of queries and can perfect the string that
you want to use before running the query through your application. Once you have the right
string, place this into your code or application.
Other parameters filter the results in terms of the information returned, such as removing adult
content, restricting to specific topics, and even restricting to specific locations and languages.
Check the API documentation for a complete guide of the available options.
Results
The call to the Google Web API returns a large structure of information composed of base
data (information about the search, such as the total number of results and indices), as well as
an array of results. How you access the information that has been returned depends on your
implementation and the language you are using (for example, Perl makes the data available in
the form of a nested hash structure). The base data returned is detailed in Table 4-2.