You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/diffbot.d.ts
+49-35Lines changed: 49 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ declare class Diffbot {
10
10
test: boolean;
11
11
/**
12
12
* Execute an analyze API call
13
-
* @param {Object} options The analyze options
13
+
* @param {object} options The analyze options
14
14
* @param {string} options.url Web page URL of the analyze to process
15
15
* @param {string} [options.mode] By default the Analyze API will fully extract all pages that match an existing Automatic API -- articles, products or image pages. Set mode to a specific page-type (e.g., mode=article) to extract content only from that specific page-type. All other pages will simply return the default Analyze fields.
16
16
* @param {string} [options.fallback] Force any non-extracted pages (those with a type of "other") through a specific API. For example, to route all "other" pages through the Article API, pass &fallback=article. Pages that utilize this functionality will return a fallbackType field at the top-level of the response and a originalType field within each extracted object, both of which will indicate the fallback API used.
@@ -23,7 +23,8 @@ declare class Diffbot {
23
23
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
24
24
* @param {string} [options.body] Optional HTML markup to pass as POST body
25
25
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-javascript
26
-
* @returns {Object} The analyze query results
26
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
27
+
* @returns {object} The analyze query results
27
28
*/
28
29
analyze(options: {
29
30
url: string;
@@ -38,10 +39,11 @@ declare class Diffbot {
38
39
proxyAuth?: string;
39
40
body?: string;
40
41
customJS?: string;
41
-
}): any;
42
+
customHeaders?: object;
43
+
}): object;
42
44
/**
43
45
* Execute an article API call
44
-
* @param {Object} options The search options
46
+
* @param {object} options The search options
45
47
* @param {string} [options.url] Web page URL of the article to process (required unless posting plain text)
46
48
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Article API. See fields: https://www.diffbot.com/dev/docs/article/#fields
47
49
* @param {boolean} [options.paging] Pass paging=false to disable automatic concatenation of multiple-page articles. (By default, Diffbot will concatenate up to 20 pages of a single article.)
@@ -55,7 +57,8 @@ declare class Diffbot {
55
57
* @param {string[]} [options.naturalLanguage] Used to request the output of the Diffbot Natural Language API in the field naturalLanguage. Example: &naturalLanguage=entities,facts,categories,sentiment.
56
58
* @param {string} [options.body] Optional HTML markup to pass as POST body
57
59
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-article#custom-javascript
58
-
* @returns {Object} The article query results
60
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
61
+
* @returns {object} The article query results
59
62
*/
60
63
article(options: {
61
64
url?: string;
@@ -71,10 +74,11 @@ declare class Diffbot {
71
74
naturalLanguage?: string[];
72
75
body?: string;
73
76
customJS?: string;
74
-
}): any;
77
+
customHeaders?: object;
78
+
}): object;
75
79
/**
76
80
* Execute a discussion API call
77
-
* @param {Object} options The call options
81
+
* @param {object} options The call options
78
82
* @param {string} options.url Web page URL of the discussion to process
79
83
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Discussion API. See fields: https://www.diffbot.com/dev/docs/discussion/#fields
80
84
* @param {number} [options.timeout] Sets a value in milliseconds to wait for the retrieval/fetch of content from the requested URL. The default timeout for the third-party response is 30 seconds (30000).
@@ -84,7 +88,8 @@ declare class Diffbot {
84
88
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
85
89
* @param {string} [options.body] Optional HTML markup to pass as POST body
86
90
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-discussion#custom-javascript
87
-
* @returns {Object} The discussion query results
91
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
92
+
* @returns {object} The discussion query results
88
93
*/
89
94
discussion(options: {
90
95
url: string;
@@ -96,10 +101,11 @@ declare class Diffbot {
96
101
proxyAuth?: string;
97
102
body?: string;
98
103
customJS?: string;
99
-
}): any;
104
+
customHeaders?: object;
105
+
}): object;
100
106
/**
101
107
* Execute an event API call
102
-
* @param {Object} options The event options
108
+
* @param {object} options The event options
103
109
* @param {string} options.url Web page URL of the event to process
104
110
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Event API. See fields: https://docs.diffbot.com/docs/en/api-event
105
111
* @param {number} [options.timeout] Sets a value in milliseconds to wait for the retrieval/fetch of content from the requested URL. The default timeout for the third-party response is 30 seconds (30000).
@@ -108,7 +114,8 @@ declare class Diffbot {
108
114
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
109
115
* @param {string} [options.body] Optional HTML markup to pass as POST body
110
116
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-event#custom-javascript
111
-
* @returns {Object} The analyze query results
117
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
118
+
* @returns {object} The analyze query results
112
119
*/
113
120
event(options: {
114
121
url: string;
@@ -119,10 +126,11 @@ declare class Diffbot {
119
126
proxyAuth?: string;
120
127
body?: string;
121
128
customJS?: string;
122
-
}): any;
129
+
customHeaders?: object;
130
+
}): object;
123
131
/**
124
132
* Execute an image API call
125
-
* @param {Object} options The call options
133
+
* @param {object} options The call options
126
134
* @param {string} options.url Web page URL of the image to process
127
135
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Image API. See fields: https://www.diffbot.com/dev/docs/image/#fields
128
136
* @param {number} [options.timeout] Sets a value in milliseconds to wait for the retrieval/fetch of content from the requested URL. The default timeout for the third-party response is 30 seconds (30000).
@@ -131,7 +139,8 @@ declare class Diffbot {
131
139
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
132
140
* @param {string} [options.body] Optional HTML markup to pass as POST body
133
141
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-image#custom-javascript
134
-
* @returns {Object} The image query results
142
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
143
+
* @returns {object} The image query results
135
144
*/
136
145
image(options: {
137
146
url: string;
@@ -142,10 +151,11 @@ declare class Diffbot {
142
151
proxyAuth?: string;
143
152
body?: string;
144
153
customJS?: string;
145
-
}): any;
154
+
customHeaders?: object;
155
+
}): object;
146
156
/**
147
157
* Execute a product API call
148
-
* @param {Object} options The search options
158
+
* @param {object} options The search options
149
159
* @param {string} options.url Web page URL of the product to process
150
160
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Product API. See fields: https://www.diffbot.com/dev/docs/product/#fields
151
161
* @param {boolean} [options.discussion] Pass discussion=false to disable automatic extraction of product reviews.
@@ -155,7 +165,8 @@ declare class Diffbot {
155
165
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
156
166
* @param {string} [options.body] Optional HTML markup to pass as POST body
157
167
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-product#custom-javascript
158
-
* @returns {Object} The product query results
168
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
169
+
* @returns {object} The product query results
159
170
*/
160
171
product(options: {
161
172
url: string;
@@ -167,10 +178,11 @@ declare class Diffbot {
167
178
proxyAuth?: string;
168
179
body?: string;
169
180
customJS?: string;
170
-
}): any;
181
+
customHeaders?: object;
182
+
}): object;
171
183
/**
172
184
* Execute a video API call
173
-
* @param {Object} options The call options
185
+
* @param {object} options The call options
174
186
* @param {string} options.url Web page URL of the video to process
175
187
* @param {string[]} [options.fields] Used to specify optional fields to be returned by the Video API. See fields: https://www.diffbot.com/dev/docs/video/#fields
176
188
* @param {number} [options.timeout] Sets a value in milliseconds to wait for the retrieval/fetch of content from the requested URL. The default timeout for the third-party response is 30 seconds (30000).
@@ -179,7 +191,8 @@ declare class Diffbot {
179
191
* @param {string} [options.proxyAuth] Used to specify the authentication parameters that will be used with the proxy specified in the &proxy parameter. (Ex: &proxyAuth=username:password)
180
192
* @param {string} [options.body] Optional HTML markup to pass as POST body
181
193
* @param {string} [options.customJS] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-video#custom-javascript
182
-
* @returns {Object} The video query results
194
+
* @param {object} [options.customHeaders] This functionality is currently in beta. See docs for details: https://docs.diffbot.com/docs/en/api-analyze#custom-headers
195
+
* @returns {object} The video query results
183
196
*/
184
197
video(options: {
185
198
url: string;
@@ -190,18 +203,19 @@ declare class Diffbot {
190
203
proxyAuth?: string;
191
204
body?: string;
192
205
customJS?: string;
193
-
}): any;
206
+
customHeaders?: object;
207
+
}): object;
194
208
/**
195
209
* Execute a query against the Knowledge Graph
196
-
* @param {Object} options The search options
210
+
* @param {object} options The search options
197
211
* @param {string} options.query The DQL knowledge base query
198
212
* @param {string} [options.type] Type of search: "query", "text", or "queryTextFallback"
199
213
* @param {number} [options.size] Max number of results in page
200
214
* @param {number} [options.from] Ordinal position of first result to return. (First position is 0.) Default is 0.
201
215
* @param {string} [options.jsonmode] jsonmode=extended returns origin information for facts
202
216
* @param {boolean} [options.nonCanonicalFacts] Return non-canonical facts. Default is no non-canonical facts.
203
217
* @param {boolean} [options.noDedupArticles] Indicates that articles should not be deduplicated but all of them returned
204
-
* @returns {Object} The query results
218
+
* @returns {object} The query results
205
219
*/
206
220
knowledgeGraph(options: {
207
221
query: string;
@@ -211,13 +225,13 @@ declare class Diffbot {
211
225
jsonmode?: string;
212
226
nonCanonicalFacts?: boolean;
213
227
noDedupArticles?: boolean;
214
-
}): any;
228
+
}): object;
215
229
crawl(): {
216
230
token: string;
217
231
test: boolean;
218
232
/**
219
233
* Generate a new Crawlbot crawl job
220
-
* @param {Object} options The search options
234
+
* @param {object} options The search options
221
235
* @param {string} options.name Job name. This should be a unique identifier and can be used to modify your crawl or retrieve its output.
222
236
* @param {string[]} options.seeds Seed URL(s). If the seed contains a non-www subdomain ("http://blog.diffbot.com" or "http://support.diffbot.com") Crawlbot will restrict spidering to the specified subdomain.
223
237
* @param {string} [options.apiUrl] Full Diffbot API URL through which to process pages. E.g., &apiUrl=https://api.diffbot.com/v3/article to process matching links via the Article API. The Diffbot API URL can include querystring parameters to tailor the output. For example, &apiUrl=https://api.diffbot.com/v3/product?fields=querystring,meta will process matching links using the Product API, and also return the querystring and meta fields. Uses the Analyze API (Smart Processing) by default.
@@ -242,7 +256,7 @@ declare class Diffbot {
242
256
* @param {number} [options.seedRecrawlFrequency] Useful for specifying a frequency, in number of days, to recrawl seed urls, which is independent of the overall recrawl frequency given by repeat. Defaults to seedRecrawlFrequency=-1 to use the default frequency.
243
257
* @param {boolean} [options.onlyProcessIfNew] By default repeat crawls will only process new (previously unprocessed) pages. Set to false to process all content on repeat crawls.
244
258
* @param {number} [options.maxRounds] Specify the maximum number of crawl repeats. By default (maxRounds=0) repeating crawls will continue indefinitely.
245
-
* @returns {Object} The response and crawl job objects
259
+
* @returns {object} The response and crawl job objects
246
260
*/
247
261
new: (options: {
248
262
name: string;
@@ -269,10 +283,10 @@ declare class Diffbot {
269
283
seedRecrawlFrequency?: number;
270
284
onlyProcessIfNew?: boolean;
271
285
maxRounds?: number;
272
-
})=>any;
286
+
})=>object;
273
287
/**
274
288
* Download a Crawlbot crawl job's results
275
-
* @param {Object} options The options
289
+
* @param {object} options The options
276
290
* @param {string} options.name Name of the crawl whose data you wish to download.
277
291
* @param {string} [options.format] Request format=csv to download the extracted data in CSV format (default: json). Note that CSV files will only contain top-level fields.
278
292
* @param {string} [options.type] Request type=urls to retrieve the crawl URL Report (CSV).
@@ -311,17 +325,17 @@ declare class Diffbot {
311
325
delete: (options: any)=>any;
312
326
/**
313
327
* Get Crawlbot job details
314
-
* @param {Object} options The options
328
+
* @param {object} options The options
315
329
* @param {string} [options.name] Name of crawl to retrieve.
316
-
* @returns {Object} This will return a JSON response of your token's crawls (and Bulk API) jobs in the jobs object. If you have specified a single job name, only one job's details will be returned.
330
+
* @returns {object} This will return a JSON response of your token's crawls (and Bulk API) jobs in the jobs object. If you have specified a single job name, only one job's details will be returned.
317
331
*/
318
332
details: (options: {
319
333
name?: string;
320
-
})=>any;
334
+
})=>object;
321
335
};
322
336
/**
323
337
* Search a Crawlbot crawl job's results
324
-
* @param {Object} options The options
338
+
* @param {object} options The options
325
339
* @param {string} options.name Name of the crawl whose data you wish to download.
326
340
* @param {string} options.query Search query. Must be URL-encoded. Please see query operators: https://www.diffbot.com/dev/docs/search/#query
327
341
* @param {number|string} [options.num] Number of results to return. Default is 20. To return all results in the search, pass num=all.
@@ -336,13 +350,13 @@ declare class Diffbot {
336
350
}): any;
337
351
/**
338
352
* Execute an account API call
339
-
* @param {Object} options The account options
353
+
* @param {object} options The account options
340
354
* @param {number} [options.days] Pass the number of days (&days=365) for which you would like to retrieve API call volumes (default = 31).
341
355
* @param {boolean} [options.invoices] Pass &invoices=true to return invoice and payment history.
0 commit comments