-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgovernment-trades.yml
274 lines (272 loc) · 8.72 KB
/
government-trades.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
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
---
openapi: 3.0.1
info:
title: Government Trades
description: "This REST API returns structured data for Government Trades - House\
\ & Senate. \n \n### Best Practices\nFor 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 `symbols`, or (preferably) by using `updated` 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 `updated` to a value\
\ 5 seconds earlier than you actually want. A query may look like:\n \n`/government_trades?updated=LAGGED_TIMESTAMP`\n\
Where `LAGGED_TIMESTAMP` is set to be five seconds less than the maximum value\
\ of the `updated` field in rows already pulled from our API."
version: 1.0.0
servers:
- url: https://api.benzinga.com/api/v1/gov/usa/congress
paths:
/trades:
get:
summary: Returns government trades data
parameters:
- name: chamber
in: query
description: Specific chamber of congress, either House or Senate. Defaults
to all of congress.
schema:
type: string
- name: date
in: query
description: Date to query for data. Shorthand for date_from and date_to if
they are the same. Defaults for latest.
schema:
type: string
format: YYYY-MM-DD
- name: date_from
in: query
description: Date to query from point in time.
schema:
type: string
format: YYYY-MM-DD
- name: date_to
in: query
description: Date to query to point in time.
schema:
type: string
format: YYYY-MM-DD
- name: fields
in: query
description: |
A comma (,) separated list of returned fields.
style: form
explode: false
schema:
type: array
items:
type: string
format: array
- name: pagesize
in: query
description: Number of results returned. Limit 1000
schema:
type: integer
default: 50
- name: page
in: query
description: Page offset.
schema:
type: integer
default: 0
- name: search_keys
in: query
description: One or more security symbols separated by a comma. Maximum 50
securities. Security identifiers must be in the format of ticker symbols,
only for US-listed equities.
schema:
type: string
format: csv
- name: updated_since
in: query
description: |
Records last Updated Unix timestamp (UTC). This will force the sort order
to be Greater Than or Equal to the timestamp indicated.
Timestamp may also be in python format to include millisecond updates.
schema:
type: number
format: double
responses:
200:
description: success
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/congress_trades'
security:
- token: []
components:
schemas:
congress_trades:
required:
- created
- id
- security
- updated
type: object
properties:
id:
type: string
description: Unique ID of this signal shared across all signal types
created:
type: string
description: Created timestamp, UTC.
format: double
updated:
type: string
description: Last updated timestamp, UTC.
format: double
ownership:
type: string
description: The members ownership status of the asset traded (SP, JT, DC, Self, None).
security:
type: object
properties:
name:
type: string
description: name of security
ticker:
type: string
description: ticker symbol of security
type:
type: string
description: type of security being traded (STOCK, ETF, MUTUAL, MUNICIPAL,
STOCK OPTION, CORPORATE BOND, OTHER)
description: name, ticker symbol, and type of asset traded
transaction_type:
type: string
description: Represents whether the transaction was a sale (S), partial
sale (S (Partial)) or purchase (P).
transaction_date:
type: string
description: The date the transaction occurred in YYYY-MM-DD format.
notification_date:
type: string
description: The date the Representative claims they received notification
of the transaction occurrence. This is only available for the House.
report_date:
type: string
description: The date the transaction was filed in YYYY-MM-DD format.
amount:
type: string
description: Represents dollar range of transaction or exact dollar amount.
(e.g. $1,001 - $15,000 | $721.63).
chamber:
type: string
description: Either House or Senate.
filer_info:
type: object
properties:
member_name:
type: string
description: Name of Filer.
status:
type: string
description: Whether filer is a Member or Former Member, it is either
one or other.
state:
type: string
description: State that filer oversees (e.g. NY) - (For House Only).
district:
type: string
description: District that filer oversees. (e.g. 06) - (For House Only).
description: Information on filer, this has different keys for House and
Senate.
parameters:
chamber:
name: chamber
in: query
description: Specific chamber of congress, either House or Senate. Defaults
to all of congress.
schema:
type: string
page:
name: page
in: query
description: Page offset.
schema:
type: integer
default: 0
pagesize:
name: pagesize
in: query
description: Number of results returned. Limit 1000
schema:
type: integer
default: 50
date:
name: date
in: query
description: Date to query for data. Shorthand for date_from and date_to if
they are the same. Defaults for latest.
schema:
type: string
format: YYYY-MM-DD
date_from:
name: date_from
in: query
description: Date to query from point in time.
schema:
type: string
format: YYYY-MM-DD
date_to:
name: date_to
in: query
description: Date to query to point in time.
schema:
type: string
format: YYYY-MM-DD
search_keys:
name: search_keys
in: query
description: One or more security symbols separated by a comma. Maximum 50 securities.
Security identifiers must be in the format of ticker symbols, only for US-listed
equities.
schema:
type: string
format: csv
search_keys_type:
name: search_keys_type
in: query
description: The type of identifier being searched. Supported types are currently
a security symbol.
schema:
type: string
default: symbol
enum:
- symbol
updated_since:
name: updated_since
in: query
description: |
Records last Updated Unix timestamp (UTC). This will force the sort order
to be Greater Than or Equal to the timestamp indicated.
Timestamp may also be in python format to include millisecond updates.
schema:
type: number
format: double
fields:
name: fields
in: query
description: |
A comma (,) separated list of returned fields.
style: form
explode: false
schema:
type: array
items:
type: string
format: array
securitySchemes:
token:
type: apiKey
name: token
in: query