Search for Yahoo Finance Symbols
This package currently provides two ways to get tickers.
- you know the company/security name but are unsure about the ticker use
get_symbols()
- you simply want all tickers listed on the NASDAQ, AMEX, or NYSE use
get_all_symbols()
Structs
The Items returned by get_symbols
YahooSearch
Basically is a custom Array of YahooSearchItem
s returned by get_symbols
.
mutable struct YahooSearch{YahooSearchItem,N} <: AbstractArray{YahooSearchItem,N}
arr::Array{YahooSearchItem,N}
end
YahooSearchItem
This is an individual search item in YahooSearch
. It contains the following fields:
- symbol: The Symbol (Ticker)
- shortname: The short name of the instrument/company
- quoteType: The type of asset (e.g. EQUITY)
- sector: The Sector (only if quotetype==EQUITY, otherwise "")
- industry: The Industry (only if quotetype==EQUITY, otherwise "")
mutable struct YahooSearchItem
symbol::String
shortname::String
exchange::String
quoteType::String
sector::String
industry::String
end
Search Functions
YFinance.get_symbols
— Functionget_symbols(search_term::String)
Allows searches for specific securities.
Arguments
search_term::String
: Typically a company/security name (e.g. microsoft)
Returns
- A
YahooSearch <: AbstractArray
containingYahooSearchItem
s containing the following fields: symbol::String
, shortname::String
, exchange::String
, quoteType::String
, sector::String
, industry::String
Example
julia> get_symbols("micro")
7-element YahooSearch{YahooSearchItem, 1}:
Symbol: MGC=F
Name: Micro Gold Futures,Jun-2023
Type: FUTURE
Exch.: New York Commodity Exchange (CMX)
Symbol: MSFT
Name: Microsoft Corporation
Type: EQUITY
Exch.: NASDAQ (NMS)
Sec.: Technology
Ind.: Software—Infrastructure
Symbol: AMD
Name: Advanced Micro Devices, Inc.
Type: EQUITY
Exch.: NASDAQ (NMS)
Sec.: Technology
Ind.: Semiconductors
Symbol: MU
Name: Micron Technology, Inc.
Type: EQUITY
Exch.: NASDAQ (NMS)
Sec.: Technology
Ind.: Semiconductors
Symbol: MSTR
Name: MicroStrategy Incorporated
Type: EQUITY
Exch.: NASDAQ (NMS)
Sec.: Technology
Ind.: Software—Application
Symbol: SMCI
Name: Super Micro Computer, Inc.
Type: EQUITY
Exch.: NASDAQ (NMS)
Sec.: Technology
Ind.: Computer Hardware
Symbol: FNGU
Name: MicroSectors FANG Index 3X Lev
Type: ETF
Exch.: NYSEArca (PCX)
YFinance.get_all_symbols
— Functionget_all_symbols(market::T)::Vector{T} where {T<:String}
Fetch all the symbols from a given market
.
Arguments
market::String
: The market to fetch the symbols from.
Currently supported markets are:
AMEX
NASDAQ
NYSE
Uses dumbstockapi.com
Returns
Vector{String}
: A vector of strings containing the symbols.
Example
julia> get_all_symbols("NYSE")
3127-element Vector{String}:
"A"
"AA"
"AAC"
"AAN"
⋮
"ZTR"
"ZTS"
"ZUO"
"ZYME"