google-finance-ruby-client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ require_relative 'errors/symbol_not_found_error'
2
+ require_relative 'errors/symbols_not_found_error'
@@ -0,0 +1,14 @@
1
+ module GoogleFinance
2
+ module Errors
3
+ class SymbolNotFoundError < StandardError
4
+ attr_reader :symbol
5
+ attr_reader :response
6
+
7
+ def initialize(symbol, response)
8
+ @response = response
9
+ @symbol = symbol
10
+ super "Symbol #{symbol} Not Found"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module GoogleFinance
2
+ module Errors
3
+ class SymbolsNotFoundError < StandardError
4
+ attr_reader :symbols
5
+ attr_reader :response
6
+
7
+ def initialize(symbols, response)
8
+ @response = response
9
+ @symbols = symbols
10
+ super "One or More Symbols #{symbols.join(' ')} Not Found"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ module GoogleFinance
2
+ module FaradayMiddleware
3
+ class Preprocessor < ::FaradayMiddleware::ResponseMiddleware
4
+ define_parser do |body, _|
5
+ # JSON starts with \n//, eg. https://finance.google.com/finance/q=MSFT&output=json
6
+ body.gsub /^\n\/\//, ''
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,72 @@
1
+ module GoogleFinance
2
+ class Quote < Resource
3
+ property 'symbol' # symbol name
4
+ property 'reuters_url', from: 'f_reuters_url', with: ->(v) { URI(v) } # detailed information on reuters.com
5
+ property 'exchange' # name of the exchange
6
+ property 'id' # ?
7
+ property 't' # ?
8
+ property 'e' # ?
9
+ property 'name' # company name
10
+ property 'f_recent_quarter_date' # ?
11
+ property 'f_annual_date' # ?
12
+ property 'f_ttm_date' # financial trailing twelve months date?
13
+ property 'financials' # ?
14
+ property 'kr_recent_quarter_date' # ?
15
+ property 'kr_annual_date' # ?
16
+ property 'kr_ttm_date' # ?
17
+ property 'keyratios' # ?
18
+ property 'change', from: 'c', with: ->(v) { v.to_f if v } # change today
19
+ property 'last_trade_price', from: 'l', with: ->(v) { v.to_f if v } # last trade price
20
+ property 'change_in_percent', from: 'cp', with: ->(v) { v.to_f if v } # change in percent
21
+ property 'ccol' # ? eg. chg
22
+ property 'open', from: 'op', with: ->(v) { v.to_f if v } # open
23
+ property 'high', from: 'hi', with: ->(v) { v.to_f if v } # high
24
+ property 'low', from: 'lo', with: ->(v) { v.to_f if v } # low
25
+ property 'volume', from: 'vo' # volume, eg. 25M, TODO: convert to integer
26
+ property 'average_volume', from: 'avvo' # average volume
27
+ property 'high_52_week', from: 'hi52', with: ->(v) { v.to_f if v } # 52 week high
28
+ property 'low_52_week', from: 'lo52', with: ->(v) { v.to_f if v } # 52 week low
29
+ property 'market_capitalization', from: 'mc' # market cap
30
+ property 'price_earnings_ratio', from: 'pe', with: ->(v) { v.to_f if v } # price-earnings ratio
31
+ property 'fwpe' # ?
32
+ property 'beta' # ?
33
+ property 'earnings_per_share', from: 'eps', with: ->(v) { v.to_f if v } # earnings per share
34
+ property 'dy' # ?
35
+ property 'ldiv' # ?
36
+ property 'shares' # ?
37
+ property 'instown' # ?
38
+ property 'eo' # ?
39
+ property 'sid' # ?
40
+ property 'sname' # ?
41
+ property 'iid' # ?
42
+ property 'iname' # ?
43
+ property 'related' # ?
44
+ property 'summary' # ?
45
+ property 'management' # ?
46
+ property 'moreresources' # ?
47
+ property 'events' # ?
48
+
49
+ def change_in_percent_s
50
+ [
51
+ change_in_percent > 0 ? '+' : '',
52
+ format('%.2f', change_in_percent),
53
+ '%'
54
+ ].join
55
+ end
56
+
57
+ def self.get(symbol)
58
+ data = Resources.fetch(q: symbol)
59
+ if data.is_a?(Hash) && data.key?('searchresults')
60
+ if data['searchresults'].size >= 1
61
+ get(data['searchresults'].first['symbol'])
62
+ else
63
+ raise GoogleFinance::Errors::SymbolNotFoundError.new(symbol, data)
64
+ end
65
+ elsif data.is_a?(Array) && data.size == 1
66
+ new data.first
67
+ else
68
+ raise GoogleFinance::Errors::SymbolNotFoundError.new(symbol, data)
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,20 @@
1
+ module GoogleFinance
2
+ class Quotes
3
+ def self.search(*symbols)
4
+ results = Resources.fetch(q: symbols.join(','))
5
+ if results.is_a?(Hash) && results.key?('searchresults')
6
+ searchresults = results['searchresults']
7
+ raise GoogleFinance::Errors::SymbolsNotFoundError.new(symbols, results) if searchresults.empty?
8
+ searchresults.map do |r|
9
+ Quote.get r['ticker']
10
+ end
11
+ elsif results.is_a?(Array)
12
+ results.map do |r|
13
+ Quote.new(r)
14
+ end
15
+ else
16
+ raise GoogleFinance::Errors::SymbolsNotFoundError.new(symbols, results)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ module GoogleFinance
2
+ class Resource < Hashie::Trash
3
+ end
4
+ end
@@ -0,0 +1,28 @@
1
+ module GoogleFinance
2
+ module Resources
3
+ def self.fetch(params = {})
4
+ get(params)
5
+ end
6
+
7
+ def self.get(params)
8
+ connection.get do |c|
9
+ c.params[:output] = :json
10
+ c.params.merge!(params)
11
+ end.body
12
+ end
13
+
14
+ def self.connection
15
+ Faraday.new(
16
+ url: 'https://finance.google.com/finance',
17
+ request: {
18
+ params_encoder: Faraday::FlatParamsEncoder
19
+ }
20
+ ) do |c|
21
+ c.use ::FaradayMiddleware::ParseJson
22
+ c.use GoogleFinance::FaradayMiddleware::Preprocessor
23
+ c.use Faraday::Response::RaiseError
24
+ c.use Faraday::Adapter::NetHttp
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module GoogleFinance
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://finance.google.com/finance?output=json&q=INVALID
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.13.1
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Sun, 03 Dec 2017 00:43:18 GMT
25
+ Expires:
26
+ - Sun, 03 Dec 2017 00:43:18 GMT
27
+ Cache-Control:
28
+ - private, max-age=0
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Disposition:
32
+ - attachment; filename="f.txt"
33
+ P3p:
34
+ - CP="This is not a P3P policy! See g.co/p3phelp for more info."
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ X-Xss-Protection:
38
+ - 1; mode=block
39
+ Server:
40
+ - GSE
41
+ Set-Cookie:
42
+ - NID=118=m94goanXq_5NEeLCYN8U87MrhiUTXf4nrdJlC4ilW6DrtkVpLYj5q5fWmVdXZLdi2MCQvsqNMi5O2iv-sUY_WjFXxeIoW5C9G6Rf8GYaJsheOy3it-Qqw9bf2vpL5YNb;Domain=.google.com;Path=/;Expires=Mon,
43
+ 04-Jun-2018 00:43:18 GMT;HttpOnly
44
+ - SC=RV=:ED=us; expires=Mon, 04-Jun-2018 00:43:18 GMT; path=/finance; domain=.google.com
45
+ Alt-Svc:
46
+ - hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337;
47
+ quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
48
+ Transfer-Encoding:
49
+ - chunked
50
+ body:
51
+ encoding: ASCII-8BIT
52
+ string: |2
53
+
54
+ {
55
+ "start" : "",
56
+ "num" : "",
57
+ "num_company_results" : "0",
58
+ "num_mf_results" : "0",
59
+ "num_all_results" : "",
60
+ "original_query" : "INVALID",
61
+ "query_for_display" : "INVALID",
62
+ "results_type" : "DEFAULT",
63
+ "searchresults" :
64
+ [
65
+ ]
66
+ ,
67
+ "mf_searchresults" :
68
+ [
69
+ ]
70
+ }
71
+ http_version:
72
+ recorded_at: Sun, 03 Dec 2017 00:43:18 GMT
73
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,1030 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://finance.google.com/finance?output=json&q=MSFT
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.13.1
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Sat, 02 Dec 2017 22:21:50 GMT
25
+ Expires:
26
+ - Sat, 02 Dec 2017 22:21:50 GMT
27
+ Cache-Control:
28
+ - private, max-age=0
29
+ X-Content-Type-Options:
30
+ - nosniff
31
+ Content-Disposition:
32
+ - attachment; filename="f.txt"
33
+ P3p:
34
+ - CP="This is not a P3P policy! See g.co/p3phelp for more info."
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ X-Xss-Protection:
38
+ - 1; mode=block
39
+ Server:
40
+ - GSE
41
+ Set-Cookie:
42
+ - NID=118=bumcVQceIZh7w44N_0atytZHws0F2KF07xTsgWb_zpIHjD-Wv8bKnfhodxgGP3qPHm9NxKrZIsn0LrGCHsm4avwZc_g0odpX1cSjFa3W_KFrf5n5Q9O-GUalS26WHPkW;Domain=.google.com;Path=/;Expires=Sun,
43
+ 03-Jun-2018 22:21:50 GMT;HttpOnly
44
+ - SC=RV=358464:ED=us; expires=Sun, 03-Jun-2018 22:21:50 GMT; path=/finance;
45
+ domain=.google.com
46
+ Alt-Svc:
47
+ - hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337;
48
+ quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35"
49
+ Transfer-Encoding:
50
+ - chunked
51
+ body:
52
+ encoding: ASCII-8BIT
53
+ string: |2
54
+
55
+ // [
56
+ {
57
+ "symbol" : "MSFT",
58
+ "exchange" : "NASDAQ",
59
+ "id": "358464",
60
+ "t" : "MSFT",
61
+ "e" : "NASDAQ",
62
+ "name" : "Microsoft Corporation"
63
+ , "f_reuters_url" : "http:\u002F\u002Fstocks.us.reuters.com\u002Fstocks\u002Fratios.asp?rpc=66\u0026symbol=MSFT.O",
64
+ "f_recent_quarter_date" : "Q3 (Sep \u002717)",
65
+ "f_annual_date" : "2017",
66
+ "f_ttm_date" : "2016",
67
+ "financials" :
68
+ [{
69
+ "f_type" : "Income\u0026nbsp\u003BStatement"
70
+ ,"url" : "http://www.google.com/finance?fstype=ii&q=NASDAQ:MSFT"
71
+ ,"f_figures" :
72
+ [
73
+ {
74
+ "title" : ""
75
+ ,"recent_quarter" : "24,538.00"
76
+ ,"annual" : "89,950.00"
77
+ ,"ttm" : "85,320.00"
78
+ },
79
+ {
80
+ "title" : ""
81
+ ,"recent_quarter" : "-"
82
+ ,"annual" : "-"
83
+ ,"ttm" : "-"
84
+ },
85
+ {
86
+ "title" : ""
87
+ ,"recent_quarter" : "24,538.00"
88
+ ,"annual" : "89,950.00"
89
+ ,"ttm" : "85,320.00"
90
+ },
91
+ {
92
+ "title" : ""
93
+ ,"recent_quarter" : "8,278.00"
94
+ ,"annual" : "34,261.00"
95
+ ,"ttm" : "32,780.00"
96
+ },
97
+ {
98
+ "title" : ""
99
+ ,"recent_quarter" : "16,260.00"
100
+ ,"annual" : "55,689.00"
101
+ ,"ttm" : "52,540.00"
102
+ },
103
+ {
104
+ "title" : ""
105
+ ,"recent_quarter" : "4,978.00"
106
+ ,"annual" : "20,020.00"
107
+ ,"ttm" : "19,260.00"
108
+ },
109
+ {
110
+ "title" : ""
111
+ ,"recent_quarter" : "3,574.00"
112
+ ,"annual" : "13,037.00"
113
+ ,"ttm" : "11,988.00"
114
+ },
115
+ {
116
+ "title" : ""
117
+ ,"recent_quarter" : "-"
118
+ ,"annual" : "-"
119
+ ,"ttm" : "-"
120
+ },
121
+ {
122
+ "title" : ""
123
+ ,"recent_quarter" : "-"
124
+ ,"annual" : "-"
125
+ ,"ttm" : "-"
126
+ },
127
+ {
128
+ "title" : ""
129
+ ,"recent_quarter" : "6.00"
130
+ ,"annual" : "361.00"
131
+ ,"ttm" : "1,432.00"
132
+ },
133
+ {
134
+ "title" : ""
135
+ ,"recent_quarter" : "-"
136
+ ,"annual" : "-"
137
+ ,"ttm" : "-"
138
+ },
139
+ {
140
+ "title" : ""
141
+ ,"recent_quarter" : "16,836.00"
142
+ ,"annual" : "67,679.00"
143
+ ,"ttm" : "65,460.00"
144
+ },
145
+ {
146
+ "title" : ""
147
+ ,"recent_quarter" : "7,702.00"
148
+ ,"annual" : "22,271.00"
149
+ ,"ttm" : "19,860.00"
150
+ },
151
+ {
152
+ "title" : ""
153
+ ,"recent_quarter" : "-"
154
+ ,"annual" : "-"
155
+ ,"ttm" : "-"
156
+ },
157
+ {
158
+ "title" : ""
159
+ ,"recent_quarter" : "-"
160
+ ,"annual" : "-"
161
+ ,"ttm" : "-"
162
+ },
163
+ {
164
+ "title" : ""
165
+ ,"recent_quarter" : "-59.00"
166
+ ,"annual" : "-251.00"
167
+ ,"ttm" : "-195.00"
168
+ },
169
+ {
170
+ "title" : ""
171
+ ,"recent_quarter" : "7,984.00"
172
+ ,"annual" : "23,149.00"
173
+ ,"ttm" : "19,751.00"
174
+ },
175
+ {
176
+ "title" : ""
177
+ ,"recent_quarter" : "6,576.00"
178
+ ,"annual" : "21,204.00"
179
+ ,"ttm" : "16,798.00"
180
+ },
181
+ {
182
+ "title" : ""
183
+ ,"recent_quarter" : "-"
184
+ ,"annual" : "-"
185
+ ,"ttm" : "-"
186
+ },
187
+ {
188
+ "title" : ""
189
+ ,"recent_quarter" : "-"
190
+ ,"annual" : "-"
191
+ ,"ttm" : "-"
192
+ },
193
+ {
194
+ "title" : ""
195
+ ,"recent_quarter" : "6,576.00"
196
+ ,"annual" : "21,204.00"
197
+ ,"ttm" : "16,798.00"
198
+ },
199
+ {
200
+ "title" : ""
201
+ ,"recent_quarter" : "-"
202
+ ,"annual" : "-"
203
+ ,"ttm" : "-"
204
+ },
205
+ {
206
+ "title" : ""
207
+ ,"recent_quarter" : "-"
208
+ ,"annual" : "-"
209
+ ,"ttm" : "-"
210
+ },
211
+ {
212
+ "title" : ""
213
+ ,"recent_quarter" : "-"
214
+ ,"annual" : "-"
215
+ ,"ttm" : "-"
216
+ },
217
+ {
218
+ "title" : ""
219
+ ,"recent_quarter" : "6,576.00"
220
+ ,"annual" : "21,204.00"
221
+ ,"ttm" : "16,798.00"
222
+ },
223
+ {
224
+ "title" : ""
225
+ ,"recent_quarter" : "-"
226
+ ,"annual" : "-"
227
+ ,"ttm" : "-"
228
+ },
229
+ {
230
+ "title" : ""
231
+ ,"recent_quarter" : "6,576.00"
232
+ ,"annual" : "21,204.00"
233
+ ,"ttm" : "16,798.00"
234
+ },
235
+ {
236
+ "title" : ""
237
+ ,"recent_quarter" : "6,576.00"
238
+ ,"annual" : "21,204.00"
239
+ ,"ttm" : "16,798.00"
240
+ },
241
+ {
242
+ "title" : ""
243
+ ,"recent_quarter" : "-"
244
+ ,"annual" : "-"
245
+ ,"ttm" : "-"
246
+ },
247
+ {
248
+ "title" : ""
249
+ ,"recent_quarter" : "-"
250
+ ,"annual" : "-"
251
+ ,"ttm" : "-"
252
+ },
253
+ {
254
+ "title" : ""
255
+ ,"recent_quarter" : "-"
256
+ ,"annual" : "-"
257
+ ,"ttm" : "-"
258
+ },
259
+ {
260
+ "title" : ""
261
+ ,"recent_quarter" : "-"
262
+ ,"annual" : "-"
263
+ ,"ttm" : "-"
264
+ },
265
+ {
266
+ "title" : ""
267
+ ,"recent_quarter" : "7,799.00"
268
+ ,"annual" : "7,832.00"
269
+ ,"ttm" : "8,013.00"
270
+ },
271
+ {
272
+ "title" : ""
273
+ ,"recent_quarter" : "0.84"
274
+ ,"annual" : "2.71"
275
+ ,"ttm" : "2.10"
276
+ },
277
+ {
278
+ "title" : ""
279
+ ,"recent_quarter" : "-"
280
+ ,"annual" : "-"
281
+ ,"ttm" : "-"
282
+ },
283
+ {
284
+ "title" : ""
285
+ ,"recent_quarter" : "0.39"
286
+ ,"annual" : "1.53"
287
+ ,"ttm" : "1.39"
288
+ },
289
+ {
290
+ "title" : ""
291
+ ,"recent_quarter" : "-"
292
+ ,"annual" : "-"
293
+ ,"ttm" : "-"
294
+ },
295
+ {
296
+ "title" : ""
297
+ ,"recent_quarter" : "-"
298
+ ,"annual" : "-"
299
+ ,"ttm" : "-"
300
+ },
301
+ {
302
+ "title" : ""
303
+ ,"recent_quarter" : "-"
304
+ ,"annual" : "-"
305
+ ,"ttm" : "-"
306
+ },
307
+ {
308
+ "title" : ""
309
+ ,"recent_quarter" : "-"
310
+ ,"annual" : "-"
311
+ ,"ttm" : "-"
312
+ },
313
+ {
314
+ "title" : ""
315
+ ,"recent_quarter" : "-"
316
+ ,"annual" : "-"
317
+ ,"ttm" : "-"
318
+ },
319
+ {
320
+ "title" : ""
321
+ ,"recent_quarter" : "-"
322
+ ,"annual" : "-"
323
+ ,"ttm" : "-"
324
+ },
325
+ {
326
+ "title" : ""
327
+ ,"recent_quarter" : "-"
328
+ ,"annual" : "-"
329
+ ,"ttm" : "-"
330
+ },
331
+ {
332
+ "title" : ""
333
+ ,"recent_quarter" : "-"
334
+ ,"annual" : "-"
335
+ ,"ttm" : "-"
336
+ },
337
+ {
338
+ "title" : ""
339
+ ,"recent_quarter" : "-"
340
+ ,"annual" : "-"
341
+ ,"ttm" : "-"
342
+ },
343
+ {
344
+ "title" : ""
345
+ ,"recent_quarter" : "-"
346
+ ,"annual" : "-"
347
+ ,"ttm" : "-"
348
+ },
349
+ {
350
+ "title" : ""
351
+ ,"recent_quarter" : "-"
352
+ ,"annual" : "-"
353
+ ,"ttm" : "-"
354
+ },
355
+ {
356
+ "title" : ""
357
+ ,"recent_quarter" : "-"
358
+ ,"annual" : "-"
359
+ ,"ttm" : "-"
360
+ },
361
+ {
362
+ "title" : ""
363
+ ,"recent_quarter" : "0.84"
364
+ ,"annual" : "2.75"
365
+ ,"ttm" : "2.25"
366
+ }
367
+ ]
368
+ },
369
+ {
370
+ "f_type" : "Balance\u0026nbsp\u003BSheet"
371
+ ,"url" : "http://www.google.com/finance?fstype=bi&q=NASDAQ:MSFT"
372
+ ,"f_figures" :
373
+ [
374
+ {
375
+ "title" : ""
376
+ ,"recent_quarter" : "6,884.00"
377
+ ,"annual" : "7,663.00"
378
+ ,"ttm" : "6,510.00"
379
+ },
380
+ {
381
+ "title" : ""
382
+ ,"recent_quarter" : "131,506.00"
383
+ ,"annual" : "125,238.00"
384
+ ,"ttm" : "106,729.00"
385
+ },
386
+ {
387
+ "title" : ""
388
+ ,"recent_quarter" : "138,390.00"
389
+ ,"annual" : "132,901.00"
390
+ ,"ttm" : "113,239.00"
391
+ },
392
+ {
393
+ "title" : ""
394
+ ,"recent_quarter" : "14,561.00"
395
+ ,"annual" : "22,431.00"
396
+ ,"ttm" : "18,277.00"
397
+ },
398
+ {
399
+ "title" : ""
400
+ ,"recent_quarter" : "-"
401
+ ,"annual" : "-"
402
+ ,"ttm" : "-"
403
+ },
404
+ {
405
+ "title" : ""
406
+ ,"recent_quarter" : "14,561.00"
407
+ ,"annual" : "22,431.00"
408
+ ,"ttm" : "18,277.00"
409
+ },
410
+ {
411
+ "title" : ""
412
+ ,"recent_quarter" : "3,211.00"
413
+ ,"annual" : "2,181.00"
414
+ ,"ttm" : "2,251.00"
415
+ },
416
+ {
417
+ "title" : ""
418
+ ,"recent_quarter" : "-"
419
+ ,"annual" : "-"
420
+ ,"ttm" : "-"
421
+ },
422
+ {
423
+ "title" : ""
424
+ ,"recent_quarter" : "4,869.00"
425
+ ,"annual" : "5,183.00"
426
+ ,"ttm" : "5,893.00"
427
+ },
428
+ {
429
+ "title" : ""
430
+ ,"recent_quarter" : "161,031.00"
431
+ ,"annual" : "162,696.00"
432
+ ,"ttm" : "139,660.00"
433
+ },
434
+ {
435
+ "title" : ""
436
+ ,"recent_quarter" : "50,332.00"
437
+ ,"annual" : "47,913.00"
438
+ ,"ttm" : "-"
439
+ },
440
+ {
441
+ "title" : ""
442
+ ,"recent_quarter" : "-25,523.00"
443
+ ,"annual" : "-24,179.00"
444
+ ,"ttm" : "-"
445
+ },
446
+ {
447
+ "title" : ""
448
+ ,"recent_quarter" : "35,389.00"
449
+ ,"annual" : "35,122.00"
450
+ ,"ttm" : "17,872.00"
451
+ },
452
+ {
453
+ "title" : ""
454
+ ,"recent_quarter" : "16,442.00"
455
+ ,"annual" : "16,661.00"
456
+ ,"ttm" : "3,733.00"
457
+ },
458
+ {
459
+ "title" : ""
460
+ ,"recent_quarter" : "5,320.00"
461
+ ,"annual" : "5,956.00"
462
+ ,"ttm" : "10,413.00"
463
+ },
464
+ {
465
+ "title" : ""
466
+ ,"recent_quarter" : "6,106.00"
467
+ ,"annual" : "6,143.00"
468
+ ,"ttm" : "3,434.00"
469
+ },
470
+ {
471
+ "title" : ""
472
+ ,"recent_quarter" : "249,097.00"
473
+ ,"annual" : "250,312.00"
474
+ ,"ttm" : "193,468.00"
475
+ },
476
+ {
477
+ "title" : ""
478
+ ,"recent_quarter" : "6,866.00"
479
+ ,"annual" : "7,390.00"
480
+ ,"ttm" : "6,898.00"
481
+ },
482
+ {
483
+ "title" : ""
484
+ ,"recent_quarter" : "4,108.00"
485
+ ,"annual" : "5,819.00"
486
+ ,"ttm" : "5,264.00"
487
+ },
488
+ {
489
+ "title" : ""
490
+ ,"recent_quarter" : "8,170.00"
491
+ ,"annual" : "9,072.00"
492
+ ,"ttm" : "12,904.00"
493
+ },
494
+ {
495
+ "title" : ""
496
+ ,"recent_quarter" : "1,050.00"
497
+ ,"annual" : "1,049.00"
498
+ ,"ttm" : "-"
499
+ },
500
+ {
501
+ "title" : ""
502
+ ,"recent_quarter" : "31,421.00"
503
+ ,"annual" : "32,415.00"
504
+ ,"ttm" : "34,291.00"
505
+ },
506
+ {
507
+ "title" : ""
508
+ ,"recent_quarter" : "51,615.00"
509
+ ,"annual" : "55,745.00"
510
+ ,"ttm" : "59,357.00"
511
+ },
512
+ {
513
+ "title" : ""
514
+ ,"recent_quarter" : "76,255.00"
515
+ ,"annual" : "76,073.00"
516
+ ,"ttm" : "40,557.00"
517
+ },
518
+ {
519
+ "title" : ""
520
+ ,"recent_quarter" : "-"
521
+ ,"annual" : "-"
522
+ ,"ttm" : "-"
523
+ },
524
+ {
525
+ "title" : ""
526
+ ,"recent_quarter" : "76,255.00"
527
+ ,"annual" : "76,073.00"
528
+ ,"ttm" : "40,557.00"
529
+ },
530
+ {
531
+ "title" : ""
532
+ ,"recent_quarter" : "85,475.00"
533
+ ,"annual" : "86,194.00"
534
+ ,"ttm" : "53,461.00"
535
+ },
536
+ {
537
+ "title" : ""
538
+ ,"recent_quarter" : "5,513.00"
539
+ ,"annual" : "5,734.00"
540
+ ,"ttm" : "1,476.00"
541
+ },
542
+ {
543
+ "title" : ""
544
+ ,"recent_quarter" : "-"
545
+ ,"annual" : "-"
546
+ ,"ttm" : "-"
547
+ },
548
+ {
549
+ "title" : ""
550
+ ,"recent_quarter" : "26,067.00"
551
+ ,"annual" : "25,049.00"
552
+ ,"ttm" : "20,081.00"
553
+ },
554
+ {
555
+ "title" : ""
556
+ ,"recent_quarter" : "159,450.00"
557
+ ,"annual" : "162,601.00"
558
+ ,"ttm" : "121,471.00"
559
+ },
560
+ {
561
+ "title" : ""
562
+ ,"recent_quarter" : "-"
563
+ ,"annual" : "-"
564
+ ,"ttm" : "-"
565
+ },
566
+ {
567
+ "title" : ""
568
+ ,"recent_quarter" : "-"
569
+ ,"annual" : "-"
570
+ ,"ttm" : "-"
571
+ },
572
+ {
573
+ "title" : ""
574
+ ,"recent_quarter" : "69,419.00"
575
+ ,"annual" : "69,315.00"
576
+ ,"ttm" : "68,178.00"
577
+ },
578
+ {
579
+ "title" : ""
580
+ ,"recent_quarter" : "-"
581
+ ,"annual" : "-"
582
+ ,"ttm" : "-"
583
+ },
584
+ {
585
+ "title" : ""
586
+ ,"recent_quarter" : "19,702.00"
587
+ ,"annual" : "17,769.00"
588
+ ,"ttm" : "2,282.00"
589
+ },
590
+ {
591
+ "title" : ""
592
+ ,"recent_quarter" : "-"
593
+ ,"annual" : "-"
594
+ ,"ttm" : "-"
595
+ },
596
+ {
597
+ "title" : ""
598
+ ,"recent_quarter" : "-1,011.00"
599
+ ,"annual" : "627.00"
600
+ ,"ttm" : "1,537.00"
601
+ },
602
+ {
603
+ "title" : ""
604
+ ,"recent_quarter" : "89,647.00"
605
+ ,"annual" : "87,711.00"
606
+ ,"ttm" : "71,997.00"
607
+ },
608
+ {
609
+ "title" : ""
610
+ ,"recent_quarter" : "249,097.00"
611
+ ,"annual" : "250,312.00"
612
+ ,"ttm" : "193,468.00"
613
+ },
614
+ {
615
+ "title" : ""
616
+ ,"recent_quarter" : "-"
617
+ ,"annual" : "-"
618
+ ,"ttm" : "-"
619
+ },
620
+ {
621
+ "title" : ""
622
+ ,"recent_quarter" : "7,720.00"
623
+ ,"annual" : "7,708.00"
624
+ ,"ttm" : "7,808.00"
625
+ }
626
+ ]
627
+ },
628
+ {
629
+ "f_type" : "Cash\u0026nbsp\u003BFlow"
630
+ ,"url" : "http://www.google.com/finance?fstype=ci&q=NASDAQ:MSFT"
631
+ ,"f_figures" :
632
+ [
633
+ {
634
+ "title" : ""
635
+ ,"recent_quarter" : "6,576.00"
636
+ ,"annual" : "21,204.00"
637
+ ,"ttm" : "16,798.00"
638
+ },
639
+ {
640
+ "title" : ""
641
+ ,"recent_quarter" : "2,499.00"
642
+ ,"annual" : "8,778.00"
643
+ ,"ttm" : "6,622.00"
644
+ },
645
+ {
646
+ "title" : ""
647
+ ,"recent_quarter" : "-"
648
+ ,"annual" : "-"
649
+ ,"ttm" : "-"
650
+ },
651
+ {
652
+ "title" : ""
653
+ ,"recent_quarter" : "-53.00"
654
+ ,"annual" : "-3,296.00"
655
+ ,"ttm" : "332.00"
656
+ },
657
+ {
658
+ "title" : ""
659
+ ,"recent_quarter" : "450.00"
660
+ ,"annual" : "11,169.00"
661
+ ,"ttm" : "11,649.00"
662
+ },
663
+ {
664
+ "title" : ""
665
+ ,"recent_quarter" : "2,968.00"
666
+ ,"annual" : "1,652.00"
667
+ ,"ttm" : "-2,076.00"
668
+ },
669
+ {
670
+ "title" : ""
671
+ ,"recent_quarter" : "12,440.00"
672
+ ,"annual" : "39,507.00"
673
+ ,"ttm" : "33,325.00"
674
+ },
675
+ {
676
+ "title" : ""
677
+ ,"recent_quarter" : "-2,132.00"
678
+ ,"annual" : "-8,129.00"
679
+ ,"ttm" : "-8,343.00"
680
+ },
681
+ {
682
+ "title" : ""
683
+ ,"recent_quarter" : "-4,772.00"
684
+ ,"annual" : "-38,652.00"
685
+ ,"ttm" : "-15,607.00"
686
+ },
687
+ {
688
+ "title" : ""
689
+ ,"recent_quarter" : "-6,904.00"
690
+ ,"annual" : "-46,781.00"
691
+ ,"ttm" : "-23,950.00"
692
+ },
693
+ {
694
+ "title" : ""
695
+ ,"recent_quarter" : "-150.00"
696
+ ,"annual" : "-190.00"
697
+ ,"ttm" : "-369.00"
698
+ },
699
+ {
700
+ "title" : ""
701
+ ,"recent_quarter" : "-3,003.00"
702
+ ,"annual" : "-11,845.00"
703
+ ,"ttm" : "-11,006.00"
704
+ },
705
+ {
706
+ "title" : ""
707
+ ,"recent_quarter" : "-2,263.00"
708
+ ,"annual" : "-11,016.00"
709
+ ,"ttm" : "-15,301.00"
710
+ },
711
+ {
712
+ "title" : ""
713
+ ,"recent_quarter" : "-925.00"
714
+ ,"annual" : "31,459.00"
715
+ ,"ttm" : "18,283.00"
716
+ },
717
+ {
718
+ "title" : ""
719
+ ,"recent_quarter" : "-6,341.00"
720
+ ,"annual" : "8,408.00"
721
+ ,"ttm" : "-8,393.00"
722
+ },
723
+ {
724
+ "title" : ""
725
+ ,"recent_quarter" : "26.00"
726
+ ,"annual" : "19.00"
727
+ ,"ttm" : "-67.00"
728
+ },
729
+ {
730
+ "title" : ""
731
+ ,"recent_quarter" : "-779.00"
732
+ ,"annual" : "1,153.00"
733
+ ,"ttm" : "915.00"
734
+ },
735
+ {
736
+ "title" : ""
737
+ ,"recent_quarter" : "-"
738
+ ,"annual" : "1,600.00"
739
+ ,"ttm" : "1,100.00"
740
+ },
741
+ {
742
+ "title" : ""
743
+ ,"recent_quarter" : "-"
744
+ ,"annual" : "2,400.00"
745
+ ,"ttm" : "3,900.00"
746
+ }
747
+ ]
748
+ }],
749
+ "kr_recent_quarter_date" : "Q3 (Sep \u002717)",
750
+ "kr_annual_date" : "2017",
751
+ "kr_ttm_date" : "TTM",
752
+ "keyratios" :
753
+ [
754
+ {
755
+ "title" : "Net profit margin",
756
+ "recent_quarter" : "26.80%",
757
+ "annual" : "23.57%",
758
+ "ttm" : "24.55%"
759
+ },
760
+ {
761
+ "title" : "Operating margin",
762
+ "recent_quarter" : "31.39%",
763
+ "annual" : "24.76%",
764
+ "ttm" : "26.34%"
765
+ },
766
+ {
767
+ "title" : "EBITD margin",
768
+ "recent_quarter" : "",
769
+ "annual" : "34.92%",
770
+ "ttm" : "36.77%"
771
+ },
772
+ {
773
+ "title" : "Return on average assets",
774
+ "recent_quarter" : "10.56%",
775
+ "annual" : "9.56%",
776
+ "ttm" : "10.00%"
777
+ },
778
+ {
779
+ "title" : "Return on average equity",
780
+ "recent_quarter" : "29.74%",
781
+ "annual" : "26.55%",
782
+ "ttm" : "28.86%"
783
+ },
784
+ {
785
+ "title" : "Employees",
786
+ "recent_quarter" : "124,000",
787
+ "annual" : "-",
788
+ "ttm" : "-"
789
+ }
790
+ ]
791
+ , "c" : "+0.09",
792
+ "l" : "84.26",
793
+ "cp" : "0.11",
794
+ "ccol" : "chg",
795
+ "op" : "83.60",
796
+ "hi" : "84.81",
797
+ "lo" : "83.22",
798
+ "vo" : "29.53M",
799
+ "avvo" : "22.68M",
800
+ "hi52" : "86.20",
801
+ "lo52" : "58.80",
802
+ "mc" : "650.73B",
803
+ "pe" : "28.51",
804
+ "fwpe" : "",
805
+ "beta" : "1.01",
806
+ "eps" : "2.96",
807
+ "dy" : "1.99",
808
+ "ldiv" : "0.42",
809
+ "shares" : "7.71B",
810
+ "instown" : "76%",
811
+ "eo":""
812
+ , "sid" : "us-TRBC:57",
813
+ "sname" : "Technology",
814
+ "iid" : "us-TRBC:5720102010",
815
+ "iname" : "Software - NEC"
816
+ , "related" : [
817
+ {
818
+ "id" : "358464",
819
+ "name" : "Microsoft Corporation",
820
+ "t" : "MSFT",
821
+ "e" : "NASDAQ",
822
+ "l" : "84.26",
823
+ "c" : "+0.09",
824
+ "mc" : "650.73B",
825
+ "cp" : "0.11",
826
+ "ccol" : "chg"
827
+ }
828
+ ,
829
+ {
830
+ "id" : "662102",
831
+ "name" : "SAP SE (ADR)",
832
+ "t" : "SAP",
833
+ "e" : "NYSE",
834
+ "l" : "111.78",
835
+ "c" : "-1.57",
836
+ "mc" : "136.48B",
837
+ "cp" : "-1.39",
838
+ "ccol" : "chr"
839
+ }
840
+ ,
841
+ {
842
+ "id" : "14135",
843
+ "name" : "General Electric Company",
844
+ "t" : "GE",
845
+ "e" : "NYSE",
846
+ "l" : "17.88",
847
+ "c" : "-0.41",
848
+ "mc" : "151.58B",
849
+ "cp" : "-2.24",
850
+ "ccol" : "chr"
851
+ }
852
+ ,
853
+ {
854
+ "id" : "4112",
855
+ "name" : "Adobe Systems Incorporated",
856
+ "t" : "ADBE",
857
+ "e" : "NASDAQ",
858
+ "l" : "179.52",
859
+ "c" : "-1.95",
860
+ "mc" : "87.54B",
861
+ "cp" : "-1.07",
862
+ "ccol" : "chr"
863
+ }
864
+ ,
865
+ {
866
+ "id" : "17154",
867
+ "name" : "HP Inc",
868
+ "t" : "HPQ",
869
+ "e" : "NYSE",
870
+ "l" : "21.41",
871
+ "c" : "-0.04",
872
+ "mc" : "35.69B",
873
+ "cp" : "-0.19",
874
+ "ccol" : "chr"
875
+ }
876
+ ,
877
+ {
878
+ "id" : "663462",
879
+ "name" : "Red Hat Inc",
880
+ "t" : "RHT",
881
+ "e" : "NYSE",
882
+ "l" : "125.26",
883
+ "c" : "-1.50",
884
+ "mc" : "22.16B",
885
+ "cp" : "-1.18",
886
+ "ccol" : "chr"
887
+ }
888
+ ,
889
+ {
890
+ "id" : "420424055286581",
891
+ "name" : "Dell Technologies Inc",
892
+ "t" : "DVMT",
893
+ "e" : "NYSE",
894
+ "l" : "79.96",
895
+ "c" : "+1.72",
896
+ "mc" : "16.24B",
897
+ "cp" : "2.20",
898
+ "ccol" : "chg"
899
+ }
900
+ ,
901
+ {
902
+ "id" : "664887",
903
+ "name" : "Verizon Communications Inc.",
904
+ "t" : "VZ",
905
+ "e" : "NYSE",
906
+ "l" : "51.25",
907
+ "c" : "+0.36",
908
+ "mc" : "209.07B",
909
+ "cp" : "0.71",
910
+ "ccol" : "chg"
911
+ }
912
+ ,
913
+ {
914
+ "id" : "18241",
915
+ "name" : "International Business Machines Corp.",
916
+ "t" : "IBM",
917
+ "e" : "NYSE",
918
+ "l" : "154.76",
919
+ "c" : "+0.79",
920
+ "mc" : "144.01B",
921
+ "cp" : "0.51",
922
+ "ccol" : "chg"
923
+ }
924
+ ,
925
+ {
926
+ "id" : "419344",
927
+ "name" : "Oracle Corporation",
928
+ "t" : "ORCL",
929
+ "e" : "NYSE",
930
+ "l" : "49.61",
931
+ "c" : "+0.55",
932
+ "mc" : "209.37B",
933
+ "cp" : "1.12",
934
+ "ccol" : "chg"
935
+ }
936
+ ,
937
+ {
938
+ "id" : "531834042473910",
939
+ "name" : "GoPro Inc",
940
+ "t" : "GPRO",
941
+ "e" : "NASDAQ",
942
+ "l" : "8.51",
943
+ "c" : "-0.03",
944
+ "mc" : "1.24B",
945
+ "cp" : "-0.35",
946
+ "ccol" : "chr"
947
+ }
948
+ ]
949
+ , "summary" : [{
950
+ "reuters_url" : "http:\u002F\u002Fstocks.us.reuters.com\u002Fstocks\u002FfullDescription.asp?rpc=66\u0026symbol=MSFT.O",
951
+ "address": "1 Microsoft Way, REDMOND, WA 98052-6399, United States",
952
+ "phone": "+1-425-8828080",
953
+ "fax": "+1-425-7067329",
954
+ "url": "https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002F",
955
+ "overview" : "Microsoft Corporation is a technology company. The Company develops, licenses, and supports a range of software products, services and devices. The Company\u0027s segments include Productivity and Business Processes, Intelligent Cloud and More Personal Computing. The Company\u0027s products include operating systems\u003B cross-device productivity applications\u003B server applications\u003B business solution applications\u003B desktop and server management tools\u003B software development tools\u003B video games, and training and certification of computer system integrators and developers. It also designs, manufactures, and sells devices, including personal computers (PCs), tablets, gaming and entertainment consoles, phones, other intelligent devices, and related accessories, that integrate with its cloud-based offerings. It offers an array of services, including cloud-based solutions that provide customers with software, services, platforms, and content, and it provides solution support and consulting services."
956
+ } ]
957
+ , "management" : [
958
+ {
959
+ "name" : "Bradford Lee Smith",
960
+ "age" : "58",
961
+ "title" : "President, Chief Legal Officer"
962
+ }
963
+ ,
964
+ {
965
+ "name" : "Satya Nadella",
966
+ "age" : "50",
967
+ "title" : "Chief Executive Officer, Director"
968
+ }
969
+ ,
970
+ {
971
+ "name" : "William Henry Gates III",
972
+ "age" : "61",
973
+ "title" : "Co-Founder and Technology Advisor, Director"
974
+ }
975
+ ,
976
+ {
977
+ "name" : "Amy E. Hood",
978
+ "age" : "45",
979
+ "title" : "Chief Financial Officer, Executive Vice President"
980
+ }
981
+ ,
982
+ {
983
+ "name" : "Christopher C. Capossela",
984
+ "age" : "47",
985
+ "title" : "Executive Vice President, Marketing and Consumer Business, and Chief Marketing Officer"
986
+ }
987
+ ,
988
+ {
989
+ "name" : "Kathleen T. Hogan",
990
+ "age" : "51",
991
+ "title" : "Executive Vice President - Human Resources"
992
+ }
993
+ ,
994
+ {
995
+ "name" : "Jean-Philippe Courtois",
996
+ "age" : "56",
997
+ "title" : "Executive Vice President and President - Microsoft Global Sales, Marketing and Operations"
998
+ }
999
+ ,
1000
+ {
1001
+ "name" : "Margaret L. Johnson",
1002
+ "age" : "55",
1003
+ "title" : "Executive Vice President - Business Development"
1004
+ }
1005
+ ,
1006
+ {
1007
+ "name" : "Kevin Scott",
1008
+ "title" : "Chief Technology Officer"
1009
+ }
1010
+ ,
1011
+ {
1012
+ "name" : "John Wendell Thompson",
1013
+ "age" : "68",
1014
+ "title" : "Independent Non-Executive Chairman of the Board"
1015
+ }
1016
+ ]
1017
+ ,"moreresources" : [
1018
+ { "name" : "Estimates" , "url" : "http:\u002F\u002Fwww.marketwatch.com\u002Ftools\u002Fquotes\u002Fsnapshot.asp?symb=MSFT\u0026pg=analyst"},
1019
+ { "name" : "SEC Filings" , "url" : "http:\u002F\u002Fgoogle.brand.edgar-online.com\u002F?sym=MSFT"},
1020
+ { "name" : "Major Holders" , "url" : "http:\u002F\u002Finvesting.money.msn.com\u002Finvestments\u002Finstitutional-ownership?symbol=MSFT"}
1021
+ ,
1022
+ { "name" : "Options" , "url" : "http:\u002F\u002Fwww.marketwatch.com\u002Ftools\u002Fquotes\u002Foptions1.asp?symb=MSFT"},
1023
+ { "name" : "Research" , "url" : "http:\u002F\u002Ffinance.yahoo.com\u002Fq\u002Frr?s=MSFT"}
1024
+ ]
1025
+ , "events" : [
1026
+ ]
1027
+ }]
1028
+ http_version:
1029
+ recorded_at: Sat, 02 Dec 2017 22:21:50 GMT
1030
+ recorded_with: VCR 3.0.3