-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsearch.ts
More file actions
85 lines (70 loc) · 1.56 KB
/
search.ts
File metadata and controls
85 lines (70 loc) · 1.56 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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
export class Search extends APIResource {
/**
* Perform a web search and return structured results.
*/
web(body: SearchWebParams, options?: Core.RequestOptions): Core.APIPromise<SearchWebResponse> {
return this._client.post('/v1/search', { body, ...options });
}
}
export interface SearchWebResponse {
/**
* The search query that was executed
*/
query: string;
/**
* Unique identifier for the request
*/
requestId: string;
/**
* List of search results
*/
results: Array<SearchWebResponse.Result>;
}
export namespace SearchWebResponse {
export interface Result {
/**
* Unique identifier for the result
*/
id: string;
/**
* The title of the search result
*/
title: string;
/**
* The URL of the search result
*/
url: string;
/**
* Author of the content if available
*/
author?: string;
/**
* Favicon URL
*/
favicon?: string;
/**
* Image URL if available
*/
image?: string;
/**
* Publication date in ISO 8601 format
*/
publishedDate?: string;
}
}
export interface SearchWebParams {
/**
* The search query string
*/
query: string;
/**
* Number of results to return (1-25)
*/
numResults?: number;
}
export declare namespace Search {
export { type SearchWebResponse as SearchWebResponse, type SearchWebParams as SearchWebParams };
}