blob: 20fd03489d295c0fc35595fc67dc2937c76df854 [file] [log] [blame]
Joe Gregorio075572b2012-07-09 16:53:09 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="customsearch_v1.html">CustomSearch API</a> . <a href="customsearch_v1.cse.html">cse</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#list">list(q, dateRestrict=None, hl=None, orTerms=None, highRange=None, num=None, cr=None, imgType=None, relatedSite=None, filter=None, gl=None, searchType=None, fileType=None, start=None, imgDominantColor=None, lr=None, siteSearch=None, cref=None, sort=None, hq=None, c2coff=None, googlehost=None, safe=None, exactTerms=None, lowRange=None, imgSize=None, imgColorType=None, rights=None, excludeTerms=None, linkSite=None, cx=None, siteSearchFilter=None)</a></code></p>
79<p class="firstline">Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="list">list(q, dateRestrict=None, hl=None, orTerms=None, highRange=None, num=None, cr=None, imgType=None, relatedSite=None, filter=None, gl=None, searchType=None, fileType=None, start=None, imgDominantColor=None, lr=None, siteSearch=None, cref=None, sort=None, hq=None, c2coff=None, googlehost=None, safe=None, exactTerms=None, lowRange=None, imgSize=None, imgColorType=None, rights=None, excludeTerms=None, linkSite=None, cx=None, siteSearchFilter=None)</code>
83 <pre>Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.
84
85Args:
86 q: string, Query (required)
87 dateRestrict: string, Specifies all search results are from a time period
88 hl: string, Sets the user interface language.
89 orTerms: string, Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms
90 highRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
91 num: integer, Number of search results to return
92 cr: string, Country restrict(s).
93 imgType: string, Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
94 Allowed values
95 clipart - clipart
96 face - face
97 lineart - lineart
98 news - news
99 photo - photo
100 relatedSite: string, Specifies that all search results should be pages that are related to the specified URL
101 filter: string, Controls turning on or off the duplicate content filter.
102 Allowed values
103 0 - Turns off duplicate content filter.
104 1 - Turns on duplicate content filter.
105 gl: string, Geolocation of end user.
106 searchType: string, Specifies the search type: image.
107 Allowed values
108 image - custom image search
109 fileType: string, Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
110 start: integer, The index of the first result to return
111 imgDominantColor: string, Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.
112 Allowed values
113 black - black
114 blue - blue
115 brown - brown
116 gray - gray
117 green - green
118 pink - pink
119 purple - purple
120 teal - teal
121 white - white
122 yellow - yellow
123 lr: string, The language restriction for the search results
124 Allowed values
125 lang_ar - Arabic
126 lang_bg - Bulgarian
127 lang_ca - Catalan
128 lang_cs - Czech
129 lang_da - Danish
130 lang_de - German
131 lang_el - Greek
132 lang_en - English
133 lang_es - Spanish
134 lang_et - Estonian
135 lang_fi - Finnish
136 lang_fr - French
137 lang_hr - Croatian
138 lang_hu - Hungarian
139 lang_id - Indonesian
140 lang_is - Icelandic
141 lang_it - Italian
142 lang_iw - Hebrew
143 lang_ja - Japanese
144 lang_ko - Korean
145 lang_lt - Lithuanian
146 lang_lv - Latvian
147 lang_nl - Dutch
148 lang_no - Norwegian
149 lang_pl - Polish
150 lang_pt - Portuguese
151 lang_ro - Romanian
152 lang_ru - Russian
153 lang_sk - Slovak
154 lang_sl - Slovenian
155 lang_sr - Serbian
156 lang_sv - Swedish
157 lang_tr - Turkish
158 lang_zh-CN - Chinese (Simplified)
159 lang_zh-TW - Chinese (Traditional)
160 siteSearch: string, Specifies all search results should be pages from a given site
161 cref: string, The URL of a linked custom search engine
162 sort: string, The sort expression to apply to the results
163 hq: string, Appends the extra query terms to the query.
164 c2coff: string, Turns off the translation between zh-CN and zh-TW.
165 googlehost: string, The local Google domain to use to perform the search.
166 safe: string, Search safety level
167 Allowed values
168 high - Enables highest level of safe search filtering.
169 medium - Enables moderate safe search filtering.
170 off - Disables safe search filtering.
171 exactTerms: string, Identifies a phrase that all documents in the search results must contain
172 lowRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
173 imgSize: string, Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
174 Allowed values
175 huge - huge
176 icon - icon
177 large - large
178 medium - medium
179 small - small
180 xlarge - xlarge
181 xxlarge - xxlarge
182 imgColorType: string, Returns black and white, grayscale, or color images: mono, gray, and color.
183 Allowed values
184 color - color
185 gray - gray
186 mono - mono
187 rights: string, Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
188 excludeTerms: string, Identifies a word or phrase that should not appear in any documents in the search results
189 linkSite: string, Specifies that all search results should contain a link to a particular URL
190 cx: string, The custom search engine ID to scope this search query
191 siteSearchFilter: string, Controls whether to include or exclude results from the site named in the as_sitesearch parameter
192 Allowed values
193 e - exclude
194 i - include
195
196Returns:
197 An object of the form:
198
199 {
200 "promotions": [
201 {
202 "title": "A String",
203 "displayLink": "A String",
204 "htmlTitle": "A String",
205 "link": "A String",
206 "bodyLines": [
207 {
208 "url": "A String",
209 "htmlTitle": "A String",
210 "link": "A String",
211 "title": "A String",
212 },
213 ],
214 "image": {
215 "source": "A String",
216 "width": 42,
217 "height": 42,
218 },
219 },
220 ],
221 "kind": "customsearch#search",
222 "url": {
223 "type": "application/json",
224 "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json",
225 },
226 "items": [
227 {
228 "snippet": "A String",
229 "kind": "customsearch#result",
230 "labels": [
231 {
232 "displayName": "A String",
233 "name": "A String",
234 },
235 ],
236 "title": "A String",
237 "displayLink": "A String",
238 "cacheId": "A String",
239 "formattedUrl": "A String",
240 "htmlFormattedUrl": "A String",
241 "pagemap": {
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400242 "a_key": [
243 {
244 "a_key": "",
245 },
246 ],
Joe Gregorio075572b2012-07-09 16:53:09 -0400247 },
248 "htmlTitle": "A String",
249 "htmlSnippet": "A String",
250 "link": "A String",
251 "image": {
252 "thumbnailWidth": 42,
253 "byteSize": 42,
254 "height": 42,
255 "width": 42,
256 "contextLink": "A String",
257 "thumbnailLink": "A String",
258 "thumbnailHeight": 42,
259 },
260 "mime": "A String",
261 "fileFormat": "A String",
262 },
263 ],
264 "context": {
265 "facets": [
266 [
267 {
268 "anchor": "A String",
269 "label": "A String",
270 },
271 ],
272 ],
273 "title": "A String",
274 },
275 "queries": {
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400276 "a_key": [
277 {
278 "sort": "A String",
279 "hl": "A String",
280 "orTerms": "A String",
281 "highRange": "A String",
282 "cx": "A String",
283 "startPage": 42,
284 "disableCnTwTranslation": "A String",
285 "cr": "A String",
286 "imgType": "A String",
287 "gl": "A String",
288 "relatedSite": "A String",
289 "searchType": "A String",
290 "title": "A String",
291 "googleHost": "A String",
292 "fileType": "A String",
293 "imgDominantColor": "A String",
294 "siteSearch": "A String",
295 "cref": "A String",
296 "dateRestrict": "A String",
297 "safe": "A String",
298 "outputEncoding": "A String",
299 "hq": "A String",
300 "searchTerms": "A String",
301 "exactTerms": "A String",
302 "language": "A String",
303 "inputEncoding": "A String",
304 "totalResults": "A String",
305 "lowRange": "A String",
306 "count": 42,
307 "imgSize": "A String",
308 "imgColorType": "A String",
309 "rights": "A String",
310 "startIndex": 42,
311 "excludeTerms": "A String",
312 "filter": "A String",
313 "linkSite": "A String",
314 "siteSearchFilter": "A String",
315 },
316 ],
Joe Gregorio075572b2012-07-09 16:53:09 -0400317 },
318 "spelling": {
319 "correctedQuery": "A String",
320 "htmlCorrectedQuery": "A String",
321 },
322 "searchInformation": {
323 "formattedSearchTime": "A String",
324 "formattedTotalResults": "A String",
325 "totalResults": "A String",
326 "searchTime": 3.14,
327 },
328 }</pre>
329</div>
330
331</body></html>