v1.d.ts
23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OAuth2Client, JWT, Compute, UserRefreshClient } from 'google-auth-library';
import { GoogleConfigurable, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { GaxiosPromise } from 'gaxios';
export declare namespace customsearch_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Data format for the response.
*/
alt?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
*/
userIp?: string;
}
/**
* CustomSearch API
*
* Searches over a website or collection of websites
*
* @example
* const {google} = require('googleapis');
* const customsearch = google.customsearch('v1');
*
* @namespace customsearch
* @type {Function}
* @version v1
* @variation v1
* @param {object=} options Options for Customsearch
*/
export class Customsearch {
context: APIRequestContext;
cse: Resource$Cse;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
export interface Schema$Context {
facets?: Array<Array<{
anchor?: string;
label?: string;
label_with_op?: string;
}>> | null;
title?: string | null;
}
export interface Schema$Promotion {
bodyLines?: Array<{
htmlTitle?: string;
link?: string;
title?: string;
url?: string;
}> | null;
displayLink?: string | null;
htmlTitle?: string | null;
image?: {
height?: number;
source?: string;
width?: number;
} | null;
link?: string | null;
title?: string | null;
}
export interface Schema$Query {
count?: number | null;
cr?: string | null;
cx?: string | null;
dateRestrict?: string | null;
disableCnTwTranslation?: string | null;
exactTerms?: string | null;
excludeTerms?: string | null;
fileType?: string | null;
filter?: string | null;
gl?: string | null;
googleHost?: string | null;
highRange?: string | null;
hl?: string | null;
hq?: string | null;
imgColorType?: string | null;
imgDominantColor?: string | null;
imgSize?: string | null;
imgType?: string | null;
inputEncoding?: string | null;
language?: string | null;
linkSite?: string | null;
lowRange?: string | null;
orTerms?: string | null;
outputEncoding?: string | null;
relatedSite?: string | null;
rights?: string | null;
safe?: string | null;
searchTerms?: string | null;
searchType?: string | null;
siteSearch?: string | null;
siteSearchFilter?: string | null;
sort?: string | null;
startIndex?: number | null;
startPage?: number | null;
title?: string | null;
totalResults?: string | null;
}
export interface Schema$Result {
cacheId?: string | null;
displayLink?: string | null;
fileFormat?: string | null;
formattedUrl?: string | null;
htmlFormattedUrl?: string | null;
htmlSnippet?: string | null;
htmlTitle?: string | null;
image?: {
byteSize?: number;
contextLink?: string;
height?: number;
thumbnailHeight?: number;
thumbnailLink?: string;
thumbnailWidth?: number;
width?: number;
} | null;
kind?: string | null;
labels?: Array<{
displayName?: string;
label_with_op?: string;
name?: string;
}> | null;
link?: string | null;
mime?: string | null;
pagemap?: {
[key: string]: Array<{
[key: string]: any;
}>;
} | null;
snippet?: string | null;
title?: string | null;
}
export interface Schema$Search {
context?: Schema$Context;
items?: Schema$Result[];
kind?: string | null;
promotions?: Schema$Promotion[];
queries?: {
[key: string]: Schema$Query[];
} | null;
searchInformation?: {
formattedSearchTime?: string;
formattedTotalResults?: string;
searchTime?: number;
totalResults?: string;
} | null;
spelling?: {
correctedQuery?: string;
htmlCorrectedQuery?: string;
} | null;
url?: {
template?: string;
type?: string;
} | null;
}
export class Resource$Cse {
context: APIRequestContext;
siterestrict: Resource$Cse$Siterestrict;
constructor(context: APIRequestContext);
/**
* search.cse.list
* @desc Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results.
* @alias search.cse.list
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW.
* @param {string=} params.cr Country restrict(s).
* @param {string=} params.cx The custom search engine ID to scope this search query
* @param {string=} params.dateRestrict Specifies all search results are from a time period
* @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain
* @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results
* @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
* @param {string=} params.filter Controls turning on or off the duplicate content filter.
* @param {string=} params.gl Geolocation of end user.
* @param {string=} params.googlehost The local Google domain to use to perform the search.
* @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @param {string=} params.hl Sets the user interface language.
* @param {string=} params.hq Appends the extra query terms to the query.
* @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color.
* @param {string=} params.imgDominantColor Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.
* @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
* @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
* @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL
* @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @param {string=} params.lr The language restriction for the search results
* @param {integer=} params.num Number of search results to return
* @param {string=} params.orTerms 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
* @param {string} params.q Query
* @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL
* @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
* @param {string=} params.safe Search safety level
* @param {string=} params.searchType Specifies the search type: image.
* @param {string=} params.siteSearch Specifies all search results should be pages from a given site
* @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter
* @param {string=} params.sort The sort expression to apply to the results
* @param {integer=} params.start The index of the first result to return
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(params?: Params$Resource$Cse$List, options?: MethodOptions): GaxiosPromise<Schema$Search>;
list(params: Params$Resource$Cse$List, options: MethodOptions | BodyResponseCallback<Schema$Search>, callback: BodyResponseCallback<Schema$Search>): void;
list(params: Params$Resource$Cse$List, callback: BodyResponseCallback<Schema$Search>): void;
list(callback: BodyResponseCallback<Schema$Search>): void;
}
export interface Params$Resource$Cse$List extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Turns off the translation between zh-CN and zh-TW.
*/
c2coff?: string;
/**
* Country restrict(s).
*/
cr?: string;
/**
* The custom search engine ID to scope this search query
*/
cx?: string;
/**
* Specifies all search results are from a time period
*/
dateRestrict?: string;
/**
* Identifies a phrase that all documents in the search results must contain
*/
exactTerms?: string;
/**
* Identifies a word or phrase that should not appear in any documents in the search results
*/
excludeTerms?: string;
/**
* Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
*/
fileType?: string;
/**
* Controls turning on or off the duplicate content filter.
*/
filter?: string;
/**
* Geolocation of end user.
*/
gl?: string;
/**
* The local Google domain to use to perform the search.
*/
googlehost?: string;
/**
* Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
*/
highRange?: string;
/**
* Sets the user interface language.
*/
hl?: string;
/**
* Appends the extra query terms to the query.
*/
hq?: string;
/**
* Returns black and white, grayscale, or color images: mono, gray, and color.
*/
imgColorType?: string;
/**
* Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.
*/
imgDominantColor?: string;
/**
* Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
*/
imgSize?: string;
/**
* Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
*/
imgType?: string;
/**
* Specifies that all search results should contain a link to a particular URL
*/
linkSite?: string;
/**
* Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
*/
lowRange?: string;
/**
* The language restriction for the search results
*/
lr?: string;
/**
* Number of search results to return
*/
num?: number;
/**
* 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
*/
orTerms?: string;
/**
* Query
*/
q?: string;
/**
* Specifies that all search results should be pages that are related to the specified URL
*/
relatedSite?: string;
/**
* Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
*/
rights?: string;
/**
* Search safety level
*/
safe?: string;
/**
* Specifies the search type: image.
*/
searchType?: string;
/**
* Specifies all search results should be pages from a given site
*/
siteSearch?: string;
/**
* Controls whether to include or exclude results from the site named in the as_sitesearch parameter
*/
siteSearchFilter?: string;
/**
* The sort expression to apply to the results
*/
sort?: string;
/**
* The index of the first result to return
*/
start?: number;
}
export class Resource$Cse$Siterestrict {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* search.cse.siterestrict.list
* @desc 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.
* @alias search.cse.siterestrict.list
* @memberOf! ()
*
* @param {object} params Parameters for request
* @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW.
* @param {string=} params.cr Country restrict(s).
* @param {string=} params.cx The custom search engine ID to scope this search query
* @param {string=} params.dateRestrict Specifies all search results are from a time period
* @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain
* @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results
* @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
* @param {string=} params.filter Controls turning on or off the duplicate content filter.
* @param {string=} params.gl Geolocation of end user.
* @param {string=} params.googlehost The local Google domain to use to perform the search.
* @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @param {string=} params.hl Sets the user interface language.
* @param {string=} params.hq Appends the extra query terms to the query.
* @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color.
* @param {string=} params.imgDominantColor Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.
* @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
* @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
* @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL
* @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @param {string=} params.lr The language restriction for the search results
* @param {integer=} params.num Number of search results to return
* @param {string=} params.orTerms 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
* @param {string} params.q Query
* @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL
* @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
* @param {string=} params.safe Search safety level
* @param {string=} params.searchType Specifies the search type: image.
* @param {string=} params.siteSearch Specifies all search results should be pages from a given site
* @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter
* @param {string=} params.sort The sort expression to apply to the results
* @param {integer=} params.start The index of the first result to return
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(params?: Params$Resource$Cse$Siterestrict$List, options?: MethodOptions): GaxiosPromise<Schema$Search>;
list(params: Params$Resource$Cse$Siterestrict$List, options: MethodOptions | BodyResponseCallback<Schema$Search>, callback: BodyResponseCallback<Schema$Search>): void;
list(params: Params$Resource$Cse$Siterestrict$List, callback: BodyResponseCallback<Schema$Search>): void;
list(callback: BodyResponseCallback<Schema$Search>): void;
}
export interface Params$Resource$Cse$Siterestrict$List extends StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient;
/**
* Turns off the translation between zh-CN and zh-TW.
*/
c2coff?: string;
/**
* Country restrict(s).
*/
cr?: string;
/**
* The custom search engine ID to scope this search query
*/
cx?: string;
/**
* Specifies all search results are from a time period
*/
dateRestrict?: string;
/**
* Identifies a phrase that all documents in the search results must contain
*/
exactTerms?: string;
/**
* Identifies a word or phrase that should not appear in any documents in the search results
*/
excludeTerms?: string;
/**
* Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
*/
fileType?: string;
/**
* Controls turning on or off the duplicate content filter.
*/
filter?: string;
/**
* Geolocation of end user.
*/
gl?: string;
/**
* The local Google domain to use to perform the search.
*/
googlehost?: string;
/**
* Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
*/
highRange?: string;
/**
* Sets the user interface language.
*/
hl?: string;
/**
* Appends the extra query terms to the query.
*/
hq?: string;
/**
* Returns black and white, grayscale, or color images: mono, gray, and color.
*/
imgColorType?: string;
/**
* Returns images of a specific dominant color: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black and brown.
*/
imgDominantColor?: string;
/**
* Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
*/
imgSize?: string;
/**
* Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
*/
imgType?: string;
/**
* Specifies that all search results should contain a link to a particular URL
*/
linkSite?: string;
/**
* Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
*/
lowRange?: string;
/**
* The language restriction for the search results
*/
lr?: string;
/**
* Number of search results to return
*/
num?: number;
/**
* 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
*/
orTerms?: string;
/**
* Query
*/
q?: string;
/**
* Specifies that all search results should be pages that are related to the specified URL
*/
relatedSite?: string;
/**
* Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
*/
rights?: string;
/**
* Search safety level
*/
safe?: string;
/**
* Specifies the search type: image.
*/
searchType?: string;
/**
* Specifies all search results should be pages from a given site
*/
siteSearch?: string;
/**
* Controls whether to include or exclude results from the site named in the as_sitesearch parameter
*/
siteSearchFilter?: string;
/**
* The sort expression to apply to the results
*/
sort?: string;
/**
* The index of the first result to return
*/
start?: number;
}
export {};
}