Download Quote Summary Data
The quote summary item contains tons of different kinds of information. Not all information is available for all tickers. The get_quoteSummary function returns all items available for the ticker.
YFinance.get_quoteSummary
— Functionget_quoteSummary(symbol::String; item=nothing)
Retrievs general information from Yahoo Finance stored in a JSON3 object.
Arguments
smybol
::String
is a ticker (e.g. AAPL for Apple Computers, or ^GSPC for the S&P500)item can either be a string or multiple items as a
Vector
ofStrings
. To see valid items call_QuoteSummary_Items
(not all items are available for all types of securities)throw_error
::Bool
defaults tofalse
. If set to true the function errors when the ticker is not valid. Else a warning is given and an emptyJSON3.Object
is returned.
Examples
julia> get_quoteSummary("AAPL")
JSON3.Object{Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}} with 31 entries:
:assetProfile => {…
:recommendationTrend => {…
:cashflowStatementHistory => {…
⋮ => ⋮
julia> get_quoteSummary("AAPL",item = "quoteType")
JSON3.Object{Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}} with 13 entries:
:exchange => "NMS"
:quoteType => "EQUITY"
:symbol => "AAPL"
⋮ => ⋮
Sub-Items
The below functions can extract certain items from the Yahoo quoteSummary. The functions below return Dictionaries that can readily be piped into a DataFrame.
Calendar Events
YFinance.get_calendar_events
— Functionget_calendar_events(quoteSummary::JSON3.Object)
Retrievs calendar events from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_calendar_events
Dict{String, Any} with 3 entries:
"earnings_dates" => [DateTime("2023-01-25T10:59:00"), DateTime("2023-01-30T12:00:00")]
"dividend_date" => DateTime("2022-11-10T00:00:00")
"exdividend_date" => DateTime("2022-11-04T00:00:00")
julia> get_calendar_events("AAPL")
Dict{String, Any} with 3 entries:
"earnings_dates" => [DateTime("2023-01-25T10:59:00"), DateTime("2023-01-30T12:00:00")]
"dividend_date" => DateTime("2022-11-10T00:00:00")
"exdividend_date" => DateTime("2022-11-04T00:00:00")
julia> using DataFrames
julia> get_calendar_events("AAPL") |> DataFrame
2×3 DataFrame
Row │ dividend_date earnings_dates exdividend_date
│ DateTime DateTime DateTime
─────┼───────────────────────────────────────────────────────────────
1 │ 2022-11-10T00:00:00 2023-01-25T10:59:00 2022-11-04T00:00:00
2 │ 2022-11-10T00:00:00 2023-01-30T12:00:00 2022-11-04T00:00:00
Earnings Estimates
YFinance.get_earnings_estimates
— Functionget_earnings_estimates(quoteSummary::JSON3.Object)
Retrievs the earnings estimates from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_earnings_estimates
Dict{String, Vector} with 3 entries:
"quarter" => ["4Q2021", "1Q2022", "2Q2022", "3Q2022", "4Q2022"]
"estimate" => [1.89, 1.43, 1.16, 1.27, 2.01]
"actual" => Union{Missing, Float64}[2.1, 1.52, 1.2, 1.29, missing]
julia> get_earnings_estimates("AAPL")
Dict{String, Vector} with 3 entries:
"quarter" => ["4Q2021", "1Q2022", "2Q2022", "3Q2022", "4Q2022"]
"estimate" => [1.89, 1.43, 1.16, 1.27, 2.01]
"actual" => Union{Missing, Float64}[2.1, 1.52, 1.2, 1.29, missing]
julia> using DataFrames
julia> get_earnings_estimates("AAPL") |> DataFrame
5×3 DataFrame
Row │ actual estimate quarter
│ Float64? Float64 String
─────┼───────────────────────────────
1 │ 2.1 1.89 4Q2021
2 │ 1.52 1.43 1Q2022
3 │ 1.2 1.16 2Q2022
4 │ 1.29 1.27 3Q2022
5 │ missing 2.01 4Q2022
Earnings Per Share (EPS)
YFinance.get_eps
— Functionget_eps(quoteSummary::JSON3.Object)
Retrievs the earnings per share from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_eps
Dict{String, Vector} with 4 entries:
"surprise" => [0.111, 0.063, 0.034, 0.016]
"quarter" => [DateTime("2021-12-31T00:00:00"), DateTime("2022-03-31T00:00:00"), DateTime("2022-06-30T00:00:00"), DateTime("2022-09-30T00:00:00")]
"estimate" => [1.89, 1.43, 1.16, 1.27]
"actual" => [2.1, 1.52, 1.2, 1.29]
julia> get_eps("AAPL")
Dict{String, Vector} with 4 entries:
"surprise" => [0.111, 0.063, 0.034, 0.016]
"quarter" => [DateTime("2021-12-31T00:00:00"), DateTime("2022-03-31T00:00:00"), DateTime("2022-06-30T00:00:00"), DateTime("2022-09-30T00:00:00")]
"estimate" => [1.89, 1.43, 1.16, 1.27]
"actual" => [2.1, 1.52, 1.2, 1.29]
julia> using DataFrames
julia> get_eps("AAPL") |> DataFrame
4×4 DataFrame
Row │ actual estimate quarter surprise
│ Float64 Float64 DateTime Float64
─────┼──────────────────────────────────────────────────
1 │ 2.1 1.89 2021-12-31T00:00:00 0.111
2 │ 1.52 1.43 2022-03-31T00:00:00 0.063
3 │ 1.2 1.16 2022-06-30T00:00:00 0.034
4 │ 1.29 1.27 2022-09-30T00:00:00 0.016
Insider Holdings
YFinance.get_insider_holders
— Functionget_insider_holders(quoteSummary::JSON3.Object)
Retrievs the insiders holdings from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_insider_holders
Dict{String, Vector} with 8 entries:
"name" => ["ADAMS KATHERINE L", "BELL JAMES A", "JUNG AND…
"lastestTransDate" => Union{Missing, DateTime}[DateTime("2022-10-03T0…
"positionDirect" => Union{Missing, Int64}[427334, 34990, 139594, 31…
"relation" => Union{Missing, String}["General Counsel", "Dire…
"positionIndirect" => Union{Missing, Int64}[missing, missing, missing…
"description" => Union{Missing, String}["Sale", "Stock Gift", "C…
"positionDirectDate" => Union{Missing, DateTime}[DateTime("2022-10-03T0…
"positionIndirectDate" => Union{Missing, DateTime}[missing, missing, miss…
julia> get_insider_holders("AAPL")
Dict{String, Vector} with 8 entries:
"name" => ["ADAMS KATHERINE L", "BELL JAMES A", "JUNG AND…
"lastestTransDate" => Union{Missing, DateTime}[DateTime("2022-10-03T0…
"positionDirect" => Union{Missing, Int64}[427334, 34990, 139594, 31…
"relation" => Union{Missing, String}["General Counsel", "Dire…
"positionIndirect" => Union{Missing, Int64}[missing, missing, missing…
"description" => Union{Missing, String}["Sale", "Stock Gift", "C…
"positionDirectDate" => Union{Missing, DateTime}[DateTime("2022-10-03T0…
"positionIndirectDate" => Union{Missing, DateTime}[missing, missing, miss…
julia> using DataFrames
julia> get_insider_holders("AAPL") |> DataFrame
10×8 DataFrame
Row │ description lastestTransDate name ⋯
│ String? DateTime? String ⋯
─────┼──────────────────────────────────────────────────────────────────────
1 │ Sale 2022-10-03T00:00:00 ADAMS KATHE ⋯
2 │ Stock Gift 2022-05-06T00:00:00 BELL JAMES
3 │ Conversion of Exercise of deriva… 2022-02-01T00:00:00 JUNG ANDREA
4 │ Sale 2022-11-22T00:00:00 KONDO CHRIS
5 │ Sale 2022-02-01T00:00:00 LEVINSON AR ⋯
6 │ Sale 2022-10-28T00:00:00 MAESTRI LUC
7 │ Sale 2022-10-17T00:00:00 O'BRIEN DEI
8 │ Conversion of Exercise of deriva… 2022-02-01T00:00:00 SUGAR RONAL
9 │ Conversion of Exercise of deriva… 2022-02-01T00:00:00 WAGNER SUSA ⋯
10 │ Conversion of Exercise of deriva… 2022-09-30T00:00:00 WILLIAMS JE
6 columns omitted
Insider Transactions
YFinance.get_insider_transactions
— Functionget_insider_transactions(quoteSummary::JSON3.Object)
Retrievs the insider transactions from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_insider_transactions
Dict{String, Vector} with 7 entries:
"shares" => Union{Missing, Int64}[20200, 176299, 8053, 13136, 16…
"filerRelation" => Union{Missing, String}["Officer", "Chief Financial O…
"transactionText" => Union{Missing, String}["Sale at price 148.72 per sha…
"filerName" => ["KONDO CHRISTOPHER", "MAESTRI LUCA", "O'BRIEN DEIRD…
"ownership" => Union{Missing, String}["D", "D", "D", "D", "D", "D",…
"date" => Union{Missing, DateTime}[DateTime("2022-11-22T00:00:…
"value" => Union{Missing, Int64}[3004144, 27493275, 1147150, mi…
julia> get_insider_transactions("AAPL")
Dict{String, Vector} with 7 entries:
"shares" => Union{Missing, Int64}[20200, 176299, 8053, 13136, 16…
"filerRelation" => Union{Missing, String}["Officer", "Chief Financial O…
"transactionText" => Union{Missing, String}["Sale at price 148.72 per sha…
"filerName" => ["KONDO CHRISTOPHER", "MAESTRI LUCA", "O'BRIEN DEIRD…
"ownership" => Union{Missing, String}["D", "D", "D", "D", "D", "D",…
"date" => Union{Missing, DateTime}[DateTime("2022-11-22T00:00:…
"value" => Union{Missing, Int64}[3004144, 27493275, 1147150, mi…
julia> using DataFrames
julia> get_insider_transactions("AAPL") |> DataFrame
75×7 DataFrame
Row │ date filerName filerRelation ⋯
│ DateTime? String String? ⋯
─────┼───────────────────────────────────────────────────────────────────
1 │ 2022-11-22T00:00:00 KONDO CHRISTOPHER Officer ⋯
2 │ 2022-10-28T00:00:00 MAESTRI LUCA Chief Financial Officer
3 │ 2022-10-17T00:00:00 O'BRIEN DEIRDRE Officer
⋮ │ ⋮ ⋮ ⋮ ⋱
73 │ 2021-02-01T00:00:00 LOZANO MONICA C. Director
74 │ 2021-02-01T00:00:00 GORE ALBERT A JR Director ⋯
75 │ 2021-02-01T00:00:00 ADAMS KATHERINE L General Counsel
4 columns and 69 rows omitted
Institutional Ownership
YFinance.get_institutional_ownership
— Functionget_institutional_ownership(quoteSummary::JSON3.Object)
Retrievs the institutional ownership from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_institutional_ownership
Dict{String, Vector} with 6 entries:
"organization" => ["Vanguard Group, Inc. (The)", "Blackrock Inc.", "Be…
"pctChange" => Union{Missing, Float64}[-0.0039, -0.0082, 0.0, -0.01…
"pctHeld" => Union{Missing, Float64}[0.08, 0.0641, 0.0562, 0.0372…
"position" => Union{Missing, Int64}[1272378901, 1020245185, 894802…
"value" => Union{Missing, Int64}[180881389225, 145038059235, 12…
"reportDate" => Union{Missing, DateTime}[DateTime("2022-09-30T00:00:…
julia> get_institutional_ownership("AAPL")
Dict{String, Vector} with 6 entries:
"organization" => ["Vanguard Group, Inc. (The)", "Blackrock Inc.", "Be…
"pctChange" => Union{Missing, Float64}[-0.0039, -0.0082, 0.0, -0.01…
"pctHeld" => Union{Missing, Float64}[0.08, 0.0641, 0.0562, 0.0372…
"position" => Union{Missing, Int64}[1272378901, 1020245185, 894802…
"value" => Union{Missing, Int64}[180881389225, 145038059235, 12…
"reportDate" => Union{Missing, DateTime}[DateTime("2022-09-30T00:00:…
julia> using DataFrames
julia> get_institutional_ownership("AAPL") |> DataFrame
10×6 DataFrame
Row │ organization pctChange pctHeld position ⋯
│ String Float64? Float64? Int64? ⋯
─────┼───────────────────────────────────────────────────────────────────
1 │ Vanguard Group, Inc. (The) -0.0039 0.08 1272378901 ⋯
2 │ Blackrock Inc. -0.0082 0.0641 1020245185
3 │ Berkshire Hathaway, Inc 0.0 0.0562 894802319
⋮ │ ⋮ ⋮ ⋮ ⋮ ⋱
8 │ Morgan Stanley 0.0015 0.0115 182728771
9 │ Northern Trust Corporation -0.0208 0.0111 176084862 ⋯
10 │ Bank of America Corporation -0.0461 0.0089 142260591
2 columns and 4 rows omitted
Major Holders Breakdown
YFinance.get_major_holders_breakdown
— Functionget_major_holders_breakdown(quoteSummary::JSON3.Object)
Retrievs the breakdown of the major holders from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_major_holders_breakdown
Dict{String, Real} with 4 entries:
"institutionsCount" => 5525
"insidersPercentHeld" => 0.00072
"institutionsFloatPercentHeld" => 0.60065
"institutionsPercentHeld" => 0.60021
julia> get_major_holders_breakdown("AAPL")
Dict{String, Real} with 4 entries:
"institutionsCount" => 5525
"insidersPercentHeld" => 0.00072
"institutionsFloatPercentHeld" => 0.60065
"institutionsPercentHeld" => 0.60021
Analyst Recommendation Trend
YFinance.get_recommendation_trend
— Functionget_recommendation_trend(quoteSummary::JSON3.Object)
Retrievs the recommendation trend from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_recommendation_trend
Dict{String, Vector} with 6 entries:
"strongbuy" => [11, 11, 13, 13]
"sell" => [0, 1, 1, 0]
"buy" => [21, 26, 25, 20]
"period" => ["0m", "-1m", "-2m", "-3m"]
"hold" => [6, 5, 6, 8]
"strongsell" => [0, 0, 0, 0]
julia> get_recommendation_trend("AAPL")
Dict{String, Vector} with 6 entries:
"strongbuy" => [11, 11, 13, 13]
"sell" => [0, 1, 1, 0]
"buy" => [21, 26, 25, 20]
"period" => ["0m", "-1m", "-2m", "-3m"]
"hold" => [6, 5, 6, 8]
"strongsell" => [0, 0, 0, 0]
julia> using DataFrames
julia> get_recommendation_trend("AAPL") |> DataFrame
4×6 DataFrame
Row │ buy hold period sell strongbuy strongsell
│ Int64 Int64 String Int64 Int64 Int64
─────┼────────────────────────────────────────────────────
1 │ 21 6 0m 0 11 0
2 │ 26 5 -1m 1 11 0
3 │ 25 6 -2m 1 13 0
4 │ 20 8 -3m 0 13 0
Up- & Downgrade History
YFinance.get_upgrade_downgrade_history
— Functionget_upgrade_downgrade_history(quoteSummary::JSON3.Object)
Retrievs the upgrade and downgrade history from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_upgrade_downgrade_history
Dict{String, Vector} with 5 entries:
"firm" => ["UBS", "Morgan Stanley", "B of A Securities", "Barclay…
"action" => Union{Missing, String}["main", "main", "main", "main", …
"fromGrade" => Union{Missing, String}["", "", "", "", "", "", "", "", …
"date" => Union{Missing, DateTime}[DateTime("2022-11-08T12:17:03"…
"toGrade" => Union{Missing, String}["Buy", "Overweight", "Neutral", …
julia> get_upgrade_downgrade_history("AAPL")
Dict{String, Vector} with 5 entries:
"firm" => ["UBS", "Morgan Stanley", "B of A Securities", "Barclay…
"action" => Union{Missing, String}["main", "main", "main", "main", …
"fromGrade" => Union{Missing, String}["", "", "", "", "", "", "", "", …
"date" => Union{Missing, DateTime}[DateTime("2022-11-08T12:17:03"…
"toGrade" => Union{Missing, String}["Buy", "Overweight", "Neutral", …
julia> using DataFrames
julia> get_upgrade_downgrade_history("AAPL") |> DataFrame
871×5 DataFrame
Row │ action date firm fromGrade toGr ⋯
│ String? DateTime? String String? Stri ⋯
─────┼───────────────────────────────────────────────────────────────────
1 │ main 2022-11-08T12:17:03 UBS Buy ⋯
2 │ main 2022-11-08T12:14:23 Morgan Stanley Over
3 │ main 2022-11-07T13:08:30 B of A Securities Neut
⋮ │ ⋮ ⋮ ⋮ ⋮ ⋱
870 │ main 2012-03-08T07:33:00 FBN Securities Outp
871 │ main 2012-02-09T08:17:00 Canaccord Genuity Buy ⋯
1 column and 866 rows omitted
Summary Detail
YFinance.get_summary_detail
— Functionget_summary_detail(quoteSummary::JSON3.Object)
Retrievs the summaryDetail Item from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_quoteSummary("AAPL") |> get_summary_detail
Dict{String, Any} with 41 entries:
"tradeable" => false
"dayLow" => 140.91
"coinMarketCapLink" => nothing
"priceHint" => 2
"regularMarketPreviousClose" => 142.65
"askSize" => 900
⋮ => ⋮
julia> get_summary_detail("AAPL")
Dict{String, Any} with 41 entries:
"tradeable" => false
"dayLow" => 140.91
"coinMarketCapLink" => nothing
"priceHint" => 2
"regularMarketPreviousClose" => 142.65
"askSize" => 900
⋮ => ⋮
Sector & Industry
YFinance.get_sector_industry
— Functionget_sector_industry(quoteSummary::JSON3.Object)
Retrievs the Sector and Industry from the quote summary.
Arguments
Can be either a JSON3.Object
returned from get_quoteSummary(symbol::String; item=nothing,throw_error=false)
or a ticker symbol of type AbstractString
If a ticker symbol is provided get_quoteSummary(symbol::String)
is called first.
Examples
julia> get_get_quoteSummary("AAPL") |> sector_industry
Dict{String, String} with 2 entries:
"industry" => "Consumer Electronics"
"sector" => "Technology"
julia> get_sector_industry("AAPL")
Dict{String, String} with 2 entries:
"industry" => "Consumer Electronics"
"sector" => "Technology"