Documentation
¶
Index ¶
- Constants
- func DailyFundamentalUrl(ticker string, startDate, endDate time.Time, sort Sort, respFormat Format) string
- func EodMetadataUrl(ticker string, respFormat Format) string
- func EodPriceUrl(ticker string, startDate, endDate time.Time, resampleFreq EodFreq, sort Sort, ...) string
- func FundamentalMetadataUrl(tickers []string, respFormat Format) string
- func IexHistoryUrl(ticker string, startDate, endDate time.Time, resampleFreq IexFreq, ...) string
- func IexTopOfBookUrl(tickers []string, respFormat Format) string
- func SearchUrl(query string, exactTickerMatch, includeDelisted bool, limit int, ...) string
- func StmtDataUrl(ticker string, asReported bool, startDate, endDate time.Time, sort Sort, ...) string
- func StmtDefsUrl(tickers []string, respFormat Format) string
- type Client
- func (c *Client) DailyFundamental(ctx context.Context, ticker string, startDate, endDate time.Time, sort Sort, ...) ([]byte, error)
- func (c *Client) DefaultDailyFundamental(ctx context.Context, ticker string) ([]byte, error)
- func (c *Client) DefaultEodMetadata(ctx context.Context, symbol string) ([]byte, error)
- func (c *Client) DefaultEodPrice(ctx context.Context, symbol string) ([]byte, error)
- func (c *Client) DefaultFundamentalMetadata(ctx context.Context) ([]byte, error)
- func (c *Client) DefaultIexHistory(ctx context.Context, ticker string) ([]byte, error)
- func (c *Client) DefaultIexTopOfBook(ctx context.Context) ([]byte, error)
- func (c *Client) DefaultSearch(ctx context.Context, query string) ([]byte, error)
- func (c *Client) DefaultStmtData(ctx context.Context, ticker string) ([]byte, error)
- func (c *Client) DefaultStmtDefs(ctx context.Context) ([]byte, error)
- func (c *Client) DefaultSymbolList(ctx context.Context) ([]byte, error)
- func (c *Client) EodMetadata(ctx context.Context, ticker string, respFormat Format) ([]byte, error)
- func (c *Client) EodPrice(ctx context.Context, ticker string, startDate, endDate time.Time, ...) ([]byte, error)
- func (c *Client) FilteredSymbolList(ctx context.Context, f SymbolFilterFunc) ([]SymbolItem, error)
- func (c *Client) FundamentalMetadata(ctx context.Context, tickers []string, respFormat Format) ([]byte, error)
- func (c *Client) IexHistory(ctx context.Context, ticker string, startDate, endDate time.Time, ...) ([]byte, error)
- func (c *Client) IexTopOfBook(ctx context.Context, tickers []string, respFormat Format) ([]byte, error)
- func (c *Client) Search(ctx context.Context, query string, exactMatch, includeDelisted bool, limit int, ...) ([]byte, error)
- func (c *Client) StmtData(ctx context.Context, ticker string, asReported bool, ...) ([]byte, error)
- func (c *Client) StmtDefs(ctx context.Context, tickers []string, respFormat Format) ([]byte, error)
- type DailyFundamental
- type EodFreq
- type EodMetadata
- type EodPrice
- type Format
- type FundamentalMetadata
- type IexFreq
- type IexPrice
- type IexTopOfBook
- type Limiter
- type SearchResult
- type Sort
- type StmtDataField
- type StmtDataFlat
- type StmtDataNested
- type StmtDef
- type SymbolFilterFunc
- type SymbolItem
Constants ¶
const ( JSON Format = "json" CSV Format = "csv" Daily EodFreq = "daily" Weekly EodFreq = "weekly" Monthly EodFreq = "monthly" Annually EodFreq = "annually" OneMin IexFreq = "1min" FiveMin IexFreq = "5min" FifteenMin IexFreq = "15min" ThirtyMin IexFreq = "30min" OneHour IexFreq = "1hour" TwoHour IexFreq = "2hour" FourHour IexFreq = "4hour" DateAsc Sort = "date" DateDesc Sort = "-date" OpenAsc Sort = "open" OpenDesc Sort = "-open" HighAsc Sort = "high" HighDesc Sort = "-high" LowAsc Sort = "low" LowDesc Sort = "-low" CloseAsc Sort = "close" CloseDesc Sort = "-close" VolumeAsc Sort = "volume" VolumeDesc Sort = "-volume" AdjOpenAsc Sort = "adjOpen" AdjOpenDesc Sort = "-adjOpen" AdjHighAsc Sort = "adjHigh" AdjHighDesc Sort = "-adjHigh" AdjLowAsc Sort = "adjLow" AdjLowDesc Sort = "-adjLow" AdjCloseAsc Sort = "adjClose" AdjCloseDesc Sort = "-adjClose" AdjVolumeAsc Sort = "adjVolume" AdjVolumeDesc Sort = "-adjVolume" DivCashAsc Sort = "divCash" DivCashDesc Sort = "-divCash" SplitFactorAsc Sort = "splitFactor" SplitFactorDesc Sort = "-splitFactor" MktCapAsc Sort = "marketCap" MktCapDesc Sort = "-marketCap" EntValAsc Sort = "enterpriseValue" EntValDesc Sort = "-enterpriseValue" PERatioAsc Sort = "peRatio" PERatioDesc Sort = "-peRatio" PBRatioAsc Sort = "pbRatio" PBRatioDesc Sort = "-pbRatio" TrailPEGAsc Sort = "trailingPEG1Y" TrailPEGDesc Sort = "-trailingPEG1Y" )
Variables ¶
This section is empty.
Functions ¶
func DailyFundamentalUrl ¶
func DailyFundamentalUrl(ticker string, startDate, endDate time.Time, sort Sort, respFormat Format) string
DailyFundamentalUrl returns a built url for with the provided params from the [Fundamentals].2.6.4 daily Data Endpoint.
Any zero value arguments will be left off the query string.
func EodMetadataUrl ¶
EodMetadataUrl returns a built url for the given ticker from the [End-of-Day].2.1.3 Meta Endpoint.
func EodPriceUrl ¶
func EodPriceUrl(ticker string, startDate, endDate time.Time, resampleFreq EodFreq, sort Sort, respFormat Format, columns []string) string
EodPriceUrl returns a built url for the given ticker with the provided params from the [End-of-Day].2.1.2 End-of-Day Endpoint.
Any zero value arguments will be left off the query string.
func FundamentalMetadataUrl ¶
FundamentalMetadataUrl returns a built url for with the provided params from the [Fundamentals].2.6.5 MetaData Endpoint
Any zero value arguments will be left off the query string.
func IexHistoryUrl ¶
func IexHistoryUrl(ticker string, startDate, endDate time.Time, resampleFreq IexFreq, afterHours, forceFill bool, respFormat Format) string
IexHistoryUrl returns a built url for the given ticker with the provided params from the [IEX].2.5.3 Historical Intraday Prices Endpoint.
Any zero value arguments will be left off the query string.
func IexTopOfBookUrl ¶
IexTopOfBookUrl returns a built url for the given tickers from the [IEX].2.5.2 Top-of-Book & Last Price Endpoint.
Any zero value arguments will be left off the query string.
func SearchUrl ¶
func SearchUrl(query string, exactTickerMatch, includeDelisted bool, limit int, respFormat Format, columns []string) string
SearchUrl returns a built url for the given query from the [Utility].4.1.2 Search Endpoint.
Any zero value arguments will be left off the query string.
func StmtDataUrl ¶
func StmtDataUrl(ticker string, asReported bool, startDate, endDate time.Time, sort Sort, respFormat Format) string
StmtDataUrl returns a built url for with the provided params from the [Fundamentals].2.6.3 Statement Data Endpoint.
Any zero value arguments will be left off the query string.
func StmtDefsUrl ¶
StmtDefsUrl returns a built url for with the provided params from the [Fundamentals].2.6.2 Definitions Data Endpoint.
Any zero value arguments will be left off the query string.
Types ¶
type Client ¶
type Client struct { HttpClient *http.Client // default client that all tiingo requests are routed through RateLimiter Limiter // rate limits request speed Logger *slog.Logger // default logger // contains filtered or unexported fields }
func NewClient ¶
NewClient initializes a new Tiingo client.
Specific config options can be set by providing an options func that will be applied to the returned Client.
func (*Client) DailyFundamental ¶
func (c *Client) DailyFundamental(ctx context.Context, ticker string, startDate, endDate time.Time, sort Sort, respFormat Format) ([]byte, error)
DailyFundamental returns the daily fundamental response data for the given ticker with the provided params from the [Fundamentals].2.6.4 daily Data Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
func (*Client) DefaultDailyFundamental ¶ added in v1.0.0
DefaultDailyFundamental returns the statement values response data for the given ticker from the [Fundamentals].2.6.4 daily Data Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultEodMetadata ¶ added in v1.0.0
DefaultEodMetadata returns the eod metadata response data for a given ticker // from the [End-of-Day].2.1.3 Meta Endpoint
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultEodPrice ¶ added in v1.0.0
DefaultEodPrice returns the daily price response data for the given ticker from the [End-of-Day].2.1.2 End-of-Day Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultFundamentalMetadata ¶ added in v1.0.0
DefaultFundamentalMetadata returns the statement values response data for the all tickers from the [Fundamentals].2.6.5 MetaData Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultIexHistory ¶ added in v1.0.0
DefaultIexHistory returns the intraday price response for the given ticker from the [IEX].2.5.3 Historical Intraday Prices Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultIexTopOfBook ¶ added in v1.0.0
DefaultIexTopOfBook returns the last price item for the all tickers from the [IEX].2.5.2 Top-of-Book & Last Price Endpoints.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultSearch ¶ added in v1.0.0
DefaultSearch search result response for a given query from the [Utility].4.1.2 Search Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultStmtData ¶ added in v1.0.0
DefaultStmtData returns the statement values response data for the given ticker from the [Fundamentals].2.6.3 Statement Data Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultStmtDefs ¶ added in v1.0.0
DefaultStmtDefs returns the statement definition response data from the [Fundamentals].2.6.2 Definitions Data Endpoint.
Only the required params are added to the url & query string, everything else will be the Tiingo defaults.
func (*Client) DefaultSymbolList ¶
DefaultSymbolList returns the full list of SymbolRespItem's from the [End-of-Day].2.1.3.supported_tickers.zip Endpoint
Note: This returns the raw zipped csv bytes from the endpoint, you must unzip before unmarshalling the csv bytes (or pass the raw bytes into FilteredSymbolList or ParseSymbolListCSV).
func (*Client) EodMetadata ¶
EodMetadata returns the eod metadata response data for a given ticker from the [End-of-Day].2.1.3 Meta Endpoint
func (*Client) EodPrice ¶
func (c *Client) EodPrice(ctx context.Context, ticker string, startDate, endDate time.Time, resampleFreq EodFreq, sort Sort, respFormat Format, columns []string) ([]byte, error)
EodPrice returns the daily price response data for a given ticker with the provided params from the [End-of-Day].2.1.2 End-of-Day Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
func (*Client) FilteredSymbolList ¶
func (c *Client) FilteredSymbolList(ctx context.Context, f SymbolFilterFunc) ([]SymbolItem, error)
FilteredSymbolList returns a filtered list of SymbolRespItem's from the [End-of-Day].2.1.3.supported_tickers.zip Endpoint
func (*Client) FundamentalMetadata ¶
func (c *Client) FundamentalMetadata(ctx context.Context, tickers []string, respFormat Format) ([]byte, error)
FundamentalMetadata returns the daily fundamental metadata for the given ticker(s) with the provided params from the [Fundamentals].2.6.5 MetaData Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
func (*Client) IexHistory ¶
func (c *Client) IexHistory(ctx context.Context, ticker string, startDate, endDate time.Time, resampleFreq IexFreq, afterHours, forceFill bool, respFormat Format) ([]byte, error)
IexHistory returns the intraday price response data for a given ticker with the provided params from the [IEX].2.5.3 Historical Intraday Prices Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
func (*Client) IexTopOfBook ¶
func (c *Client) IexTopOfBook(ctx context.Context, tickers []string, respFormat Format) ([]byte, error)
IexTopOfBook returns the last price item for the specified tickers from the [IEX].2.5.2 Top-of-Book & Last Price Endpoints.
Any zero value arguments will be left off the query string.
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, query string, exactMatch, includeDelisted bool, limit int, respFormat Format, columns []string) ([]byte, error)
Search returns the search result response for a given query from the [Utility].4.1.2 Search Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
func (*Client) StmtData ¶ added in v1.0.0
func (c *Client) StmtData(ctx context.Context, ticker string, asReported bool, startDate, endDate time.Time, sort Sort, respFormat Format) ([]byte, error)
StmtData returns the statement values response data for the given ticker with the provided params from the [Fundamentals].2.6.3 Statement Data Endpoint.
Any zero value arguments will be left off the query string & whatever Tiingo's default for an empty query string will be returned.
type DailyFundamental ¶
type DailyFundamental struct { Date time.Time `json:"date,omitempty" csv:"date,omitempty"` MarketCap float64 `json:"marketCap,omitempty" csv:"marketCap,omitempty"` EnterpriseValue float64 `json:"enterpriseVal,omitempty" csv:"enterpriseVal,omitempty"` PriceToEarningsRatio float64 `json:"peRatio,omitempty" csv:"peRatio,omitempty"` PriceToBookRatio float64 `json:"pbRatio,omitempty" csv:"pbRatio,omitempty"` TrailingYearPEG float64 `json:"trailingPEG1Y,omitempty" csv:"trailingPEG1Y,omitempty"` }
DailyFundamental corresponds to the [Fundamentals].2.6.4 Daily Data Endpoint
func (*DailyFundamental) UnmarshalCSVWithFields ¶
func (d *DailyFundamental) UnmarshalCSVWithFields(key, value string) error
type EodFreq ¶
type EodFreq = string
EodFreq is the eod price frequency requested. Possible predefined constants are:
- Daily
- Weekly
- Monthly
- Annually
type EodMetadata ¶
type EodMetadata struct { Ticker string `json:"ticker,omitempty" csv:"ticker,omitempty"` Name string `json:"name,omitempty" csv:"name,omitempty"` ExchangeCode string `json:"exchangeCode,omitempty" csv:"exchangeCode,omitempty"` Description string `json:"description,omitempty" csv:"description,omitempty"` StartDate time.Time `json:"startDate,omitempty" csv:"startDate,omitempty"` EndDate time.Time `json:"endDate,omitempty" csv:"endDate,omitempty"` }
EodMetadata corresponds to the [End-of-Day].2.1.3 Meta Endpoint
func (*EodMetadata) UnmarshalCSVWithFields ¶
func (e *EodMetadata) UnmarshalCSVWithFields(key, value string) error
func (*EodMetadata) UnmarshalJSON ¶
func (e *EodMetadata) UnmarshalJSON(bytes []byte) error
type EodPrice ¶
type EodPrice struct { Date time.Time `json:"date,omitempty" csv:"date"` Open float64 `json:"open,omitempty" csv:"open"` High float64 `json:"high,omitempty" csv:"high"` Low float64 `json:"low,omitempty" csv:"low"` Close float64 `json:"close,omitempty" csv:"close"` Volume int64 `json:"volume,omitempty" csv:"volume"` AdjOpen float64 `json:"adjOpen,omitempty" csv:"adjOpen"` AdjHigh float64 `json:"adjHigh,omitempty" csv:"adjHigh"` AdjLow float64 `json:"adjLow,omitempty" csv:"adjLow"` AdjClose float64 `json:"adjClose,omitempty" csv:"adjClose"` AdjVolume int64 `json:"adjVolume,omitempty" csv:"adjVolume"` DivCash float64 `json:"divCash,omitempty" csv:"divCash"` SplitFactor float64 `json:"splitFactor,omitempty" csv:"splitFactor"` }
EodPrice corresponds to the [End-of-Day].2.1.2 End-of-Day Endpoint
func (*EodPrice) UnmarshalCSVWithFields ¶
type Format ¶
type Format = string
Format is the respFormat the response is sent in. Possible predefined constants are:
- CSV
- JSON
type FundamentalMetadata ¶
type FundamentalMetadata struct { PermaTicker string `json:"permaTicker,omitempty" csv:"permaTicker,omitempty"` Ticker string `json:"ticker,omitempty" csv:"ticker,omitempty"` Name string `json:"name,omitempty" csv:"name,omitempty"` IsActive bool `json:"isActive,omitempty" csv:"isActive,omitempty"` IsADR bool `json:"isADR,omitempty" csv:"isADR,omitempty"` Sector string `json:"sector,omitempty" csv:"sector,omitempty"` Industry string `json:"industry,omitempty" csv:"industry,omitempty"` SicCode int32 `json:"sicCode,omitempty" csv:"sicCode,omitempty"` SicSector string `json:"sicSector,omitempty" csv:"sicSector,omitempty"` SicIndustry string `json:"sicIndustry,omitempty" csv:"sicIndustry,omitempty"` ReportingCurrency string `json:"reportingCurrency,omitempty" csv:"reportingCurrency,omitempty"` Location string `json:"location,omitempty" csv:"location,omitempty"` CompanyWebsite string `json:"companyWebsite,omitempty" csv:"companyWebsite,omitempty"` SecFilingWebsite string `json:"secFilingWebsite,omitempty" csv:"secFilingWebsite,omitempty"` StatementLastUpdated time.Time `json:"statementLastUpdated,omitempty" csv:"statementLastUpdated,omitempty"` DailyLastUpdated time.Time `json:"dailyLastUpdated,omitempty" csv:"dailyLastUpdated,omitempty"` DataProviderPermaTicker string `json:"dataProviderPermaTicker,omitempty" csv:"dataProviderPermaTicker,omitempty"` }
FundamentalMetadata corresponds to the [Fundamentals].2.6.5 Meta Data Endpoint
func (*FundamentalMetadata) UnmarshalCSVWithFields ¶
func (f *FundamentalMetadata) UnmarshalCSVWithFields(key, value string) error
type IexFreq ¶
type IexFreq = string
IexFreq is the IexHistory price frequency requested. Possible predefined constants are:
- OneMin
- FiveMin
- FifteenMin
- ThirtyMin
- OneHour
- TwoHour
- FourHour
type IexPrice ¶
type IexPrice struct { Date time.Time `json:"date,omitempty" csv:"date,omitempty"` Open float64 `json:"open,omitempty" csv:"open,omitempty"` High float64 `json:"high,omitempty" csv:"high,omitempty"` Low float64 `json:"low,omitempty" csv:"low,omitempty"` Close float64 `json:"close,omitempty" csv:"close,omitempty"` Volume int64 `json:"volume,omitempty" csv:"volume,omitempty"` }
IexPrice corresponds to the [IEX].2.5.3 Historical Intraday Prices Endpoint
func (*IexPrice) UnmarshalCSVWithFields ¶
type IexTopOfBook ¶
type IexTopOfBook struct { Ticker string `json:"ticker,omitempty" csv:"ticker,omitempty"` Timestamp time.Time `json:"timestamp,omitempty" csv:"timestamp,omitempty"` QuoteTimestamp time.Time `json:"quoteTimestamp,omitempty" csv:"quoteTimestamp,omitempty"` LastSaleTimestamp time.Time `json:"lastSaleTimestamp,omitempty" csv:"lastSaleTimestamp,omitempty"` Last float64 `json:"last,omitempty" csv:"last,omitempty"` LastSize int32 `json:"lastSize,omitempty" csv:"lastSize,omitempty"` TngoLast float64 `json:"tngoLast,omitempty" csv:"tngoLast,omitempty"` PrevClose float64 `json:"prevClose,omitempty" csv:"prevClose,omitempty"` Open float64 `json:"open,omitempty" csv:"open,omitempty"` High float64 `json:"high,omitempty" csv:"high,omitempty"` Low float64 `json:"low,omitempty" csv:"low,omitempty"` Mid float64 `json:"mid,omitempty" csv:"mid,omitempty"` Volume int64 `json:"volume,omitempty" csv:"volume,omitempty"` BidSize float64 `json:"bidSize,omitempty" csv:"bidSize,omitempty"` BidPrice float64 `json:"bidPrice,omitempty" csv:"bidPrice,omitempty"` AskSize float64 `json:"askSize,omitempty" csv:"askSize,omitempty"` AskPrice float64 `json:"askPrice,omitempty" csv:"askPrice,omitempty"` }
IexTopOfBook corresponds to the [IEX].2.5.2 Top-of-Book and Last Price Endpoints
func (*IexTopOfBook) UnmarshalCSVWithFields ¶
func (i *IexTopOfBook) UnmarshalCSVWithFields(key, value string) error
func (*IexTopOfBook) UnmarshalJSON ¶
func (i *IexTopOfBook) UnmarshalJSON(bytes []byte) error
type SearchResult ¶
type SearchResult struct { Ticker string `json:"ticker,omitempty" csv:"ticker,omitempty"` Name string `json:"name,omitempty" csv:"name,omitempty"` AssetType string `json:"assetType,omitempty" csv:"assetType,omitempty"` IsActive bool `json:"isActive,omitempty" csv:"isActive,omitempty"` PermaTicker string `json:"permaTicker,omitempty" csv:"permaTicker,omitempty"` OpenFIGIComposite string `json:"openFIGIComposite,omitempty" csv:"openFIGIComposite,omitempty"` CountryCode string `json:"countryCode" csv:"countryCode"` }
SearchResult corresponds to [Utility].4.1.2 Search Endpoint
type Sort ¶
type Sort = string
Sort defines the sorting order of the response data. Possible predefined constants are:
- DateAsc
- DateDesc
- OpenAsc
- OpenDesc
- HighAsc
- HighDesc
- LowAsc
- LowDesc
- CloseAsc
- CloseDesc
- VolumeAsc
- VolumeDesc
- AdjOpenAsc
- AdjOpenDesc
- AdjHighAsc
- AdjHighDesc
- AdjLowAsc
- AdjLowDesc
- AdjCloseAsc
- AdjCloseDesc
- AdjVolumeAsc
- AdjVolumeDesc
- DivCashAsc
- DivCashDesc
- SplitFactorAsc
- SplitFactorDesc
- MktCapAsc
- MktCapDesc
- EntValAsc
- EntValDesc
- PERatioAsc
- PERatioDesc
- PBRatioAsc
- PBRatioDesc
- TrailPEGAsc
- TrailPEGDesc
type StmtDataField ¶
type StmtDataField struct { DataCode string `json:"dataCode,omitempty"` Value float64 `json:"value,omitempty"` }
StmtDataField corresponds to the [Fundamentals].2.6.3 Statement Data Endpoint statement data fields
type StmtDataFlat ¶
type StmtDataFlat struct { Date time.Time `json:"date" csv:"date"` Year int `json:"year" csv:"year"` Quarter int `json:"quarter" csv:"quarter"` StatementType string `json:"statementType" csv:"statementType"` DataCode string `json:"dataCode" csv:"dataCode"` Value float64 `json:"value" csv:"value"` }
StmtDataFlat corresponds to the [Fundamentals].2.6.3 Statement Data Endpoint when a csv respFormat is requested
func (*StmtDataFlat) UnmarshalCSVWithFields ¶
func (s *StmtDataFlat) UnmarshalCSVWithFields(key, value string) error
type StmtDataNested ¶
type StmtDataNested struct { Date time.Time `json:"date,omitempty"` Year int32 `json:"year,omitempty"` Quarter int32 `json:"quarter,omitempty"` StatementData struct { BalanceSheet []StmtDataField IncomeStatement []StmtDataField CashFlow []StmtDataField Overview []StmtDataField } }
StmtDataNested corresponds to the [Fundamentals].2.6.3 Statement Data Endpoint when a json respFormat is requested
func (*StmtDataNested) UnmarshalJSON ¶
func (s *StmtDataNested) UnmarshalJSON(bytes []byte) error
type StmtDef ¶
type StmtDef struct { DataCode string `json:"dataCode,omitempty" csv:"dataCode,omitempty"` Name string `json:"name,omitempty" csv:"name,omitempty"` Description string `json:"description,omitempty" csv:"description,omitempty"` StatementType string `json:"statementType,omitempty" csv:"statementType,omitempty"` Units string `json:"units,omitempty" csv:"units,omitempty"` }
StmtDef corresponds to the [Fundamentals].2.6.2 Definitions Data Endpoint
type SymbolFilterFunc ¶
type SymbolFilterFunc func(asset SymbolItem) bool
SymbolFilterFunc is a function that takes in a SymbolRespItem and returns a boolean for if that ticker item should be added to the overall ticker list. A value of nil will return every SymbolRespItem from the list.
Example: Only include NYSE & NASDAQ stocks that have a startDate & endDate date
func(asset SymbolRespItem) bool { if asset.Exchange != "NYSE" && asset.Exchange != "NASDAQ" { return false } if asset.AssetType != "stock" { return false } if asset.StartDate.IsZero() || asset.EndDate.IsZero() { return false } return true }
type SymbolItem ¶
type SymbolItem struct { Ticker string `json:"ticker,omitempty" csv:"ticker,omitempty"` Exchange string `json:"exchange,omitempty" csv:"exchange,omitempty"` AssetType string `json:"assetType,omitempty" csv:"assetType,omitempty"` PriceCurrency string `json:"priceCurrency,omitempty" csv:"priceCurrency,omitempty"` StartDate time.Time `json:"startDate,omitempty" csv:"startDate,omitempty"` EndDate time.Time `json:"EndDate,omitempty" csv:"EndDate,omitempty"` }
SymbolItem corresponds to [End-of-Day].2.1.3.supported_tickers.zip
func ParseSymbolListCSV ¶
func ParseSymbolListCSV(rawData []byte) ([]SymbolItem, error)
ParseSymbolListCSV accepts the raw zipped csv bytes returned from the End-of-Day].2.1.3.supported_tickers.zip Endpoint and parses them into a list of the individual SymbolItem
func (*SymbolItem) UnmarshalCSVWithFields ¶
func (s *SymbolItem) UnmarshalCSVWithFields(key, value string) error