Joe Gregorio | 075572b | 2012-07-09 16:53:09 -0400 | [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></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 | "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": { |
| 242 | }, |
| 243 | "htmlTitle": "A String", |
| 244 | "htmlSnippet": "A String", |
| 245 | "link": "A String", |
| 246 | "image": { |
| 247 | "thumbnailWidth": 42, |
| 248 | "byteSize": 42, |
| 249 | "height": 42, |
| 250 | "width": 42, |
| 251 | "contextLink": "A String", |
| 252 | "thumbnailLink": "A String", |
| 253 | "thumbnailHeight": 42, |
| 254 | }, |
| 255 | "mime": "A String", |
| 256 | "fileFormat": "A String", |
| 257 | }, |
| 258 | ], |
| 259 | "context": { |
| 260 | "facets": [ |
| 261 | [ |
| 262 | { |
| 263 | "anchor": "A String", |
| 264 | "label": "A String", |
| 265 | }, |
| 266 | ], |
| 267 | ], |
| 268 | "title": "A String", |
| 269 | }, |
| 270 | "queries": { |
| 271 | }, |
| 272 | "spelling": { |
| 273 | "correctedQuery": "A String", |
| 274 | "htmlCorrectedQuery": "A String", |
| 275 | }, |
| 276 | "searchInformation": { |
| 277 | "formattedSearchTime": "A String", |
| 278 | "formattedTotalResults": "A String", |
| 279 | "totalResults": "A String", |
| 280 | "searchTime": 3.14, |
| 281 | }, |
| 282 | }</pre> |
| 283 | </div> |
| 284 | |
| 285 | </body></html> |