forked from Benzinga/doc-site-mintlify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnewsfeed-stream-v1.yml
197 lines (194 loc) · 7.3 KB
/
newsfeed-stream-v1.yml
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
openapi: 3.0.1
info:
title: Newsfeed (Streaming) v1
description: >-
This Websocket API streams Benzinga Newsfeed Content in real-time.
An always-on connection delivers news the instant it becomes available.
Example client implementation available at
https://github.com/Benzinga/websocket-feed-examples.
You may find tools like https://websocketking.com helpful for testing.
version: 1.0.0
servers:
- url: wss://api.benzinga.com/api/v1/news
security:
- token: []
paths:
/stream:
get:
summary: Stream Newsfeed
description: >-
Server will automatically send PING control frames to connected clients,
but does not require a response. Many client libraries will automatically
respond with PONG control frames; this is desirable but not required.
Sending any message over WebSocket to the server other than PING/PONG
control frames will result in immediate disconnection.
responses:
'101':
description: >-
OK, WebSocket connection established and ready. *Note messages are
sent as single messages, not an array, but the documentation spec does
not have support for WebSocket message type.
content:
'*/*':
schema:
$ref: '#/components/schemas/StreamMessage'
application/json:
example:
api_version: websocket/v1
kind: News/v1
data:
action: Created
id: 1234567890
content:
id: 2353787
revision_id: 6421725
type: story
created_at: 2012-02-17T21:01:39.000Z
updated_at: 2020-02-05T11:31:08.000Z
title: Company A reports record earnings in Q1
body: >-
During a Pre-Market earnings announcement Company A
reported ...
authors:
- Scott Rubin
teaser: During a Pre-Market earnings announcement ...
url: >-
https://www.benzinga.com/news/21/05/2353787/company-a-makes-big-moves
tags:
- Earnings
securities:
- symbol: GOOG
exchange: NASDAQ
primary: false
channels:
- News
- Movers & Shakers
timestamp: 2012-02-17T21:01:39.000Z
'401':
description: Unauthorized. Missing or Invalid key.
content: {}
'429':
description: >-
Too Many Connections. A single API key can only have one
simultaneous connection. You may need to back off and try again if
you had a recent disconnection.
content: {}
components:
schemas:
StreamMessage:
required:
- api_version
- data
- kind
type: object
properties:
api_version:
type: string
description: Indicates the message API version. Currently `websocket/v1`.
kind:
type: string
description: Indicates the message data Kind. Currently `News/v1`.
data:
$ref: '#/components/schemas/StreamMessageData'
StreamMessageData:
required:
- action
- id
- timestamp
type: object
properties:
id:
type: integer
description: The unique identifier of the event that triggered the action.
action:
type: string
description: Indicates what type of status change has occurred for this news item.
enum:
- Created
- Updated
- Removed
timestamp:
type: string
description: Indicates event time. (RFC3339Milli)
format: string
content:
$ref: '#/components/schemas/NewsContent'
description: Message payload
NewsContent:
type: object
properties:
id:
type: integer
description: >-
The unique identifier of the article. This identifier is also found
in the path of the URL on Benzinga.com. Does not change when the story is
updated.
revision_id:
type: integer
description: >-
The unique identifier of the article revision. Changes when the story is
updated.
type:
type: string
description: Article type/source. e.g., 'story'.
created_at:
type: string
description: >-
The moment the article is first published. This timestamp will not
change on revisions. (RFC3339Milli)
format: string
updated_at:
type: string
description: >-
The timestamp of the last update to the article. This timestamp is
updated for each revision. (RFC3339Milli)
format: string
title:
type: string
description: >-
The headline of the article. This will only be plain text. May be
updated with revisions.
body:
type: string
description: >-
The article content. This field can contain HTML and HTML encoded
characters such as `&` or `.` etc. You may request plaintext
only with HTML removed, but this may impact formatting/style and
produce results different from what the source intended.
authors:
type: object
properties: {}
description: >-
The authors of the article. This could be a Benzinga journalist,
news desk analyst, or contributor on Benzinga.com.
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.
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.
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. Why Is It Moving (WIIM) data will
be labeled with the `WIIM` channel.
items:
type: string
securities:
type: array
description: >-
The securities that are listed within the article body. This will
not display competitor symbols unless they are specifically