blob: e59deac6dd816bc5187e53f7fea19886ae20514c [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="customsearch_v1.cse.siterestrict.html">siterestrict()</a></code>
79</p>
80<p class="firstline">Returns the siterestrict Resource.</p>
81
82<p class="toc_element">
83 <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, 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>
John Asmuth614db982014-04-24 15:46:26 -040084<p class="firstline">Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.</p>
85<h3>Method Details</h3>
86<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <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, 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>
John Asmuth614db982014-04-24 15:46:26 -040088 <pre>Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.
89
90Args:
91 q: string, Query (required)
92 dateRestrict: string, Specifies all search results are from a time period
93 hl: string, Sets the user interface language.
94 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
95 highRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
96 num: integer, Number of search results to return
97 cr: string, Country restrict(s).
98 imgType: string, Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
99 Allowed values
100 clipart - clipart
101 face - face
102 lineart - lineart
103 news - news
104 photo - photo
105 relatedSite: string, Specifies that all search results should be pages that are related to the specified URL
106 filter: string, Controls turning on or off the duplicate content filter.
107 Allowed values
108 0 - Turns off duplicate content filter.
109 1 - Turns on duplicate content filter.
110 gl: string, Geolocation of end user.
111 searchType: string, Specifies the search type: image.
112 Allowed values
113 image - custom image search
114 fileType: string, Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
115 start: integer, The index of the first result to return
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116 imgDominantColor: string, Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.
John Asmuth614db982014-04-24 15:46:26 -0400117 Allowed values
118 black - black
119 blue - blue
120 brown - brown
121 gray - gray
122 green - green
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700123 orange - orange
John Asmuth614db982014-04-24 15:46:26 -0400124 pink - pink
125 purple - purple
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126 red - red
John Asmuth614db982014-04-24 15:46:26 -0400127 teal - teal
128 white - white
129 yellow - yellow
130 lr: string, The language restriction for the search results
131 Allowed values
132 lang_ar - Arabic
133 lang_bg - Bulgarian
134 lang_ca - Catalan
135 lang_cs - Czech
136 lang_da - Danish
137 lang_de - German
138 lang_el - Greek
139 lang_en - English
140 lang_es - Spanish
141 lang_et - Estonian
142 lang_fi - Finnish
143 lang_fr - French
144 lang_hr - Croatian
145 lang_hu - Hungarian
146 lang_id - Indonesian
147 lang_is - Icelandic
148 lang_it - Italian
149 lang_iw - Hebrew
150 lang_ja - Japanese
151 lang_ko - Korean
152 lang_lt - Lithuanian
153 lang_lv - Latvian
154 lang_nl - Dutch
155 lang_no - Norwegian
156 lang_pl - Polish
157 lang_pt - Portuguese
158 lang_ro - Romanian
159 lang_ru - Russian
160 lang_sk - Slovak
161 lang_sl - Slovenian
162 lang_sr - Serbian
163 lang_sv - Swedish
164 lang_tr - Turkish
165 lang_zh-CN - Chinese (Simplified)
166 lang_zh-TW - Chinese (Traditional)
167 siteSearch: string, Specifies all search results should be pages from a given site
John Asmuth614db982014-04-24 15:46:26 -0400168 sort: string, The sort expression to apply to the results
169 hq: string, Appends the extra query terms to the query.
170 c2coff: string, Turns off the translation between zh-CN and zh-TW.
171 googlehost: string, The local Google domain to use to perform the search.
172 safe: string, Search safety level
173 Allowed values
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700174 active - Enables safe search filtering.
175 high - (Deprecated) Same as active.
176 medium - (Deprecated) Same as active.
John Asmuth614db982014-04-24 15:46:26 -0400177 off - Disables safe search filtering.
178 exactTerms: string, Identifies a phrase that all documents in the search results must contain
179 lowRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
180 imgSize: string, Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
181 Allowed values
182 huge - huge
183 icon - icon
184 large - large
185 medium - medium
186 small - small
187 xlarge - xlarge
188 xxlarge - xxlarge
189 imgColorType: string, Returns black and white, grayscale, or color images: mono, gray, and color.
190 Allowed values
191 color - color
192 gray - gray
193 mono - mono
194 rights: string, Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
195 excludeTerms: string, Identifies a word or phrase that should not appear in any documents in the search results
196 linkSite: string, Specifies that all search results should contain a link to a particular URL
197 cx: string, The custom search engine ID to scope this search query
198 siteSearchFilter: string, Controls whether to include or exclude results from the site named in the as_sitesearch parameter
199 Allowed values
200 e - exclude
201 i - include
202
203Returns:
204 An object of the form:
205
206 {
207 "promotions": [
208 {
209 "title": "A String",
210 "displayLink": "A String",
211 "htmlTitle": "A String",
212 "link": "A String",
213 "bodyLines": [
214 {
215 "url": "A String",
216 "htmlTitle": "A String",
217 "link": "A String",
218 "title": "A String",
219 },
220 ],
221 "image": {
222 "source": "A String",
223 "width": 42,
224 "height": 42,
225 },
226 },
227 ],
228 "kind": "customsearch#search",
229 "url": {
230 "type": "application/json",
Dan O'Mearadd494642020-05-01 07:42:23 -0700231 "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&amp;num={count?}&amp;start={startIndex?}&amp;lr={language?}&amp;safe={safe?}&amp;cx={cx?}&amp;sort={sort?}&amp;filter={filter?}&amp;gl={gl?}&amp;cr={cr?}&amp;googlehost={googleHost?}&amp;c2coff={disableCnTwTranslation?}&amp;hq={hq?}&amp;hl={hl?}&amp;siteSearch={siteSearch?}&amp;siteSearchFilter={siteSearchFilter?}&amp;exactTerms={exactTerms?}&amp;excludeTerms={excludeTerms?}&amp;linkSite={linkSite?}&amp;orTerms={orTerms?}&amp;relatedSite={relatedSite?}&amp;dateRestrict={dateRestrict?}&amp;lowRange={lowRange?}&amp;highRange={highRange?}&amp;searchType={searchType}&amp;fileType={fileType?}&amp;rights={rights?}&amp;imgSize={imgSize?}&amp;imgType={imgType?}&amp;imgColorType={imgColorType?}&amp;imgDominantColor={imgDominantColor?}&amp;alt=json",
John Asmuth614db982014-04-24 15:46:26 -0400232 },
233 "items": [
234 {
235 "snippet": "A String",
236 "kind": "customsearch#result",
237 "labels": [
238 {
239 "label_with_op": "A String",
240 "displayName": "A String",
241 "name": "A String",
242 },
243 ],
244 "title": "A String",
245 "displayLink": "A String",
246 "cacheId": "A String",
247 "formattedUrl": "A String",
248 "htmlFormattedUrl": "A String",
249 "pagemap": {
250 "a_key": [
251 {
252 "a_key": "",
253 },
254 ],
255 },
256 "htmlTitle": "A String",
257 "htmlSnippet": "A String",
258 "link": "A String",
259 "image": {
260 "thumbnailWidth": 42,
261 "byteSize": 42,
262 "height": 42,
263 "width": 42,
264 "contextLink": "A String",
265 "thumbnailLink": "A String",
266 "thumbnailHeight": 42,
267 },
268 "mime": "A String",
269 "fileFormat": "A String",
270 },
271 ],
272 "context": {
273 "facets": [
274 [
275 {
276 "label_with_op": "A String",
277 "anchor": "A String",
278 "label": "A String",
279 },
280 ],
281 ],
282 "title": "A String",
283 },
284 "queries": {
285 "a_key": [
286 {
287 "sort": "A String",
288 "hl": "A String",
289 "orTerms": "A String",
290 "highRange": "A String",
291 "cx": "A String",
292 "startPage": 42,
293 "disableCnTwTranslation": "A String",
294 "cr": "A String",
295 "imgType": "A String",
296 "gl": "A String",
297 "relatedSite": "A String",
298 "searchType": "A String",
299 "title": "A String",
300 "googleHost": "A String",
301 "fileType": "A String",
302 "imgDominantColor": "A String",
303 "siteSearch": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400304 "dateRestrict": "A String",
305 "safe": "A String",
306 "outputEncoding": "A String",
307 "hq": "A String",
308 "searchTerms": "A String",
309 "exactTerms": "A String",
310 "language": "A String",
311 "inputEncoding": "A String",
312 "totalResults": "A String",
313 "lowRange": "A String",
314 "count": 42,
315 "imgSize": "A String",
316 "imgColorType": "A String",
317 "rights": "A String",
318 "startIndex": 42,
319 "excludeTerms": "A String",
320 "filter": "A String",
321 "linkSite": "A String",
322 "siteSearchFilter": "A String",
323 },
324 ],
325 },
326 "spelling": {
327 "correctedQuery": "A String",
328 "htmlCorrectedQuery": "A String",
329 },
330 "searchInformation": {
331 "formattedSearchTime": "A String",
332 "formattedTotalResults": "A String",
333 "totalResults": "A String",
334 "searchTime": 3.14,
335 },
336 }</pre>
337</div>
338
339</body></html>