1 <html><body> 2 <style> 3 4 body, 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 15 body { 16 font-size: 13px; 17 padding: 1em; 18 } 19 20 h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23 } 24 25 h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28 } 29 30 h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34 } 35 36 pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39 } 40 41 pre { 42 margin-top: 0.5em; 43 } 44 45 h1, h2, h3, p { 46 font-family: Arial, sans serif; 47 } 48 49 h1, 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 85 Args: 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 196 Returns: 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 "label_with_op": "A String", 233 "displayName": "A String", 234 "name": "A String", 235 }, 236 ], 237 "title": "A String", 238 "displayLink": "A String", 239 "cacheId": "A String", 240 "formattedUrl": "A String", 241 "htmlFormattedUrl": "A String", 242 "pagemap": { 243 "a_key": [ 244 { 245 "a_key": "", 246 }, 247 ], 248 }, 249 "htmlTitle": "A String", 250 "htmlSnippet": "A String", 251 "link": "A String", 252 "image": { 253 "thumbnailWidth": 42, 254 "byteSize": 42, 255 "height": 42, 256 "width": 42, 257 "contextLink": "A String", 258 "thumbnailLink": "A String", 259 "thumbnailHeight": 42, 260 }, 261 "mime": "A String", 262 "fileFormat": "A String", 263 }, 264 ], 265 "context": { 266 "facets": [ 267 [ 268 { 269 "label_with_op": "A String", 270 "anchor": "A String", 271 "label": "A String", 272 }, 273 ], 274 ], 275 "title": "A String", 276 }, 277 "queries": { 278 "a_key": [ 279 { 280 "sort": "A String", 281 "hl": "A String", 282 "orTerms": "A String", 283 "highRange": "A String", 284 "cx": "A String", 285 "startPage": 42, 286 "disableCnTwTranslation": "A String", 287 "cr": "A String", 288 "imgType": "A String", 289 "gl": "A String", 290 "relatedSite": "A String", 291 "searchType": "A String", 292 "title": "A String", 293 "googleHost": "A String", 294 "fileType": "A String", 295 "imgDominantColor": "A String", 296 "siteSearch": "A String", 297 "cref": "A String", 298 "dateRestrict": "A String", 299 "safe": "A String", 300 "outputEncoding": "A String", 301 "hq": "A String", 302 "searchTerms": "A String", 303 "exactTerms": "A String", 304 "language": "A String", 305 "inputEncoding": "A String", 306 "totalResults": "A String", 307 "lowRange": "A String", 308 "count": 42, 309 "imgSize": "A String", 310 "imgColorType": "A String", 311 "rights": "A String", 312 "startIndex": 42, 313 "excludeTerms": "A String", 314 "filter": "A String", 315 "linkSite": "A String", 316 "siteSearchFilter": "A String", 317 }, 318 ], 319 }, 320 "spelling": { 321 "correctedQuery": "A String", 322 "htmlCorrectedQuery": "A String", 323 }, 324 "searchInformation": { 325 "formattedSearchTime": "A String", 326 "formattedTotalResults": "A String", 327 "totalResults": "A String", 328 "searchTime": 3.14, 329 }, 330 }</pre> 331 </div> 332 333 </body></html>