Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 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> . <a href="customsearch_v1.cse.siterestrict.html">siterestrict</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, 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. Uses a small set of url patterns.</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, 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. Uses a small set of url patterns. |
| 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: red, orange, 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 | orange - orange |
| 119 | pink - pink |
| 120 | purple - purple |
| 121 | red - red |
| 122 | teal - teal |
| 123 | white - white |
| 124 | yellow - yellow |
| 125 | lr: string, The language restriction for the search results |
| 126 | Allowed values |
| 127 | lang_ar - Arabic |
| 128 | lang_bg - Bulgarian |
| 129 | lang_ca - Catalan |
| 130 | lang_cs - Czech |
| 131 | lang_da - Danish |
| 132 | lang_de - German |
| 133 | lang_el - Greek |
| 134 | lang_en - English |
| 135 | lang_es - Spanish |
| 136 | lang_et - Estonian |
| 137 | lang_fi - Finnish |
| 138 | lang_fr - French |
| 139 | lang_hr - Croatian |
| 140 | lang_hu - Hungarian |
| 141 | lang_id - Indonesian |
| 142 | lang_is - Icelandic |
| 143 | lang_it - Italian |
| 144 | lang_iw - Hebrew |
| 145 | lang_ja - Japanese |
| 146 | lang_ko - Korean |
| 147 | lang_lt - Lithuanian |
| 148 | lang_lv - Latvian |
| 149 | lang_nl - Dutch |
| 150 | lang_no - Norwegian |
| 151 | lang_pl - Polish |
| 152 | lang_pt - Portuguese |
| 153 | lang_ro - Romanian |
| 154 | lang_ru - Russian |
| 155 | lang_sk - Slovak |
| 156 | lang_sl - Slovenian |
| 157 | lang_sr - Serbian |
| 158 | lang_sv - Swedish |
| 159 | lang_tr - Turkish |
| 160 | lang_zh-CN - Chinese (Simplified) |
| 161 | lang_zh-TW - Chinese (Traditional) |
| 162 | siteSearch: string, Specifies all search results should be pages from a given site |
| 163 | sort: string, The sort expression to apply to the results |
| 164 | hq: string, Appends the extra query terms to the query. |
| 165 | c2coff: string, Turns off the translation between zh-CN and zh-TW. |
| 166 | googlehost: string, The local Google domain to use to perform the search. |
| 167 | safe: string, Search safety level |
| 168 | Allowed values |
| 169 | high - Enables highest level of safe search filtering. |
| 170 | medium - Enables moderate safe search filtering. |
| 171 | off - Disables safe search filtering. |
| 172 | exactTerms: string, Identifies a phrase that all documents in the search results must contain |
| 173 | lowRange: string, Creates a range in form as_nlo value..as_nhi value and attempts to append it to query |
| 174 | imgSize: string, Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. |
| 175 | Allowed values |
| 176 | huge - huge |
| 177 | icon - icon |
| 178 | large - large |
| 179 | medium - medium |
| 180 | small - small |
| 181 | xlarge - xlarge |
| 182 | xxlarge - xxlarge |
| 183 | imgColorType: string, Returns black and white, grayscale, or color images: mono, gray, and color. |
| 184 | Allowed values |
| 185 | color - color |
| 186 | gray - gray |
| 187 | mono - mono |
| 188 | rights: string, Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. |
| 189 | excludeTerms: string, Identifies a word or phrase that should not appear in any documents in the search results |
| 190 | linkSite: string, Specifies that all search results should contain a link to a particular URL |
| 191 | cx: string, The custom search engine ID to scope this search query |
| 192 | siteSearchFilter: string, Controls whether to include or exclude results from the site named in the as_sitesearch parameter |
| 193 | Allowed values |
| 194 | e - exclude |
| 195 | i - include |
| 196 | |
| 197 | Returns: |
| 198 | An object of the form: |
| 199 | |
| 200 | { |
| 201 | "promotions": [ |
| 202 | { |
| 203 | "title": "A String", |
| 204 | "displayLink": "A String", |
| 205 | "htmlTitle": "A String", |
| 206 | "link": "A String", |
| 207 | "bodyLines": [ |
| 208 | { |
| 209 | "url": "A String", |
| 210 | "htmlTitle": "A String", |
| 211 | "link": "A String", |
| 212 | "title": "A String", |
| 213 | }, |
| 214 | ], |
| 215 | "image": { |
| 216 | "source": "A String", |
| 217 | "width": 42, |
| 218 | "height": 42, |
| 219 | }, |
| 220 | }, |
| 221 | ], |
| 222 | "kind": "customsearch#search", |
| 223 | "url": { |
| 224 | "type": "application/json", |
| 225 | "template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&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", |
| 226 | }, |
| 227 | "items": [ |
| 228 | { |
| 229 | "snippet": "A String", |
| 230 | "kind": "customsearch#result", |
| 231 | "labels": [ |
| 232 | { |
| 233 | "label_with_op": "A String", |
| 234 | "displayName": "A String", |
| 235 | "name": "A String", |
| 236 | }, |
| 237 | ], |
| 238 | "title": "A String", |
| 239 | "displayLink": "A String", |
| 240 | "cacheId": "A String", |
| 241 | "formattedUrl": "A String", |
| 242 | "htmlFormattedUrl": "A String", |
| 243 | "pagemap": { |
| 244 | "a_key": [ |
| 245 | { |
| 246 | "a_key": "", |
| 247 | }, |
| 248 | ], |
| 249 | }, |
| 250 | "htmlTitle": "A String", |
| 251 | "htmlSnippet": "A String", |
| 252 | "link": "A String", |
| 253 | "image": { |
| 254 | "thumbnailWidth": 42, |
| 255 | "byteSize": 42, |
| 256 | "height": 42, |
| 257 | "width": 42, |
| 258 | "contextLink": "A String", |
| 259 | "thumbnailLink": "A String", |
| 260 | "thumbnailHeight": 42, |
| 261 | }, |
| 262 | "mime": "A String", |
| 263 | "fileFormat": "A String", |
| 264 | }, |
| 265 | ], |
| 266 | "context": { |
| 267 | "facets": [ |
| 268 | [ |
| 269 | { |
| 270 | "label_with_op": "A String", |
| 271 | "anchor": "A String", |
| 272 | "label": "A String", |
| 273 | }, |
| 274 | ], |
| 275 | ], |
| 276 | "title": "A String", |
| 277 | }, |
| 278 | "queries": { |
| 279 | "a_key": [ |
| 280 | { |
| 281 | "sort": "A String", |
| 282 | "hl": "A String", |
| 283 | "orTerms": "A String", |
| 284 | "highRange": "A String", |
| 285 | "cx": "A String", |
| 286 | "startPage": 42, |
| 287 | "disableCnTwTranslation": "A String", |
| 288 | "cr": "A String", |
| 289 | "imgType": "A String", |
| 290 | "gl": "A String", |
| 291 | "relatedSite": "A String", |
| 292 | "searchType": "A String", |
| 293 | "title": "A String", |
| 294 | "googleHost": "A String", |
| 295 | "fileType": "A String", |
| 296 | "imgDominantColor": "A String", |
| 297 | "siteSearch": "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> |