-
Notifications
You must be signed in to change notification settings - Fork 11
/
newsfeed-v2.yaml
377 lines (377 loc) · 12.8 KB
/
newsfeed-v2.yaml
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
---
openapi: 3.0.1
info:
title: Newsfeed & Why is it Moving v2
description: "This REST API returns structured data for news.\n### Best Practices\n\
For optimal performance, we have a few recommendations.\n \n#### Limit query,\
\ improve performance\n \nLimiting the scope of the query will directly improve\
\ the latency of the API. This can be accomplished by using parameters such as\
\ `tickers`, `date`, and `channels`, or (preferably) by using `updatedSince` for\
\ deltas.\n \n#### Using Deltas\n \nA common pattern is to use a delta to query\
\ for the latest change in a dataset. By reducing the amount of data available\
\ in the query, it will produce results with the least amount of latency and limited\
\ data an application will have to traverse.\n \nIn our case, we recommend tracking\
\ and querying by the latest updated timestamp.\n \nOne caveat to allow for some\
\ latency and second-only timestamps: when querying, set `updatedSince` to a value\
\ 5 seconds earlier than you actually want. A query may look like:\n \n`/news?updatedSince=LAGGED_TIMESTAMP`\n\
Where `LAGGED_TIMESTAMP` is set to be five seconds less than the maximum value\
\ of the `updated` field (converted to a Unix timestamp) in rows already pulled\
\ from our API."
version: 2.0.0
servers:
- url: https://api.benzinga.com/api/v2
- url: http://api.benzinga.com/api/v2
security:
- token: []
- Bearer: []
paths:
/news:
get:
summary: Get the news items
parameters:
- name: accept
in: header
description: Specify return format.
required: true
schema:
type: string
default: application/json
enum:
- application/json
- application/xml (deprecated)
- name: page
in: query
description: |-
Page offset.
For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date.
schema:
type: integer
default: 0
- name: pageSize
in: query
description: Number of results returned.
schema:
maximum: 100
type: integer
default: 15
- name: displayOutput
in: query
description: Specify headline only (headline), headline + teaser (abstract),
or headline + full body (full) text
schema:
type: string
default: headline
enum:
- full
- abstract
- headline
- name: date
in: query
description: The date to query for news. Shorthand for date_from and date_to
if they are the same
schema:
type: string
format: yyyy-mm-dd
- name: dateFrom
in: query
description: Date to query from point in time. Sorted by published date
schema:
type: string
format: yyyy-mm-dd
- name: dateTo
in: query
description: Date to query to point in time. Sorted by published date
schema:
type: string
format: yyyy-mm-dd
- name: updatedSince
in: query
description: The last updated Unix timestamp (UTC) to pull and sort by
schema:
type: integer
format: int64
- name: publishedSince
in: query
description: The last published Unix timestamp (UTC) to pull and sort by
schema:
type: integer
format: Unix timestamp
- name: sort
in: query
description: "Allows control of results sorting. Default is created, DESC.\n\
\ \nSort Fields\n * id\n * created\n * updated\n \nSort Order Direction\n\
\ * asc (ascending)\n * desc (descending)"
schema:
type: string
format: field, field:direction
enum:
- id:asc
- id:desc
- created:asc
- created:desc
- updated:asc
- updated:desc
- name: isin
in: query
description: One or more ISINs separated by a comma. Maximum 50.
schema:
type: string
format: csv
- name: cusip
in: query
description: One or more CUSIPs separated by a comma. Maximum 50. License
agreement required.
schema:
type: string
format: csv
- name: tickers
in: query
description: One or more ticker symbols separated by a comma. Maximum 50.
schema:
type: string
format: csv
- name: channels
in: query
description: One or more channel names or IDs separated by a comma
schema:
type: string
format: csv
- name: topics
in: query
description: One or more words/phrases separated by a comma; searches Title,
Tags, and Body in order of priority.
schema:
type: string
format: csv
- name: authors
in: query
description: One or more authors separated by a comma
schema:
type: string
format: csv
- name: content_types
in: query
description: One or more content types separated by a comma
schema:
type: string
format: csv
- name: format
in: query
description: Specify the desired format for the api response.
schema:
type: string
enum:
- text
responses:
200:
description: success
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/BenzingaStory'
/news-removed:
get:
summary: Returns the removed news data
parameters:
- name: accept
in: header
description: Specifies return format. Query parameters work the same for both
formats.
required: true
schema:
type: string
default: application/json
enum:
- application/json
- name: page
in: query
description: |-
Page offset.
For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date.
schema:
type: integer
default: 0
- name: pageSize
in: query
description: Number of results returned.
schema:
maximum: 100
type: integer
default: 15
- name: updatedSince
in: query
description: |-
Filters the results to only include items that have been updated since the specified timestamp.
schema:
type: integer
format: int64
description: UNIX timestamp representing the update time.
responses:
200:
description: success
content:
'*/*':
schema:
type: object
properties:
removed:
type: array
items:
$ref: '#/components/schemas/news-removed'
security:
- token: []
components:
schemas:
BenzingaStory:
type: object
properties:
id:
type: integer
description: The unique identifier of the article. This identifier is also
found in the path of url on benzinga.com.
author:
type: string
description: The author of the article. This could be a Benzinga journalist,
news desk analyst or contributor on benzinga.com.
created:
type: string
description: The moment the article is created. The time zone is Greenwich
Mean Time (GMT) - 4:00, commonly know as Eastern Daylight Time (EDT).
This time stamp will not change. The date format standard used is RFC
2822 / RFC 1123.
format: Wed, 17 May 2017 14:20:15 -0400
updated:
$ref: '#/components/schemas/updated'
title:
type: string
description: The headline of the article. This will only be plain text.
teaser:
type: string
description: Depending on where the content is originated from (Benzinga.com
or Benzinga Pro Terminal) the teaser functions in different ways. If the
article is a full length article from Benzinga.com, where the body field
is filled out, this will be the first sentence of the article up to 256
characters. If this is a Benzinga Pro headline, this will function like
the body of an article and provide additional context to the headline,
usually no more than a few paragraphs. This field can contain html and
html encoded characters such as '"' etc.
body:
type: string
description: The article content. This field can contain html and html encoded
characters such as 'quot' etc.
url:
type: string
description: The url where the article lives on Benzinga.com. If this is
a pro headline, it will take the user to a shortened headline with a paywall
to purchase the Benzinga Pro terminal, so use with caution.
image:
type: array
description: The featured image related to the article, if applicable. Benzinga
Pro headlines will not contain a featured image.
items:
type: object
properties:
size:
type: string
url:
type: string
channels:
type: array
description: "The topic(s) or categories that relate to the article. Channels\
\ can have sub-channels, but they will all be listed as their own item\
\ and not as a sub-level of the array.\n \nFor Why is it Moving (WIIM)\
\ data, enter `WIIM` as channel."
items:
type: object
properties:
name:
type: string
stocks:
type: array
description: The stock symbols that are listed within the article body.
This will not display competitor symbols unless they are specifically
referenced in the article.
items:
type: object
properties:
name:
type: string
tags:
type: array
description: Additional tags that are not channels or categories, but are
reoccuring themes including, but not limited to; analyst names, bills
being talked about in Congress (Dodd-Frank), specific products (iPhone),
politicians, celebrities, stock movements (i.e. 'Mid-day Losers' & 'Mid-day
Gainers').
items:
type: object
properties:
name:
type: string
news-removed:
type: object
properties:
id:
type: integer
description: id of removed news content
updated:
$ref: '#/components/schemas/updated'
updated:
type: string
description: The timestamp of the last update to the article. The time zone
is Greenwich Mean Time (GMT) - 4:00, commonly know as Eastern Daylight Time
(EDT). This time stamp has the ability to change one or many times, updating
each time an update is pushed to the article. The date format standard used
is RFC 2822 / RFC 1123.
format: Wed, 17 May 2017 14:20:15 -0400
parameters:
accept:
name: accept
in: header
description: Specifies return format. Query parameters work the same for both
formats.
required: true
schema:
type: string
default: application/json
enum:
- application/json
page:
name: page
in: query
description: |-
Page offset.
For optimization, performance and technical reasons, page offsets are limited from 0 - 100000. Limit the query results by other parameters such as date.
schema:
type: integer
default: 0
pageSize:
name: pageSize
in: query
description: Number of results returned.
schema:
maximum: 100
type: integer
default: 15
updated:
name: updated
in: query
description: The last updated Unix timestamp (UTC) to pull and sort by
schema:
type: integer
format: int64
updatedSince:
name: updatedSince
in: query
description: The last updated Unix timestamp (UTC) to pull and sort by
schema:
type: integer
format: int64
securitySchemes:
token:
type: apiKey
description: apiKey to be passed as token in query parameter.
name: token
in: query