Documentation
¶
Index ¶
- Constants
- func WithLogger(logger *logrus.Logger) clientOption
- type AggregatePricePeriod
- type AssetClass
- type AssetType
- type BISTBidAskLiveData
- type BISTBidAskResponse
- type BISTStockLiveData
- type BISTStockOrderBookData
- type Broker
- type BrokerListResponse
- type BrokerResponseItem
- type BrokerSort
- type BrokerStats
- type BrokerStock
- type CapitalIncrease
- type Client
- func (c *Client) CreateCustomTheme(ctx context.Context, params CreateCustomThemeParams) (*primitive.ObjectID, error)
- func (c *Client) CreateDelayedPriceStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[BISTStockLiveData]], error)
- func (c *Client) CreateLiveBidAskStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[BISTBidAskResponse], error)
- func (c *Client) CreateLiveOrderBookStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[BISTStockOrderBookData], error)
- func (c *Client) CreateLivePriceStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[BISTStockLiveData]], error)
- func (c *Client) CreateLivePriceStreamForUS(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[USStockLiveData]], error)
- func (c *Client) CreateNewsStream(ctx context.Context, params StreamNewsParams) (*NewsStream, error)
- func (c *Client) DeleteCustomTheme(ctx context.Context, id primitive.ObjectID) error
- func (c *Client) GetActiveRightsForInstrument(ctx context.Context, symbol string, date string) ([]CapitalIncrease, error)
- func (c *Client) GetAggregateGraph(ctx context.Context, period AggregatePricePeriod, region Region, ...) (CollectionPriceGraph, error)
- func (c *Client) GetAllCapitalIncreases(ctx context.Context, page int, pageSize int, region Region) (*PaginatedResponse[CapitalIncrease], error)
- func (c *Client) GetAllCollections(ctx context.Context, region Region, locale Locale) ([]Collection, error)
- func (c *Client) GetAllCustomThemes(ctx context.Context, region Region, locale Locale) ([]Collection, error)
- func (c *Client) GetAllIndustries(ctx context.Context, region Region, locale Locale) ([]Industry, error)
- func (c *Client) GetAllPoliticians(ctx context.Context) ([]Politician, error)
- func (c *Client) GetAllRestrictions(ctx context.Context) ([]StockRestriction, error)
- func (c *Client) GetAllSectors(ctx context.Context, region Region, locale Locale) ([]Sector, error)
- func (c *Client) GetAllStocks(ctx context.Context, region Region, page int, pageSize int) ([]Stock, error)
- func (c *Client) GetAllThemes(ctx context.Context, region Region, locale Locale) ([]Collection, error)
- func (c *Client) GetAllTopHoldings(ctx context.Context) ([]TopHolding, error)
- func (c *Client) GetBrokers(ctx context.Context, region Region, page, size int, assetClass ...AssetClass) (PaginatedResponse[*Broker], error)
- func (c *Client) GetBrokersByStock(ctx context.Context, symbol string, region Region, sortBy BrokerSort, ...) (BrokerListResponse, error)
- func (c *Client) GetCapitalIncreasesForInstrument(ctx context.Context, symbol string, page int, pageSize int, region Region) (*PaginatedResponse[CapitalIncrease], error)
- func (c *Client) GetCollectionDetail(ctx context.Context, id string, region Region, locale Locale, sortBy ...SortBy) (CollectionDetail, error)
- func (c *Client) GetCustomHistoricalPrices(ctx context.Context, symbol string, region Region, fromDate string, ...) ([]PriceDataPoint, error)
- func (c *Client) GetCustomThemeDetail(ctx context.Context, id string, locale Locale, sortBy SortBy) (CollectionDetail, error)
- func (c *Client) GetDelayedPriceStreamForBIST() *LivePriceStream[LiveMessageV2[BISTStockLiveData]]
- func (c *Client) GetEarningsTranscriptList(ctx context.Context, region Region, symbol string) ([]EarningsTranscriptListItem, error)
- func (c *Client) GetEarningsTranscriptWithSummary(ctx context.Context, symbol string, year, quarter int) (*EarningsTranscriptWithSummary, error)
- func (c *Client) GetFinancialRatioComparison(ctx context.Context, symbol string, region Region, peerType PeerType) ([]StockPeerFinancialRatioComparison, error)
- func (c *Client) GetFundDistribution(ctx context.Context, symbol string, region Region) (*FundDistribution, error)
- func (c *Client) GetFundStats(ctx context.Context, symbol string, region Region) (*FundStats, error)
- func (c *Client) GetFunds(ctx context.Context, region Region, page int, pageSize int) ([]Fund, error)
- func (c *Client) GetHistoricalFinancialSheets(ctx context.Context, symbol string, from FinancialSheetDate, ...) (HistoricalFinancialSheets, error)
- func (c *Client) GetHistoricalFundPrices(ctx context.Context, symbol string, region Region, ...) ([]FundHistoricalPrice, error)
- func (c *Client) GetHistoricalPrices(ctx context.Context, symbols []string, region Region, ...) ([]StockPriceGraph, error)
- func (c *Client) GetHistoricalRatios(ctx context.Context, symbol string, keys []HistoricalRatiosKey, region Region, ...) ([]StockHistoricalRatios, error)
- func (c *Client) GetHistoricalRatiosDescriptions(ctx context.Context, locale Locale, region Region) ([]StockHistoricalRatiosDescription, error)
- func (c *Client) GetIndustryDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
- func (c *Client) GetKeyInsights(ctx context.Context, symbol string, region Region) (*KeyInsight, error)
- func (c *Client) GetLiveBidAskStreamForBIST() *LivePriceStream[BISTBidAskResponse]
- func (c *Client) GetLiveOrderBookStreamForBIST() *LivePriceStream[BISTStockOrderBookData]
- func (c *Client) GetLivePriceStreamForBIST() *LivePriceStream[LiveMessageV2[BISTStockLiveData]]
- func (c *Client) GetLivePriceStreamForUS() *LivePriceStream[LiveMessageV2[USStockLiveData]]
- func (c *Client) GetMarketBrokers(ctx context.Context, region Region, sortBy BrokerSort, ...) (BrokerListResponse, error)
- func (c *Client) GetMarketStocks(ctx context.Context, region Region, sortBy BrokerSort, ...) (BrokerListResponse, error)
- func (c *Client) GetNews(ctx context.Context, params GetNewsParams) (*PaginatedResponse[News], error)
- func (c *Client) GetNewsApiSourceNames(ctx context.Context, params GetNewsApiSourceNamesParams) ([]NewsApiSource, error)
- func (c *Client) GetNewsCategories(ctx context.Context, locale Locale) ([]NewsCategory, error)
- func (c *Client) GetNewsHighlights(ctx context.Context, params GetNewsHighlightsParams) (*PaginatedResponse[NewsHighlight], error)
- func (c *Client) GetNewsLanes(ctx context.Context, params GetNewsLanesParams) ([]NewsLaneInfo, error)
- func (c *Client) GetNewsStream(params StreamNewsParams) *NewsStream
- func (c *Client) GetNewsV2(ctx context.Context, params GetNewsParams) (*PaginatedResponse[NewsV2], error)
- func (c *Client) GetPoliticianDetail(ctx context.Context, id int) (PoliticianDetail, error)
- func (c *Client) GetPoliticianHoldingsBySymbol(ctx context.Context, symbol string) ([]Holding, error)
- func (c *Client) GetSectorDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
- func (c *Client) GetStateForMarket(ctx context.Context, symbol string) (MarketState, error)
- func (c *Client) GetStateForStock(ctx context.Context, symbol string) (MarketState, error)
- func (c *Client) GetStateOfAllMarkets(ctx context.Context, region Region, page, size int) (PaginatedResponse[*MarketState], error)
- func (c *Client) GetStateOfAllStocks(ctx context.Context, region Region, page, size int) (PaginatedResponse[*MarketState], error)
- func (c *Client) GetStockChartImage(ctx context.Context, params GenerateChartImageRequest) ([]byte, error)
- func (c *Client) GetStockDetailByID(ctx context.Context, id string, locale Locale) (StockDetail, error)
- func (c *Client) GetStockDetailBySymbol(ctx context.Context, symbol string, assetClass AssetClass, region Region, ...) (StockDetail, error)
- func (c *Client) GetStockDividends(ctx context.Context, symbol string, region Region) ([]StockDividend, error)
- func (c *Client) GetStockRestrictions(ctx context.Context, symbol string, region Region) ([]StockRestriction, error)
- func (c *Client) GetStockStats(ctx context.Context, symbols []string, region Region) ([]StockStats, error)
- func (c *Client) GetStocksByBroker(ctx context.Context, symbol string, region Region, sortBy BrokerSort, ...) (BrokerListResponse, error)
- func (c *Client) GetThemeDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
- func (c *Client) GetTickRules(ctx context.Context, symbol string, region Region) (TickRule, error)
- func (c *Client) GetTopMovers(ctx context.Context, direction TopMoversDirection, assetClass AssetClass, ...) ([]TopMover, error)
- func (c *Client) GetWebSocketUrl(ctx context.Context, externalUserId string, feeds []FeedType) (string, error)
- func (c *Client) GetWebsocketUsageForMonth(ctx context.Context, month int, year int, feedType FeedType) ([]WebSocketMonthlyUsageData, error)
- func (c *Client) RevokeWebSocketConnection(ctx context.Context, id string) error
- func (c *Client) Screener(ctx context.Context, region Region, params ScreenerRequest) (ScreenerResponse, error)
- func (c *Client) Search(ctx context.Context, query string, types []SearchType, region Region, ...) (*SearchResponse, error)
- func (c *Client) SendWebsocketEvent(ctx context.Context, params SendWebsocketEventRequest) error
- func (c *Client) UpdateCustomTheme(ctx context.Context, id primitive.ObjectID, params UpdateCustomThemeParams) error
- type ClientTestSuite
- type Collection
- type CollectionDetail
- type CollectionPriceGraph
- type CollectionStatus
- type CreateCustomThemeParams
- type CreateCustomThemeResponse
- type Currency
- type EarningsTranscriptListItem
- type EarningsTranscriptWithSummary
- type FeedType
- type FinancialSheetDate
- type FinancialSheetPeriod
- type FinancialSheetType
- type FlexibleTime
- type Fund
- type FundAsset
- type FundAssetCategory
- type FundContentType
- type FundDistribution
- type FundDistributionCategory
- type FundHistoricalPrice
- type FundStats
- type FundType
- type GenerateChartImageRequest
- type GetNewsApiSourceNamesParams
- type GetNewsHighlightsParams
- type GetNewsLanesParams
- type GetNewsParams
- type HistoricalFinancialSheet
- type HistoricalFinancialSheetRow
- type HistoricalFinancialSheets
- type HistoricalFundPricePeriod
- type HistoricalPriceDate
- type HistoricalPriceInterval
- type HistoricalPricePeriod
- type HistoricalRatiosKey
- type Holding
- type HoldingShort
- type Industry
- type KeyInsight
- type LaplaceConfiguration
- type LaplaceError
- type LaplaceHTTPError
- type LaplaceHTTPErrorMsg
- type LevelSide
- type LiveMessageV2
- type LivePriceResult
- type LivePriceStream
- type LivePriceType
- type Locale
- type LocaleString
- type Market
- type MarketState
- type MessageCode
- type MessageType
- type News
- type NewsApiSource
- type NewsCategories
- type NewsCategory
- type NewsContent
- type NewsHighlight
- type NewsIndustry
- type NewsLane
- type NewsLaneInfo
- type NewsOrderBy
- type NewsPublisher
- type NewsSector
- type NewsStream
- type NewsStreamResult
- type NewsTicker
- type NewsType
- type NewsV2
- type OrderbookDeletedLevel
- type OrderbookLevel
- type PaginatedResponse
- type PaginationPageSize
- type PeerType
- type Politician
- type PoliticianDetail
- type Price
- type PriceDataPoint
- type Region
- type ScreenerFilters
- type ScreenerItem
- type ScreenerRange
- type ScreenerRating
- type ScreenerRequest
- type ScreenerResponse
- type ScreenerSortBy
- type SearchResponse
- type SearchResponseCollection
- type SearchResponseStock
- type SearchType
- type Sector
- type SendWebsocketEventRequest
- type SheetItem
- type SortBy
- type SortDirection
- type Stock
- type StockDetail
- type StockDividend
- type StockHistoricalRatios
- type StockHistoricalRatiosData
- type StockHistoricalRatiosDescription
- type StockHistoricalRatiosFormatting
- type StockHistoricalRatiosValue
- type StockPeerFinancialRatioComparison
- type StockPeerFinancialRatioComparisonData
- type StockPriceGraph
- type StockRestriction
- type StockStats
- type StreamNewsParams
- type TickRule
- type TickSizeRule
- type TopHolding
- type TopHoldingPolitician
- type TopMover
- type TopMoversDirection
- type USStockLiveData
- type UpdateCustomThemeParams
- type WebSocketMonthlyUsageData
- type WebSocketUrlParams
- type WebSocketUrlResponse
Constants ¶
const (
BaseURL = "https://api.finfree.app"
)
Variables ¶
This section is empty.
Functions ¶
func WithLogger ¶
WithLogger configures the client to use a custom logger instead of the default one.
Types ¶
type AggregatePricePeriod ¶
type AggregatePricePeriod string
const ( AggregatePricePeriodOneDay AggregatePricePeriod = "1G" AggregatePricePeriodOneWeek AggregatePricePeriod = "1H" AggregatePricePeriodOneMonth AggregatePricePeriod = "1A" AggregatePricePeriodThreeMonth AggregatePricePeriod = "3A" AggregatePricePeriodOneYear AggregatePricePeriod = "1Y" AggregatePricePeriodTwoYear AggregatePricePeriod = "2Y" AggregatePricePeriodThreeYear AggregatePricePeriod = "3Y" AggregatePricePeriodFiveYear AggregatePricePeriod = "5Y" )
type AssetClass ¶
type AssetClass string
const ( AssetClassEquity AssetClass = "equity" AssetClassCrypto AssetClass = "crypto" AssetClassADR AssetClass = "adr" AssetClassETN AssetClass = "etn" AssetClassAll AssetClass = "all" )
type AssetType ¶
type AssetType string
const ( AssetTypeStock AssetType = "stock" AssetTypeForex AssetType = "forex" AssetTypeIndex AssetType = "index" AssetTypeEtf AssetType = "etf" AssetTypeCommodity AssetType = "commodity" AssetTypeStockRights AssetType = "stock_rights" AssetTypeFund AssetType = "fund" AssetTypeAll AssetType = "all" )
type BISTBidAskLiveData ¶
type BISTBidAskResponse ¶
type BISTBidAskResponse = LiveMessageV2[BISTBidAskLiveData]
BISTBidAskResponse is the envelope of the bid/ask feed. It is the same LiveMessageV2 envelope as the other price feeds; the alias is kept so the bid/ask wire format cannot drift from the shared one again.
type BISTStockLiveData ¶
type BISTStockOrderBookData ¶
type BISTStockOrderBookData struct {
Updated []OrderbookLevel `json:"updated"`
Deleted []OrderbookDeletedLevel `json:"deleted"`
Symbol string `json:"symbol"`
}
BISTStockOrderBookData represents BIST stock order book data. Unlike the price feeds the order book stream is not wrapped in an envelope and carries the symbol under "symbol".
type BrokerListResponse ¶
type BrokerListResponse struct {
PaginatedResponse[*BrokerResponseItem]
TotalStats BrokerStats `json:"totalStats"`
}
type BrokerResponseItem ¶
type BrokerResponseItem struct {
BrokerStats
Broker *Broker `json:"broker,omitempty"`
Stock *BrokerStock `json:"stock,omitempty"`
}
type BrokerSort ¶
type BrokerSort string
const ( BrokerSortNetAmount BrokerSort = "netAmount" BrokerSortTotalAmount BrokerSort = "totalAmount" BrokerSortTotalVolume BrokerSort = "totalVolume" BrokerSortTotalBuyAmount BrokerSort = "totalBuyAmount" BrokerSortTotalBuyVolume BrokerSort = "totalBuyVolume" BrokerSortTotalSellAmount BrokerSort = "totalSellAmount" BrokerSortTotalSellVolume BrokerSort = "totalSellVolume" )
type BrokerStats ¶
type BrokerStats struct {
TotalBuyAmount float64 `json:"totalBuyAmount"`
TotalSellAmount float64 `json:"totalSellAmount"`
NetAmount float64 `json:"netAmount"`
TotalBuyVolume float64 `json:"totalBuyVolume"`
TotalSellVolume float64 `json:"totalSellVolume"`
TotalVolume float64 `json:"totalVolume"`
TotalAmount float64 `json:"totalAmount"`
AverageCost float64 `json:"averageCost,omitempty"`
}
type BrokerStock ¶
type CapitalIncrease ¶
type CapitalIncrease struct {
ID int `json:"id"`
BoardDecisionDate *time.Time `json:"boardDecisionDate"`
RegisteredCapitalCeiling string `json:"registeredCapitalCeiling"`
CurrentCapital string `json:"currentCapital"`
TargetCapital string `json:"targetCapital"`
Types []string `json:"types"`
SpkApplicationResult *string `json:"spkApplicationResult"`
SpkApplicationDate *time.Time `json:"spkApplicationDate"`
SpkApprovalDate *time.Time `json:"spkApprovalDate"`
PaymentDate *time.Time `json:"paymentDate"`
RegistrationDate *time.Time `json:"registrationDate"`
SpecifiedCurrency string `json:"specifiedCurrency"`
Symbol string `json:"symbol"`
RelatedDisclosureIDs []int `json:"relatedDisclosureIds"`
RightsRate string `json:"rightsRate"`
RightsPrice string `json:"rightsPrice"`
RightsTotalAmount string `json:"rightsTotalAmount"`
RightsStartDate *time.Time `json:"rightsStartDate"`
RightsEndDate *time.Time `json:"rightsEndDate"`
RightsLastSellDate *time.Time `json:"rightsLastSellDate"`
BonusRate string `json:"bonusRate"`
BonusTotalAmount string `json:"bonusTotalAmount"`
BonusStartDate *time.Time `json:"bonusStartDate"`
BonusDividendRate string `json:"bonusDividendRate"`
BonusDividendTotalAmount string `json:"bonusDividendTotalAmount"`
ExternalCapitalIncreaseAmount string `json:"externalCapitalIncreaseAmount"`
ExternalCapitalIncreaseRate string `json:"externalCapitalIncreaseRate"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient( cfg LaplaceConfiguration, opts ...clientOption, ) (*Client, error)
NewClient creates a new Laplace API client with the provided configuration and optional settings.
func (*Client) CreateCustomTheme ¶
func (c *Client) CreateCustomTheme(ctx context.Context, params CreateCustomThemeParams) (*primitive.ObjectID, error)
CreateCustomTheme creates a new custom investment theme with the specified parameters and returns the theme ID.
func (*Client) CreateDelayedPriceStreamForBIST ¶
func (c *Client) CreateDelayedPriceStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[BISTStockLiveData]], error)
CreateDelayedPriceStreamForBIST creates and subscribes to delayed price stream for BIST
func (*Client) CreateLiveBidAskStreamForBIST ¶
func (c *Client) CreateLiveBidAskStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[BISTBidAskResponse], error)
CreateLiveBidAskStreamForBIST creates and subscribes to bid/ask price stream for BIST.
func (*Client) CreateLiveOrderBookStreamForBIST ¶
func (c *Client) CreateLiveOrderBookStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[BISTStockOrderBookData], error)
CreateLiveOrderBookStreamForBIST creates and subscribes to order book stream for BIST
func (*Client) CreateLivePriceStreamForBIST ¶
func (c *Client) CreateLivePriceStreamForBIST(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[BISTStockLiveData]], error)
CreateLivePriceStreamForBIST creates and subscribes to live price stream for BIST
func (*Client) CreateLivePriceStreamForUS ¶
func (c *Client) CreateLivePriceStreamForUS(ctx context.Context, symbols []string) (*LivePriceStream[LiveMessageV2[USStockLiveData]], error)
CreateLivePriceStreamForUS creates and subscribes to live price stream for US stocks
func (*Client) CreateNewsStream ¶
func (c *Client) CreateNewsStream(ctx context.Context, params StreamNewsParams) (*NewsStream, error)
CreateNewsStream creates and subscribes to a news stream.
func (*Client) DeleteCustomTheme ¶
DeleteCustomTheme permanently removes a custom theme from the system.
func (*Client) GetActiveRightsForInstrument ¶
func (c *Client) GetActiveRightsForInstrument(ctx context.Context, symbol string, date string) ([]CapitalIncrease, error)
GetActiveRightsForInstrument retrieves active rights offerings for a specific stock on a given date.
func (*Client) GetAggregateGraph ¶
func (c *Client) GetAggregateGraph(ctx context.Context, period AggregatePricePeriod, region Region, sectorId, industryId, collectionId string) (CollectionPriceGraph, error)
GetAggregateGraph retrieves the aggregate price graph for a sector, industry, or collection.
func (*Client) GetAllCapitalIncreases ¶
func (c *Client) GetAllCapitalIncreases(ctx context.Context, page int, pageSize int, region Region) (*PaginatedResponse[CapitalIncrease], error)
GetAllCapitalIncreases retrieves all capital increase announcements and events with pagination.
func (*Client) GetAllCollections ¶
func (c *Client) GetAllCollections(ctx context.Context, region Region, locale Locale) ([]Collection, error)
GetAllCollections retrieves all collections available for the specified region and locale.
func (*Client) GetAllCustomThemes ¶
func (c *Client) GetAllCustomThemes(ctx context.Context, region Region, locale Locale) ([]Collection, error)
GetAllCustomThemes retrieves all custom investment themes available for the specified locale.
func (*Client) GetAllIndustries ¶
func (c *Client) GetAllIndustries(ctx context.Context, region Region, locale Locale) ([]Industry, error)
GetAllIndustries retrieves all industries available for the specified region and locale.
func (*Client) GetAllPoliticians ¶
func (c *Client) GetAllPoliticians(ctx context.Context) ([]Politician, error)
func (*Client) GetAllRestrictions ¶
func (c *Client) GetAllRestrictions(ctx context.Context) ([]StockRestriction, error)
GetAllRestrictions retrieves all trading restrictions and limitations.
func (*Client) GetAllSectors ¶
GetAllSectors retrieves all sectors available for the specified region and locale.
func (*Client) GetAllStocks ¶
func (c *Client) GetAllStocks(ctx context.Context, region Region, page int, pageSize int) ([]Stock, error)
GetAllStocks retrieves a paginated list of all stocks for the specified region.
func (*Client) GetAllThemes ¶
func (c *Client) GetAllThemes(ctx context.Context, region Region, locale Locale) ([]Collection, error)
GetAllThemes retrieves all investment themes available for the specified region and locale.
func (*Client) GetAllTopHoldings ¶
func (c *Client) GetAllTopHoldings(ctx context.Context) ([]TopHolding, error)
func (*Client) GetBrokers ¶
func (c *Client) GetBrokers(ctx context.Context, region Region, page, size int, assetClass ...AssetClass) (PaginatedResponse[*Broker], error)
GetBrokers retrieves a paginated list of brokers for the specified region.
func (*Client) GetBrokersByStock ¶
func (c *Client) GetBrokersByStock(ctx context.Context, symbol string, region Region, sortBy BrokerSort, sortDirection SortDirection, fromDate, toDate string, page, size int) (BrokerListResponse, error)
GetBrokersByStock retrieves brokers that have traded a specific stock with their trading statistics and sorting options.
func (*Client) GetCapitalIncreasesForInstrument ¶
func (c *Client) GetCapitalIncreasesForInstrument(ctx context.Context, symbol string, page int, pageSize int, region Region) (*PaginatedResponse[CapitalIncrease], error)
GetCapitalIncreasesForInstrument fetches capital increase events for a specific stock symbol.
func (*Client) GetCollectionDetail ¶
func (c *Client) GetCollectionDetail(ctx context.Context, id string, region Region, locale Locale, sortBy ...SortBy) (CollectionDetail, error)
GetCollectionDetail fetches detailed information about a specific collection including its constituent stocks. An optional sortBy parameter can be provided to sort stocks (e.g. SortByPriceChange).
func (*Client) GetCustomHistoricalPrices ¶
func (c *Client) GetCustomHistoricalPrices(ctx context.Context, symbol string, region Region, fromDate string, toDate string, interval HistoricalPriceInterval, detail bool, numIntervals ...int) ([]PriceDataPoint, error)
GetCustomHistoricalPrices retrieves custom historical price data for a stock within a specific date range and interval.
func (*Client) GetCustomThemeDetail ¶
func (c *Client) GetCustomThemeDetail(ctx context.Context, id string, locale Locale, sortBy SortBy) (CollectionDetail, error)
GetCustomThemeDetail fetches detailed information about a specific custom theme including its constituent stocks.
func (*Client) GetDelayedPriceStreamForBIST ¶
func (c *Client) GetDelayedPriceStreamForBIST() *LivePriceStream[LiveMessageV2[BISTStockLiveData]]
GetDelayedPriceStreamForBIST creates a new delayed price stream for BIST stocks. Call Subscribe(ctx, symbols) on the returned stream to start receiving data.
func (*Client) GetEarningsTranscriptList ¶
func (c *Client) GetEarningsTranscriptList(ctx context.Context, region Region, symbol string) ([]EarningsTranscriptListItem, error)
GetEarningsTranscriptList retrieves the list of available earnings transcripts for a stock.
func (*Client) GetEarningsTranscriptWithSummary ¶
func (c *Client) GetEarningsTranscriptWithSummary(ctx context.Context, symbol string, year, quarter int) (*EarningsTranscriptWithSummary, error)
GetEarningsTranscriptWithSummary retrieves the earnings transcript with an AI-generated summary for a specific quarter.
func (*Client) GetFinancialRatioComparison ¶
func (c *Client) GetFinancialRatioComparison(ctx context.Context, symbol string, region Region, peerType PeerType) ([]StockPeerFinancialRatioComparison, error)
GetFinancialRatioComparison retrieves financial ratio comparisons for a stock against its sector or industry peers.
func (*Client) GetFundDistribution ¶
func (c *Client) GetFundDistribution(ctx context.Context, symbol string, region Region) (*FundDistribution, error)
GetFundDistribution retrieves detailed asset allocation and distribution information for a specific fund.
func (*Client) GetFundStats ¶
func (c *Client) GetFundStats(ctx context.Context, symbol string, region Region) (*FundStats, error)
GetFundStats fetches comprehensive statistical data for a specific fund including returns, risk metrics, and performance indicators.
func (*Client) GetFunds ¶
func (c *Client) GetFunds(ctx context.Context, region Region, page int, pageSize int) ([]Fund, error)
GetFunds retrieves a paginated list of investment funds for the specified region with basic fund information.
func (*Client) GetHistoricalFinancialSheets ¶
func (c *Client) GetHistoricalFinancialSheets(ctx context.Context, symbol string, from FinancialSheetDate, to FinancialSheetDate, sheetType FinancialSheetType, period FinancialSheetPeriod, currency Currency, region Region) (HistoricalFinancialSheets, error)
GetHistoricalFinancialSheets fetches historical financial statements (income statement, balance sheet, cash flow) for a stock.
func (*Client) GetHistoricalFundPrices ¶
func (c *Client) GetHistoricalFundPrices(ctx context.Context, symbol string, region Region, period HistoricalFundPricePeriod) ([]FundHistoricalPrice, error)
GetHistoricalFundPrices retrieves historical price data for a fund over the specified time period.
func (*Client) GetHistoricalPrices ¶
func (c *Client) GetHistoricalPrices(ctx context.Context, symbols []string, region Region, keys []HistoricalPricePeriod) ([]StockPriceGraph, error)
GetHistoricalPrices retrieves historical price data for multiple stocks over specified time periods.
func (*Client) GetHistoricalRatios ¶
func (c *Client) GetHistoricalRatios(ctx context.Context, symbol string, keys []HistoricalRatiosKey, region Region, locale ...Locale) ([]StockHistoricalRatios, error)
GetHistoricalRatios fetches historical financial ratios for a stock over time with sector comparisons.
func (*Client) GetHistoricalRatiosDescriptions ¶
func (c *Client) GetHistoricalRatiosDescriptions(ctx context.Context, locale Locale, region Region) ([]StockHistoricalRatiosDescription, error)
GetHistoricalRatiosDescriptions retrieves metadata and descriptions for available historical financial ratios.
func (*Client) GetIndustryDetail ¶
func (c *Client) GetIndustryDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
GetIndustryDetail fetches detailed information about a specific industry including its constituent stocks.
func (*Client) GetKeyInsights ¶
func (c *Client) GetKeyInsights(ctx context.Context, symbol string, region Region) (*KeyInsight, error)
GetKeyInsights fetches key insights and analysis for a specific stock symbol.
func (*Client) GetLiveBidAskStreamForBIST ¶
func (c *Client) GetLiveBidAskStreamForBIST() *LivePriceStream[BISTBidAskResponse]
GetLiveBidAskStreamForBIST creates a new bid/ask price stream for BIST stocks. Call Subscribe(ctx, symbols) on the returned stream to start receiving data. Passing no symbols to Subscribe means all BIST stocks will be streamed.
func (*Client) GetLiveOrderBookStreamForBIST ¶
func (c *Client) GetLiveOrderBookStreamForBIST() *LivePriceStream[BISTStockOrderBookData]
GetLiveOrderBookStreamForBIST creates a new order book stream for BIST stocks. Call Subscribe(ctx, symbols) on the returned stream to start receiving data.
func (*Client) GetLivePriceStreamForBIST ¶
func (c *Client) GetLivePriceStreamForBIST() *LivePriceStream[LiveMessageV2[BISTStockLiveData]]
GetLivePriceStreamForBIST creates a new live price stream for BIST stocks. Call Subscribe(ctx, symbols) on the returned stream to start receiving data.
func (*Client) GetLivePriceStreamForUS ¶
func (c *Client) GetLivePriceStreamForUS() *LivePriceStream[LiveMessageV2[USStockLiveData]]
GetLivePriceStreamForUS creates a new live price stream for US stocks. Call Subscribe(ctx, symbols) on the returned stream to start receiving data.
func (*Client) GetMarketBrokers ¶
func (c *Client) GetMarketBrokers(ctx context.Context, region Region, sortBy BrokerSort, sortDirection SortDirection, fromDate, toDate string, page, size int) (BrokerListResponse, error)
GetMarketBrokers fetches market brokers with trading statistics, including total volumes and amounts with sorting options.
func (*Client) GetMarketStocks ¶
func (c *Client) GetMarketStocks(ctx context.Context, region Region, sortBy BrokerSort, sortDirection SortDirection, fromDate, toDate string, page, size int) (BrokerListResponse, error)
GetMarketStocks fetches market stocks with broker trading statistics, including buy/sell volumes and amounts with sorting options.
func (*Client) GetNews ¶
func (c *Client) GetNews(ctx context.Context, params GetNewsParams) (*PaginatedResponse[News], error)
GetNews retrieves a paginated list of news articles with optional filtering, ordering, and pagination.
func (*Client) GetNewsApiSourceNames ¶
func (c *Client) GetNewsApiSourceNames(ctx context.Context, params GetNewsApiSourceNamesParams) ([]NewsApiSource, error)
GetNewsApiSourceNames returns the configured news sources (id + name), suitable for populating a source filter. The returned IDs feed the `apiSource` parameter of the News and Live News Stream endpoints.
func (*Client) GetNewsCategories ¶
GetNewsCategories returns the full canonical news category list with localized names for the given locale. All categories are always returned regardless of whether they currently have tagged news, making the result suitable for populating dropdowns and filter UIs.
func (*Client) GetNewsHighlights ¶
func (c *Client) GetNewsHighlights(ctx context.Context, params GetNewsHighlightsParams) (*PaginatedResponse[NewsHighlight], error)
GetNewsHighlights retrieves paginated, sector-categorized US news highlights, newest first.
func (*Client) GetNewsLanes ¶
func (c *Client) GetNewsLanes(ctx context.Context, params GetNewsLanesParams) ([]NewsLaneInfo, error)
GetNewsLanes returns the fixed list of news lanes (id + label) suitable for building a lane filter UI. The returned IDs feed the `lane` parameter of the News and Live News Stream endpoints.
func (*Client) GetNewsStream ¶
func (c *Client) GetNewsStream(params StreamNewsParams) *NewsStream
GetNewsStream creates a new news stream. Call Subscribe(ctx) on the returned stream to start receiving data.
func (*Client) GetNewsV2 ¶
func (c *Client) GetNewsV2(ctx context.Context, params GetNewsParams) (*PaginatedResponse[NewsV2], error)
GetNewsV2 retrieves a paginated list of news articles from the v2 endpoint, excluding related tickers.
func (*Client) GetPoliticianDetail ¶
func (*Client) GetPoliticianHoldingsBySymbol ¶
func (*Client) GetSectorDetail ¶
func (c *Client) GetSectorDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
GetSectorDetail fetches detailed information about a specific sector including its constituent stocks.
func (*Client) GetStateForMarket ¶
GetStateForMarket returns the current state of a specific market.
func (*Client) GetStateForStock ¶
GetStateForStock returns the current state of a specific stock.
func (*Client) GetStateOfAllMarkets ¶
func (c *Client) GetStateOfAllMarkets(ctx context.Context, region Region, page, size int) (PaginatedResponse[*MarketState], error)
GetStateOfAllMarkets returns the state of all markets for a given region.
func (*Client) GetStateOfAllStocks ¶
func (c *Client) GetStateOfAllStocks(ctx context.Context, region Region, page, size int) (PaginatedResponse[*MarketState], error)
GetStateOfAllStocks returns the state of all stocks for a given region.
func (*Client) GetStockChartImage ¶
func (c *Client) GetStockChartImage(ctx context.Context, params GenerateChartImageRequest) ([]byte, error)
GetStockChartImage generates a chart image for a stock and returns the raw image bytes.
func (*Client) GetStockDetailByID ¶
func (c *Client) GetStockDetailByID(ctx context.Context, id string, locale Locale) (StockDetail, error)
GetStockDetailByID fetches detailed information about a stock using its unique ID.
func (*Client) GetStockDetailBySymbol ¶
func (c *Client) GetStockDetailBySymbol(ctx context.Context, symbol string, assetClass AssetClass, region Region, locale Locale) (StockDetail, error)
GetStockDetailBySymbol fetches detailed information about a stock using its symbol, asset class, region, and locale.
func (*Client) GetStockDividends ¶
func (c *Client) GetStockDividends(ctx context.Context, symbol string, region Region) ([]StockDividend, error)
GetStockDividends retrieves dividend history and information for a specific stock.
func (*Client) GetStockRestrictions ¶
func (c *Client) GetStockRestrictions(ctx context.Context, symbol string, region Region) ([]StockRestriction, error)
GetStockRestrictions fetches trading restrictions and limitations for a specific stock in the given region.
func (*Client) GetStockStats ¶
func (c *Client) GetStockStats(ctx context.Context, symbols []string, region Region) ([]StockStats, error)
GetStockStats fetches comprehensive statistics for multiple stocks including market cap, P/E ratios, returns, and price data.
func (*Client) GetStocksByBroker ¶
func (c *Client) GetStocksByBroker(ctx context.Context, symbol string, region Region, sortBy BrokerSort, sortDirection SortDirection, fromDate, toDate string, page, size int) (BrokerListResponse, error)
GetStocksByBroker retrieves stocks that have been traded by a specific broker with trading statistics and sorting options.
func (*Client) GetThemeDetail ¶
func (c *Client) GetThemeDetail(ctx context.Context, id string, region Region, locale Locale) (CollectionDetail, error)
GetThemeDetail fetches detailed information about a specific investment theme including its constituent stocks.
func (*Client) GetTickRules ¶
GetTickRules retrieves tick size rules and price limits for a stock in the specified region.
func (*Client) GetTopMovers ¶
func (c *Client) GetTopMovers(ctx context.Context, direction TopMoversDirection, assetClass AssetClass, assetType AssetType, page int, pageSize int, region Region) ([]TopMover, error)
GetTopMovers retrieves the top gaining or losing stocks for the specified asset class and type with pagination.
func (*Client) GetWebSocketUrl ¶
func (c *Client) GetWebSocketUrl(ctx context.Context, externalUserId string, feeds []FeedType) (string, error)
GetWebSocketUrl generates a WebSocket URL for accessing real-time market data feeds including live prices and depth data.
func (*Client) GetWebsocketUsageForMonth ¶
func (c *Client) GetWebsocketUsageForMonth(ctx context.Context, month int, year int, feedType FeedType) ([]WebSocketMonthlyUsageData, error)
GetWebsocketUsageForMonth retrieves WebSocket usage statistics for a specific month.
func (*Client) RevokeWebSocketConnection ¶
RevokeWebSocketConnection revokes an active WebSocket connection by its ID (the UUID segment from the WebSocket URL).
func (*Client) Screener ¶
func (c *Client) Screener(ctx context.Context, region Region, params ScreenerRequest) (ScreenerResponse, error)
Screener returns a filtered and sorted list of stocks for the given region. Region defaults to "tr" if empty. US is not currently supported.
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, query string, types []SearchType, region Region, locale Locale, page int, pageSize PaginationPageSize) (*SearchResponse, error)
Search performs a comprehensive search across stocks, collections, sectors, and industries with filtering and pagination.
func (*Client) SendWebsocketEvent ¶
func (c *Client) SendWebsocketEvent(ctx context.Context, params SendWebsocketEventRequest) error
SendWebsocketEvent sends a custom event through the WebSocket connection.
func (*Client) UpdateCustomTheme ¶
func (c *Client) UpdateCustomTheme(ctx context.Context, id primitive.ObjectID, params UpdateCustomThemeParams) error
UpdateCustomTheme updates an existing custom theme with new parameters and settings.
type ClientTestSuite ¶
type ClientTestSuite struct {
suite.Suite
Config LaplaceConfiguration
}
func NewClientTestSuite ¶
func NewClientTestSuite() *ClientTestSuite
func (*ClientTestSuite) SetupTest ¶
func (s *ClientTestSuite) SetupTest()
type Collection ¶
type Collection struct {
ID primitive.ObjectID `json:"id"`
Title string `json:"title"`
Region []Region `json:"region"`
Locale Locale `json:"locale,omitempty"`
ImageUrl string `json:"imageUrl"`
AvatarUrl string `json:"avatarUrl"`
NumStocks int `json:"numStocks"`
AssetClass AssetClass `json:"assetClass,omitempty"`
Description string `json:"description,omitempty"`
Image string `json:"image,omitempty"`
Order *int `json:"order,omitempty"`
Status CollectionStatus `json:"status,omitempty"`
MetaData map[string]any `json:"metaData,omitempty"`
}
type CollectionDetail ¶
type CollectionDetail struct {
*Collection `json:",inline"`
Stocks []Stock `json:"stocks"`
}
type CollectionPriceGraph ¶
type CollectionPriceGraph struct {
PreviousClose float64 `json:"previous_close"`
Graph []PriceDataPoint `json:"graph"`
}
type CollectionStatus ¶
type CollectionStatus string
const ( CollectionStatusActive CollectionStatus = "active" CollectionStatusInactive CollectionStatus = "inactive" )
type CreateCustomThemeParams ¶
type CreateCustomThemeParams struct {
Title LocaleString `json:"title,omitempty" bson:"title,omitempty" validate:"required"`
Description LocaleString `json:"description,omitempty" bson:"description,omitempty"`
Region []Region `json:"region,omitempty" bson:"region,omitempty"`
ImageURL string `json:"image_url" bson:"image_url"`
Image string `json:"image" bson:"image"`
AvatarImageURL string `json:"avatar_url" bson:"avatar_image_url"`
Stocks []primitive.ObjectID `json:"stocks" bson:"stocks" validate:"required"`
Order int `json:"order" bson:"order"`
Status CollectionStatus `json:"status" bson:"status" validate:"required,oneof=active inactive"`
MetaData map[string]any `json:"meta_data,omitempty" bson:"meta_data,omitempty"`
}
type CreateCustomThemeResponse ¶
type CreateCustomThemeResponse struct {
ID string `json:"id"`
}
type EarningsTranscriptListItem ¶
type EarningsTranscriptListItem struct {
Symbol string `json:"symbol"`
Year int `json:"year"`
Quarter int `json:"quarter"`
Date FlexibleTime `json:"date"`
FiscalYear int `json:"fiscal_year"`
}
type FeedType ¶
type FeedType string
const ( FeedTypeLivePriceTR FeedType = "live_price_tr" FeedTypeDelayedPriceTR FeedType = "delayed_price_tr" FeedTypeLivePriceUS FeedType = "live_price_us" FeedTypeDelayedPriceUS FeedType = "delayed_price_us" FeedTypeDepthTR FeedType = "depth_tr" FeedTypeStateUS FeedType = "state_us" FeedTypeLiveAskBidPriceTR FeedType = "live_ask_bid_price_tr" FeedTypeCustom FeedType = "custom" )
type FinancialSheetDate ¶
type FinancialSheetPeriod ¶
type FinancialSheetPeriod string
const ( FinancialSheetPeriodAnnual FinancialSheetPeriod = "annual" FinancialSheetPeriodQuarterly FinancialSheetPeriod = "quarterly" FinancialSheetPeriodCumulative FinancialSheetPeriod = "cumulative" )
type FinancialSheetType ¶
type FinancialSheetType string
const ( FinancialSheetIncomeStatement FinancialSheetType = "incomeStatement" FinancialSheetBalanceSheet FinancialSheetType = "balanceSheet" FinancialSheetCashFlow FinancialSheetType = "cashFlowStatement" )
type FlexibleTime ¶
FlexibleTime handles date fields that may arrive in different formats from the API (e.g. "2024-01-15", "2024-01-15T10:30:00Z", unix timestamp as number).
func (FlexibleTime) MarshalJSON ¶
func (ft FlexibleTime) MarshalJSON() ([]byte, error)
func (*FlexibleTime) UnmarshalJSON ¶
func (ft *FlexibleTime) UnmarshalJSON(data []byte) error
type FundAsset ¶
type FundAsset struct {
Type FundContentType `json:"type"`
Symbol string `json:"symbol"`
WholePercentage float64 `json:"wholePercentage"`
CategoryPercentage float64 `json:"categoryPercentage"`
}
type FundAssetCategory ¶
type FundAssetCategory string
const ( FundAssetCategoryOther FundAssetCategory = "OTHER" FundAssetCategoryEquity FundAssetCategory = "EQUITY" FundAssetCategoryLiquidDeposit FundAssetCategory = "LIQUID_DEPOSIT" FundAssetCategoryFuturesCashCollateral FundAssetCategory = "FUTURES_CASH_COLLATERAL" FundAssetCategoryInvestmentFunds FundAssetCategory = "INVESTMENT_FUNDS" FundAssetCategoryParticipationAccount FundAssetCategory = "PARTICIPATION_ACCOUNT" FundAssetCategoryPreciousMetals FundAssetCategory = "PRECIOUS_METALS" FundAssetCategoryCorporateBond FundAssetCategory = "CORPORATE_BOND" FundAssetCategoryCurrency FundAssetCategory = "CURRENCY" FundAssetCategoryPublicExternalDebtSecurities FundAssetCategory = "PUBLIC_EXTERNAL_DEBT_SECURITIES" FundAssetCategoryPrivateSectorExternalDebtSecurities FundAssetCategory = "PRIVATE_SECTOR_EXTERNAL_DEBT_SECURITIES" FundAssetCategoryPublicLeaseCertificates FundAssetCategory = "PUBLIC_LEASE_CERTIFICATES" FundAssetCategoryPrivateSectorLeaseCertificates FundAssetCategory = "PRIVATE_SECTOR_LEASE_CERTIFICATES" FundAssetCategoryForeignExchangeTradedFunds FundAssetCategory = "FOREIGN_EXCHANGE_TRADED_FUNDS" FundAssetCategoryPublicLeaseCertificatesCurrency FundAssetCategory = "PUBLIC_LEASE_CERTIFICATES_CURRENCY" FundAssetCategoryGovernmentBond FundAssetCategory = "GOVERNMENT_BOND" FundAssetCategoryPrivateSectorLeaseCertificatesCurrency FundAssetCategory = "PRIVATE_SECTOR_LEASE_CERTIFICATES_CURRENCY" FundAssetCategoryUnknown FundAssetCategory = "UNKNOWN" )
type FundContentType ¶
type FundContentType string
const ( FundContentTypeBistStock FundContentType = "BIST_STOCK" FundContentTypeOtherStock FundContentType = "OTHER_STOCK" FundContentTypeUnknown FundContentType = "UNKNOWN" )
type FundDistribution ¶
type FundDistribution struct {
Categories []FundDistributionCategory `json:"categories"`
}
type FundDistributionCategory ¶
type FundDistributionCategory struct {
Category FundAssetCategory `json:"category"`
Percentage float64 `json:"percentage"`
Assets []FundAsset `json:"assets,omitempty"`
}
type FundHistoricalPrice ¶
type FundStats ¶
type FundStats struct {
YearBeta float64 `json:"yearBeta"`
YearStdev float64 `json:"yearStdev"`
YtdReturn float64 `json:"ytdReturn"`
YearMomentum float64 `json:"yearMomentum"`
YearlyReturn float64 `json:"yearlyReturn"`
MonthlyReturn float64 `json:"monthlyReturn"`
FiveYearReturn float64 `json:"fiveYearReturn"`
SixMonthReturn float64 `json:"sixMonthReturn"`
ThreeYearReturn float64 `json:"threeYearReturn"`
ThreeMonthReturn float64 `json:"threeMonthReturn"`
}
type FundType ¶
type FundType string
const ( FundTypeStockUmbrella FundType = "STOCK_UMBRELLA_FUND" FundTypeVariableUmbrella FundType = "VARIABLE_UMBRELLA_FUND" FundTypeParticipationUmbrella FundType = "PARTICIPATION_UMBRELLA_FUND" FundTypeFlexibleUmbrella FundType = "FLEXIBLE_UMBRELLA_FUND" FundTypeFundBasketUmbrella FundType = "FUND_BASKET_UMBRELLA_FUND" FundTypeMoneyMarketUmbrella FundType = "MONEY_MARKET_UMBRELLA_FUND" FundTypePreciousMetalsUmbrella FundType = "PRECIOUS_METALS_UMBRELLA_FUND" FundTypeDebtInstrumentsUmbrella FundType = "DEBT_INSTRUMENTS_UMBRELLA_FUND" FundTypeMixedUmbrella FundType = "MIXED_UMBRELLA_FUND" FundTypeUnknown FundType = "UNKNOWN_FUND_TYPE" )
type GenerateChartImageRequest ¶
type GenerateChartImageRequest struct {
Symbol string
Period HistoricalPricePeriod
Region Region
Resolution HistoricalPriceInterval
Indicators []string
ChartType *int
}
type GetNewsApiSourceNamesParams ¶
GetNewsApiSourceNamesParams holds the optional parameters for the news api-source-names endpoint.
type GetNewsHighlightsParams ¶
type GetNewsHighlightsParams struct {
Region Region
Locale Locale
From string
To string
Skip *int
Top *int
}
GetNewsHighlightsParams holds the parameters for the news highlights endpoint. Region (which must be RegionUs) and Locale are required. From/To (YYYY-MM-DD) narrow the result to highlights created in that window; Skip/Top page the result, where Top is the page size (1-20).
type GetNewsLanesParams ¶
type GetNewsLanesParams struct {
// Region, when set (RegionTr or RegionUs), restricts the result to lanes valid for that region.
Region Region
}
GetNewsLanesParams holds the optional parameters for the news lanes endpoint.
type GetNewsParams ¶
type GetNewsParams struct {
Region Region
Locale Locale
NewsType NewsType
Lane NewsLane
Page *int
Size *int
OrderBy NewsOrderBy
OrderByDirection SortDirection
Symbols string
CategoryIds string
SectorIds string
IndustryIds string
ApiSource string
QualityScoreMin *int
QualityScoreMax *int
TimestampFrom string
TimestampTo string
}
type HistoricalFinancialSheets ¶
type HistoricalFinancialSheets struct {
Sheets []HistoricalFinancialSheet `json:"sheets"`
}
type HistoricalFundPricePeriod ¶
type HistoricalFundPricePeriod string
const ( HistoricalFundPricePeriodOneWeek HistoricalFundPricePeriod = "1H" HistoricalFundPricePeriodOneMonth HistoricalFundPricePeriod = "1A" HistoricalFundPricePeriodThreeMonth HistoricalFundPricePeriod = "3A" HistoricalFundPricePeriodOneYear HistoricalFundPricePeriod = "1Y" HistoricalFundPricePeriodThreeYear HistoricalFundPricePeriod = "3Y" HistoricalFundPricePeriodFiveYear HistoricalFundPricePeriod = "5Y" )
type HistoricalPriceDate ¶
type HistoricalPriceInterval ¶
type HistoricalPriceInterval string
const ( HistoricalPriceIntervalOneMinute HistoricalPriceInterval = "1m" HistoricalPriceIntervalThreeMinute HistoricalPriceInterval = "3m" HistoricalPriceIntervalFiveMinute HistoricalPriceInterval = "5m" HistoricalPriceIntervalFifteenMinute HistoricalPriceInterval = "15m" HistoricalPriceIntervalThirtyMinute HistoricalPriceInterval = "30m" HistoricalPriceIntervalOneHour HistoricalPriceInterval = "1h" HistoricalPriceIntervalTwoHour HistoricalPriceInterval = "2h" HistoricalPriceIntervalOneDay HistoricalPriceInterval = "1d" HistoricalPriceIntervalFiveDay HistoricalPriceInterval = "5d" HistoricalPriceIntervalSevenDay HistoricalPriceInterval = "7d" HistoricalPriceIntervalThirtyDay HistoricalPriceInterval = "30d" )
type HistoricalPricePeriod ¶
type HistoricalPricePeriod string
const ( HistoricalPricePeriodOneDay HistoricalPricePeriod = "1D" HistoricalPricePeriodOneWeek HistoricalPricePeriod = "1W" HistoricalPricePeriodOneMonth HistoricalPricePeriod = "1M" HistoricalPricePeriodThreeMonth HistoricalPricePeriod = "3M" HistoricalPricePeriodOneYear HistoricalPricePeriod = "1Y" HistoricalPricePeriodTwoYear HistoricalPricePeriod = "2Y" HistoricalPricePeriodThreeYear HistoricalPricePeriod = "3Y" HistoricalPricePeriodSixMonth HistoricalPricePeriod = "6M" HistoricalPricePeriodFiveYear HistoricalPricePeriod = "5Y" HistoricalPricePeriodAll HistoricalPricePeriod = "All" )
type HistoricalRatiosKey ¶
type HistoricalRatiosKey string
const ( HistoricalRatiosKeyGrossMargin HistoricalRatiosKey = "gross-margin" HistoricalRatiosKeyEBITDA HistoricalRatiosKey = "ebitda" HistoricalRatiosKeyPERatio HistoricalRatiosKey = "pe-ratio" HistoricalRatiosKeyOperatingMargin HistoricalRatiosKey = "favok_marji" HistoricalRatiosKeyFreeCashFlowGrowth HistoricalRatiosKey = "serbest_nakit_akisi_buyumesi" HistoricalRatiosKeyDaysPayable HistoricalRatiosKey = "days-payable" HistoricalRatiosKeyInventoryTurnover HistoricalRatiosKey = "inventory-turnover" HistoricalRatiosKeyDepositGrowth HistoricalRatiosKey = "mevduat_buyumesi" HistoricalRatiosKeyNetInterestMargin HistoricalRatiosKey = "net_faiz_marji" HistoricalRatiosKeyClaimPaymentsGrowth HistoricalRatiosKey = "gerceklesen_tazminatlar_buyumesi" HistoricalRatiosKeyClaimsPerPremiumRatio HistoricalRatiosKey = "prim_basina_tazminat_orani" HistoricalRatiosKeyEVToOCF HistoricalRatiosKey = "evOcf" HistoricalRatiosKeyEVToIC HistoricalRatiosKey = "evic" HistoricalRatiosKeyEBT HistoricalRatiosKey = "ebt" HistoricalRatiosKeyCAPEX HistoricalRatiosKey = "capex" HistoricalRatiosKeyFinancialInvestments HistoricalRatiosKey = "financial_investments" HistoricalRatiosKeyRealtimeEPSBasic HistoricalRatiosKey = "realtime_eps-basic" HistoricalRatiosKeyQuickRatio HistoricalRatiosKey = "quick-ratio" HistoricalRatiosKeyEVToEBITDA HistoricalRatiosKey = "ev-to-ebitda" HistoricalRatiosKeyROCE HistoricalRatiosKey = "roce" HistoricalRatiosKeyROIC HistoricalRatiosKey = "roic" HistoricalRatiosKeyROA HistoricalRatiosKey = "roa" HistoricalRatiosKeyDaysSalesOutstanding HistoricalRatiosKey = "days-sales-outstanding" HistoricalRatiosKeyLoanToAssetRatio HistoricalRatiosKey = "kredi_aktif_orani" HistoricalRatiosKeyLoanToDepositRatio HistoricalRatiosKey = "kredi_mevduat_orani" HistoricalRatiosKeyTechnicalProfitGrowth HistoricalRatiosKey = "teknik_kar_buyumesi" HistoricalRatiosKeyNetPremiumEarnedGrowth HistoricalRatiosKey = "net_kazanilan_prim_buyumesi" HistoricalRatiosKeyEBITGrowth HistoricalRatiosKey = "ebitGrowth" HistoricalRatiosKeyCROIC HistoricalRatiosKey = "croic" HistoricalRatiosKeyRealtimeMarketValue HistoricalRatiosKey = "realtime_piyasa_degeri" HistoricalRatiosKeyRealtimePBRatio HistoricalRatiosKey = "realtime_pb-ratio" HistoricalRatiosKeyRealtimePERatio HistoricalRatiosKey = "realtime_pe-ratio" HistoricalRatiosKeyCurrentRatio HistoricalRatiosKey = "current-ratio" HistoricalRatiosKeyDaysInventory HistoricalRatiosKey = "days-inventory" HistoricalRatiosKeyNetMargin HistoricalRatiosKey = "net-margin" HistoricalRatiosKeySalesGrowth HistoricalRatiosKey = "satis_buyumesi" HistoricalRatiosKeyROE HistoricalRatiosKey = "roe" HistoricalRatiosKeyAssetTurnover HistoricalRatiosKey = "asset-turnover" HistoricalRatiosKeyLeverageRatio HistoricalRatiosKey = "leverage-ratio" HistoricalRatiosKeySales HistoricalRatiosKey = "satislar" HistoricalRatiosKeyNetProfit HistoricalRatiosKey = "net_kar" HistoricalRatiosKeyInterestCoverage HistoricalRatiosKey = "interestCoverage" HistoricalRatiosKeyTotalOperationalExpense HistoricalRatiosKey = "total_operational_expense" HistoricalRatiosKeyTotalOperationalExpenseToGrossProfit HistoricalRatiosKey = "total_operational_expense_gross_profit_ratio" HistoricalRatiosKeyCashAndCashEquivalents HistoricalRatiosKey = "cash_and_cash_equivalents" HistoricalRatiosKeyCashToAssets HistoricalRatiosKey = "cash_to_assets" HistoricalRatiosKeyCAPEXToNetProfit HistoricalRatiosKey = "capex_to_net_profit" HistoricalRatiosKeyRealtimeEVToEBITDA HistoricalRatiosKey = "realtime_ev-to-ebitda" HistoricalRatiosKeyReceivablesTurnover HistoricalRatiosKey = "alacak_devir_hizi" HistoricalRatiosKeyEPSBasic HistoricalRatiosKey = "eps-basic" HistoricalRatiosKeyNetProfitGrowth HistoricalRatiosKey = "net_kar_buyumesi" HistoricalRatiosKeyDebtToEquity HistoricalRatiosKey = "debt-to-equity" HistoricalRatiosKeyNetDebtToEBITDA HistoricalRatiosKey = "net_borc_favok" HistoricalRatiosKeyPBRatio HistoricalRatiosKey = "pb-ratio" HistoricalRatiosKeyEBITDAGrowth HistoricalRatiosKey = "favok_buyumesi" HistoricalRatiosKeyCashConversionCycle HistoricalRatiosKey = "cash-conversion-cycle" HistoricalRatiosKeyGrossProfitGrowth HistoricalRatiosKey = "brut_kar_buyumesi" HistoricalRatiosKeyLoanGrowth HistoricalRatiosKey = "kredi_buyumesi" HistoricalRatiosKeyGrossWrittenPremiumGrowth HistoricalRatiosKey = "brut_yazilan_prim_buyumesi" HistoricalRatiosKeyTechnicalProfitMargin HistoricalRatiosKey = "teknik_kar_marji" HistoricalRatiosKeyCompanyPremiumRetentionRatio HistoricalRatiosKey = "sirketin_prim_tutma_orani" HistoricalRatiosKeyMarketValue HistoricalRatiosKey = "piyasa_degeri" HistoricalRatiosKeyFinancialExpensesToEBITRatio HistoricalRatiosKey = "financial_expenses_ebit_ratio" HistoricalRatiosKeyShortTermToLongTermObligations HistoricalRatiosKey = "short_term_obligations_long_term_obligations" HistoricalRatiosKeyRetainedEarnings HistoricalRatiosKey = "retained_earnings" HistoricalRatiosKeyThreeYearCAGRFreeCashFlow HistoricalRatiosKey = "three_year_cagr_free_cash_flow" HistoricalRatiosKeyPOE HistoricalRatiosKey = "poe" HistoricalRatiosKeyLongTermLoansToPeriodProfit HistoricalRatiosKey = "long_term_loans_period_profit_ratio" HistoricalRatiosKeyLongTermLoans HistoricalRatiosKey = "long_term_loans" HistoricalRatiosKeyCommercialReceivablesToCurrentAssets HistoricalRatiosKey = "commercial_receivables_total_current_assets" HistoricalRatiosKeyStockGrowth HistoricalRatiosKey = "stock_growth" HistoricalRatiosKeyFiveYearRetainedEarningsChange HistoricalRatiosKey = "five_year_retained_earnings_change" HistoricalRatiosKeyThreeYearCAGRRetainedEarnings HistoricalRatiosKey = "three_year_cagr_retained_earnings" HistoricalRatiosKeyPOCF HistoricalRatiosKey = "pocf" HistoricalRatiosKeyFCFToEV HistoricalRatiosKey = "fcfEv" HistoricalRatiosKeyDD HistoricalRatiosKey = "dd" HistoricalRatiosKeyNetDebt HistoricalRatiosKey = "net_borc" HistoricalRatiosKeyPaidInCapital HistoricalRatiosKey = "odenmis_sermaye" )
type HoldingShort ¶
type KeyInsight ¶
type LaplaceConfiguration ¶
type LaplaceConfiguration struct {
APIKey string `split_words:"true"`
BaseURL string `split_words:"true"`
}
func LoadGlobal ¶
func LoadGlobal(filename string) (*LaplaceConfiguration, error)
LoadGlobal loads configuration from environment variables and optionally from a .env file.
func (*LaplaceConfiguration) ApplyDefaults ¶
func (c *LaplaceConfiguration) ApplyDefaults()
ApplyDefaults sets default values for configuration fields that are not provided.
func (*LaplaceConfiguration) Validate ¶
func (c *LaplaceConfiguration) Validate() error
Validate performs validation checks on the configuration.
type LaplaceError ¶
type LaplaceError error
var ( ErrYouDoNotHaveAccessToEndpoint LaplaceError = errors.New("you do not have access to this endpoint") ErrLimitExceeded LaplaceError = errors.New("limit exceeded") ErrEndpointIsNotActive LaplaceError = errors.New("endpoint is not active") ErrInvalidToken LaplaceError = errors.New("invalid token") ErrInvalidID LaplaceError = errors.New("invalid object id") )
type LaplaceHTTPError ¶
type LaplaceHTTPError struct {
HTTPStatus int `json:"code"`
Message LaplaceHTTPErrorMsg `json:"msg"`
InternalError error `json:"-"`
}
func HttpError ¶
func HttpError(httpStatus int, fmtString string, args ...interface{}) *LaplaceHTTPError
func (*LaplaceHTTPError) Cause ¶
func (e *LaplaceHTTPError) Cause() error
Cause returns the root cause error
func (*LaplaceHTTPError) Error ¶
func (e *LaplaceHTTPError) Error() string
func (*LaplaceHTTPError) Is ¶
func (e *LaplaceHTTPError) Is(target error) bool
func (*LaplaceHTTPError) Unwrap ¶
func (e *LaplaceHTTPError) Unwrap() error
func (*LaplaceHTTPError) WithInternalError ¶
func (e *LaplaceHTTPError) WithInternalError(err error) *LaplaceHTTPError
WithInternalError adds internal error information to the error
type LaplaceHTTPErrorMsg ¶
type LiveMessageV2 ¶
type LiveMessageV2[T any] struct { Type MessageType `json:"t"` Data T `json:"d"` }
LiveMessageV2 is the envelope used by the v2 price feeds (live and delayed
BIST prices, US prices, BIST bid/ask). On the wire every event looks like
{"t":"
- MessageTypePrice ("pr"): Data holds a price tick.
- MessageTypeHeartbeat ("heartbeat"): sent every 10 seconds with no "d", so Data is the zero value.
- MessageTypeStateChange ("state_change"): emitted on the BIST live and delayed feeds when a market or stock changes state, as {"t":"state_change","d":{"marketSymbol":..,"stockSymbol":..,"state":..,"time":..}}. Market-level events reach every subscriber regardless of the symbol filter. That payload does not match T, so Data is the zero value; the state payload is not decoded yet.
type LivePriceResult ¶
type LivePriceStream ¶
type LivePriceStream[T any] struct { // contains filtered or unexported fields }
LivePriceStream handles live price streaming for a specific region and type
func NewLivePriceStream ¶
func NewLivePriceStream[T any](client *Client, priceType LivePriceType, region Region) *LivePriceStream[T]
NewLivePriceStream creates a new LivePriceStream
func (*LivePriceStream[T]) Close ¶
func (s *LivePriceStream[T]) Close() error
Close closes the stream and cleanup resources
func (*LivePriceStream[T]) Receive ¶
func (s *LivePriceStream[T]) Receive() <-chan LivePriceResult[T]
Receive returns a channel to receive live price data. The channel is closed when Close is called, when the context passed to Subscribe is cancelled, when the server ends the stream, or when Subscribe is called again.
func (*LivePriceStream[T]) Subscribe ¶
func (s *LivePriceStream[T]) Subscribe(ctx context.Context, symbols []string) error
Subscribe subscribes to live price updates for the given symbols. Calling Subscribe on a stream that is already subscribed switches it to the new symbols: the channel previously returned by Receive is closed and a fresh one is created, so call Receive again afterwards.
type LivePriceType ¶
type LivePriceType string
LivePriceType represents the type of live price stream
const ( LivePriceTypePrice LivePriceType = "price" LivePriceTypeDelayedPrice LivePriceType = "delayed-price" LivePriceTypeOrderBook LivePriceType = "order-book" LivePriceTypeBidAsk LivePriceType = "bid-ask" )
type LocaleString ¶
type MarketState ¶
type MessageCode ¶
type MessageCode string
const ( MessageCodeNewUser MessageCode = "new_user" MessageCodeHasNoAccessToLevel MessageCode = "no_access_to_level" )
type MessageType ¶
type MessageType string
MessageType represents the type of message in live data streams
const ( MessageTypePrice MessageType = "pr" MessageTypeStateChange MessageType = "state_change" MessageTypeHeartbeat MessageType = "heartbeat" MessageTypeOrderbook MessageType = "ob" )
type News ¶
type News struct {
ID string `json:"id"`
URL string `json:"url"`
ImageUrl string `json:"imageUrl"`
Timestamp time.Time `json:"timestamp"`
PublisherUrl string `json:"publisherUrl"`
Publisher NewsPublisher `json:"publisher"`
RelatedTickers []NewsTicker `json:"relatedTickers"`
QualityScore int64 `json:"qualityScore"`
CreatedAt time.Time `json:"createdAt"`
Tickers []NewsTicker `json:"tickers,omitempty"`
Categories *NewsCategories `json:"categories,omitempty"`
Sectors *NewsSector `json:"sectors,omitempty"`
Content *NewsContent `json:"content,omitempty"`
Industries *NewsIndustry `json:"industries,omitempty"`
}
type NewsApiSource ¶
NewsApiSource is a configured upstream news source as returned by the News API Source Names endpoint. The ID value is accepted by the `apiSource` filter of the News and Live News Stream endpoints (comma-separated for multiple); Name is the human-readable display name (e.g. "BBC Business", "Gazete Oksijen").
type NewsCategories ¶
type NewsCategory ¶
NewsCategory is a canonical news category with a localized name, as returned by the News Categories endpoint. The Name value is the exact value accepted by the `categories` filter of the News V2 and Live News Stream endpoints.
type NewsContent ¶
type NewsHighlight ¶
type NewsHighlight struct {
ID string `json:"id"`
CreatedAt time.Time `json:"createdAt"`
Consumer []string `json:"consumer"`
EnergyAndUtilities []string `json:"energyAndUtilities"`
Finance []string `json:"finance"`
Healthcare []string `json:"healthcare"`
IndustrialsAndMaterials []string `json:"industrialsAndMaterials"`
Tech []string `json:"tech"`
Other []string `json:"other"`
}
NewsHighlight is a single dated highlights record, with the top news items bucketed by sector group. It is one item of the paginated News Highlights response.
type NewsIndustry ¶
type NewsLane ¶
type NewsLane string
NewsLane is a curated news surface that groups upstream sources. It is accepted by the `lane` filter of the News, News V2, and Live News Stream endpoints. US lanes are NewsLaneGlobalMacro and NewsLaneFastMovers; TR lanes are NewsLaneTrEkonomi and NewsLaneBist.
type NewsLaneInfo ¶
NewsLaneInfo is a selectable news lane as returned by the News Lanes endpoint. The ID value is the exact value accepted by the `lane` filter of the News, News V2, and Live News Stream endpoints.
type NewsOrderBy ¶
type NewsOrderBy string
const ( NewsOrderByTimestamp NewsOrderBy = "timestamp" NewsOrderByQualityScore NewsOrderBy = "quality_score" )
type NewsPublisher ¶
type NewsSector ¶
type NewsStream ¶
type NewsStream struct {
// contains filtered or unexported fields
}
NewsStream handles live news streaming for a specific locale and filters
func (*NewsStream) Close ¶
func (s *NewsStream) Close() error
Close closes the stream and cleanup resources
func (*NewsStream) Receive ¶
func (s *NewsStream) Receive() <-chan NewsStreamResult
Receive returns a channel to receive news data
type NewsStreamResult ¶
NewsStreamResult is the result type for news streams
type NewsTicker ¶
type NewsV2 ¶
type NewsV2 struct {
ID string `json:"id"`
URL string `json:"url"`
ImageUrl string `json:"imageUrl"`
Timestamp time.Time `json:"timestamp"`
PublisherUrl string `json:"publisherUrl"`
Publisher NewsPublisher `json:"publisher"`
QualityScore int64 `json:"qualityScore"`
CreatedAt time.Time `json:"createdAt"`
Tickers []NewsTicker `json:"tickers,omitempty"`
Categories *NewsCategories `json:"categories,omitempty"`
Sectors *NewsSector `json:"sectors,omitempty"`
Content *NewsContent `json:"content,omitempty"`
Industries *NewsIndustry `json:"industries,omitempty"`
}
type OrderbookDeletedLevel ¶
OrderbookDeletedLevel represents a deleted level in the orderbook
type OrderbookLevel ¶
type OrderbookLevel struct {
ID int `json:"level"`
Side LevelSide `json:"side"`
Volume float64 `json:"vol"`
Orders int `json:"orders"`
Price float64 `json:"p"`
}
OrderbookLevel represents a single level in the orderbook
type PaginatedResponse ¶
type PaginationPageSize ¶
type PaginationPageSize int
const ( PageSize10 PaginationPageSize = 10 PageSize20 PaginationPageSize = 20 PageSize50 PaginationPageSize = 50 )
type Politician ¶
type PoliticianDetail ¶
type PriceDataPoint ¶
type PriceDataPoint struct {
Date int64 `json:"d"`
Open float64 `json:"o"`
UnadjustedOpen float64 `json:"uo,omitempty"`
High float64 `json:"h"`
UnadjustedHigh float64 `json:"uh,omitempty"`
Low float64 `json:"l"`
UnadjustedLow float64 `json:"ul,omitempty"`
Close float64 `json:"c"`
UnadjustedClose float64 `json:"uc,omitempty"`
Volume float64 `json:"v,omitempty"`
UnadjustedVol float64 `json:"uv,omitempty"`
}
type ScreenerFilters ¶
type ScreenerFilters struct {
Price *ScreenerRange `json:"price,omitempty"`
DailyChange *ScreenerRange `json:"dailyChange,omitempty"`
MarketCap *ScreenerRange `json:"marketCap,omitempty"`
PERatio *ScreenerRange `json:"peRatio,omitempty"`
PBRatio *ScreenerRange `json:"pbRatio,omitempty"`
WeeklyReturn *ScreenerRange `json:"weeklyReturn,omitempty"`
MonthlyReturn *ScreenerRange `json:"monthlyReturn,omitempty"`
ThreeMonthReturn *ScreenerRange `json:"threeMonthReturn,omitempty"`
YearlyReturn *ScreenerRange `json:"yearlyReturn,omitempty"`
ThreeYearReturn *ScreenerRange `json:"threeYearReturn,omitempty"`
FiveYearReturn *ScreenerRange `json:"fiveYearReturn,omitempty"`
YTDReturn *ScreenerRange `json:"ytdReturn,omitempty"`
CompositeRating *ScreenerRange `json:"compositeRating,omitempty"`
CompositeScore *ScreenerRange `json:"compositeScore,omitempty"`
RSRating *ScreenerRange `json:"rsRating,omitempty"`
RSScore *ScreenerRange `json:"rsScore,omitempty"`
PerfQ1 *ScreenerRange `json:"perfQ1,omitempty"`
PerfQ2 *ScreenerRange `json:"perfQ2,omitempty"`
PerfQ3 *ScreenerRange `json:"perfQ3,omitempty"`
PerfQ4 *ScreenerRange `json:"perfQ4,omitempty"`
EPSRating *ScreenerRange `json:"epsRating,omitempty"`
EPSScore *ScreenerRange `json:"epsScore,omitempty"`
EPSGrowthYoY *ScreenerRange `json:"epsGrowthYoy,omitempty"`
EPSGrowthQoQ *ScreenerRange `json:"epsGrowthQoq,omitempty"`
EPSTrailing4Q *ScreenerRange `json:"epsTrailing4q,omitempty"`
ADScore *ScreenerRange `json:"adScore,omitempty"`
UpVolumeRatio *ScreenerRange `json:"upVolumeRatio,omitempty"`
VolumeTrend *ScreenerRange `json:"volumeTrend,omitempty"`
SMRScore *ScreenerRange `json:"smrScore,omitempty"`
SalesGrowth2Q *ScreenerRange `json:"salesGrowth2q,omitempty"`
GrossMargin *ScreenerRange `json:"grossMargin,omitempty"`
NetMargin *ScreenerRange `json:"netMargin,omitempty"`
ROE *ScreenerRange `json:"roe,omitempty"`
SMA20 *ScreenerRange `json:"sma20,omitempty"`
SMA50 *ScreenerRange `json:"sma50,omitempty"`
SMA150 *ScreenerRange `json:"sma150,omitempty"`
SMA200 *ScreenerRange `json:"sma200,omitempty"`
VolumeSMA50 *ScreenerRange `json:"volumeSma50,omitempty"`
PriceVsSMA20 *ScreenerRange `json:"priceVsSma20,omitempty"`
PriceVsSMA50 *ScreenerRange `json:"priceVsSma50,omitempty"`
PriceVsSMA150 *ScreenerRange `json:"priceVsSma150,omitempty"`
PriceVsSMA200 *ScreenerRange `json:"priceVsSma200,omitempty"`
High52W *ScreenerRange `json:"high52w,omitempty"`
Low52W *ScreenerRange `json:"low52w,omitempty"`
OffHighPct *ScreenerRange `json:"offHighPct,omitempty"`
VolumeVsAvg50 *ScreenerRange `json:"volumeVsAvg50,omitempty"`
PriceChangePct *ScreenerRange `json:"priceChangePct,omitempty"`
PriceChangeAmount *ScreenerRange `json:"priceChangeAmount,omitempty"`
YTDChangePct *ScreenerRange `json:"ytdChangePct,omitempty"`
// Letter-grade IN-lists; values must be A..E.
SMRRating []ScreenerRating `json:"smrRating,omitempty"`
ADRating []ScreenerRating `json:"adRating,omitempty"`
// EPSAcceleration filters for stocks whose earnings growth is accelerating.
EPSAcceleration *bool `json:"epsAcceleration,omitempty"`
}
ScreenerFilters holds the optional filter set. Every field is a range filter except SMRRating/ADRating (letter-grade IN-lists) and EPSAcceleration (bool).
type ScreenerItem ¶
type ScreenerItem struct {
Symbol string `json:"symbol"`
Price *float64 `json:"price"`
DailyChange *float64 `json:"dailyChange"`
MarketCap *float64 `json:"marketCap"`
PERatio *float64 `json:"peRatio"`
PBRatio *float64 `json:"pbRatio"`
WeeklyReturn *float64 `json:"weeklyReturn"`
MonthlyReturn *float64 `json:"monthlyReturn"`
ThreeMonthReturn *float64 `json:"threeMonthReturn"`
YearlyReturn *float64 `json:"yearlyReturn"`
ThreeYearReturn *float64 `json:"threeYearReturn"`
FiveYearReturn *float64 `json:"fiveYearReturn"`
YTDReturn *float64 `json:"ytdReturn"`
CompositeRating *int `json:"compositeRating"`
CompositeScore *float64 `json:"compositeScore"`
RSRating *int `json:"rsRating"`
RSScore *float64 `json:"rsScore"`
PerfQ1 *float64 `json:"perfQ1"`
PerfQ2 *float64 `json:"perfQ2"`
PerfQ3 *float64 `json:"perfQ3"`
PerfQ4 *float64 `json:"perfQ4"`
EPSRating *int `json:"epsRating"`
EPSScore *float64 `json:"epsScore"`
EPSGrowthYoY *float64 `json:"epsGrowthYoy"`
EPSGrowthQoQ *float64 `json:"epsGrowthQoq"`
EPSTrailing4Q *float64 `json:"epsTrailing4q"`
EPSAcceleration *bool `json:"epsAcceleration"`
ADRating *ScreenerRating `json:"adRating"`
ADScore *float64 `json:"adScore"`
UpVolumeRatio *float64 `json:"upVolumeRatio"`
VolumeTrend *float64 `json:"volumeTrend"`
SMRRating *ScreenerRating `json:"smrRating"`
SMRScore *float64 `json:"smrScore"`
SalesGrowth2Q *float64 `json:"salesGrowth2q"`
GrossMargin *float64 `json:"grossMargin"`
NetMargin *float64 `json:"netMargin"`
ROE *float64 `json:"roe"`
SMA20 *float64 `json:"sma20"`
SMA50 *float64 `json:"sma50"`
SMA150 *float64 `json:"sma150"`
SMA200 *float64 `json:"sma200"`
VolumeSMA50 *float64 `json:"volumeSma50"`
PriceVsSMA20 *float64 `json:"priceVsSma20"`
PriceVsSMA50 *float64 `json:"priceVsSma50"`
PriceVsSMA150 *float64 `json:"priceVsSma150"`
PriceVsSMA200 *float64 `json:"priceVsSma200"`
High52W *float64 `json:"high52w"`
Low52W *float64 `json:"low52w"`
OffHighPct *float64 `json:"offHighPct"`
VolumeVsAvg50 *float64 `json:"volumeVsAvg50"`
PriceChangePct *float64 `json:"priceChangePct"`
PriceChangeAmount *float64 `json:"priceChangeAmount"`
YTDChangePct *float64 `json:"ytdChangePct"`
}
ScreenerItem is one row of screener results. Decimal fields return 0 when a value is absent; the integer ratings, letter grades and EPSAcceleration are pointers because they are null when absent.
type ScreenerRange ¶
type ScreenerRange struct {
Min *float64 `json:"min,omitempty"`
Max *float64 `json:"max,omitempty"`
}
ScreenerRange is an inclusive [Min, Max] filter; both bounds are optional. If both are set, Min must be <= Max. Rows whose value is NULL in a column are excluded by any range filter touching that column.
type ScreenerRating ¶
type ScreenerRating string
ScreenerRating is an IBD-style letter grade (A is best, E is worst) used by the SMR and Accumulation/Distribution ratings.
const ( ScreenerRatingA ScreenerRating = "A" ScreenerRatingB ScreenerRating = "B" ScreenerRatingC ScreenerRating = "C" ScreenerRatingD ScreenerRating = "D" ScreenerRatingE ScreenerRating = "E" )
type ScreenerRequest ¶
type ScreenerRequest struct {
Filters *ScreenerFilters `json:"filters,omitempty"`
SortBy ScreenerSortBy `json:"sortBy,omitempty"`
SortOrder SortDirection `json:"sortOrder,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pageSize,omitempty"`
}
type ScreenerResponse ¶
type ScreenerResponse struct {
Items []ScreenerItem `json:"items"`
RecordCount int `json:"recordCount"`
}
type ScreenerSortBy ¶
type ScreenerSortBy string
const ( ScreenerSortBySymbol ScreenerSortBy = "symbol" ScreenerSortByPrice ScreenerSortBy = "price" ScreenerSortByDailyChange ScreenerSortBy = "dailyChange" ScreenerSortByMarketCap ScreenerSortBy = "marketCap" ScreenerSortByPERatio ScreenerSortBy = "peRatio" ScreenerSortByPBRatio ScreenerSortBy = "pbRatio" ScreenerSortByWeeklyReturn ScreenerSortBy = "weeklyReturn" ScreenerSortByMonthlyReturn ScreenerSortBy = "monthlyReturn" ScreenerSortByThreeMonthReturn ScreenerSortBy = "threeMonthReturn" ScreenerSortByYearlyReturn ScreenerSortBy = "yearlyReturn" ScreenerSortByThreeYearReturn ScreenerSortBy = "threeYearReturn" ScreenerSortByFiveYearReturn ScreenerSortBy = "fiveYearReturn" ScreenerSortByYTDReturn ScreenerSortBy = "ytdReturn" ScreenerSortByCompositeRating ScreenerSortBy = "compositeRating" ScreenerSortByCompositeScore ScreenerSortBy = "compositeScore" ScreenerSortByRSRating ScreenerSortBy = "rsRating" ScreenerSortByRSScore ScreenerSortBy = "rsScore" ScreenerSortByPerfQ1 ScreenerSortBy = "perfQ1" ScreenerSortByPerfQ2 ScreenerSortBy = "perfQ2" ScreenerSortByPerfQ3 ScreenerSortBy = "perfQ3" ScreenerSortByPerfQ4 ScreenerSortBy = "perfQ4" ScreenerSortByEPSRating ScreenerSortBy = "epsRating" ScreenerSortByEPSScore ScreenerSortBy = "epsScore" ScreenerSortByEPSGrowthYoY ScreenerSortBy = "epsGrowthYoy" ScreenerSortByEPSGrowthQoQ ScreenerSortBy = "epsGrowthQoq" ScreenerSortByEPSTrailing4Q ScreenerSortBy = "epsTrailing4q" ScreenerSortByEPSAcceleration ScreenerSortBy = "epsAcceleration" ScreenerSortByADRating ScreenerSortBy = "adRating" ScreenerSortByADScore ScreenerSortBy = "adScore" ScreenerSortByUpVolumeRatio ScreenerSortBy = "upVolumeRatio" ScreenerSortByVolumeTrend ScreenerSortBy = "volumeTrend" ScreenerSortBySMRRating ScreenerSortBy = "smrRating" ScreenerSortBySMRScore ScreenerSortBy = "smrScore" ScreenerSortBySalesGrowth2Q ScreenerSortBy = "salesGrowth2q" ScreenerSortByGrossMargin ScreenerSortBy = "grossMargin" ScreenerSortByNetMargin ScreenerSortBy = "netMargin" ScreenerSortByROE ScreenerSortBy = "roe" ScreenerSortBySMA20 ScreenerSortBy = "sma20" ScreenerSortBySMA50 ScreenerSortBy = "sma50" ScreenerSortBySMA150 ScreenerSortBy = "sma150" ScreenerSortBySMA200 ScreenerSortBy = "sma200" ScreenerSortByVolumeSMA50 ScreenerSortBy = "volumeSma50" ScreenerSortByPriceVsSMA20 ScreenerSortBy = "priceVsSma20" ScreenerSortByPriceVsSMA50 ScreenerSortBy = "priceVsSma50" ScreenerSortByPriceVsSMA150 ScreenerSortBy = "priceVsSma150" ScreenerSortByPriceVsSMA200 ScreenerSortBy = "priceVsSma200" ScreenerSortByHigh52W ScreenerSortBy = "high52w" ScreenerSortByLow52W ScreenerSortBy = "low52w" ScreenerSortByOffHighPct ScreenerSortBy = "offHighPct" ScreenerSortByVolumeVsAvg50 ScreenerSortBy = "volumeVsAvg50" ScreenerSortByPriceChangePct ScreenerSortBy = "priceChangePct" ScreenerSortByPriceChangeAmount ScreenerSortBy = "priceChangeAmount" ScreenerSortByYTDChangePct ScreenerSortBy = "ytdChangePct" )
Sort keys. Any range-filter field is sortable, plus the smrRating/adRating letter grades, epsAcceleration and symbol. Results are ordered by the chosen column (NULLS LAST) then by symbol ASC.
type SearchResponse ¶
type SearchResponse struct {
Stocks []SearchResponseStock `json:"stocks"`
Collections []SearchResponseCollection `json:"collections"`
Sectors []SearchResponseCollection `json:"sectors"`
Industries []SearchResponseCollection `json:"industries"`
}
type SearchResponseStock ¶
type SearchType ¶
type SearchType string
const ( SearchTypeStock SearchType = "stock" SearchTypeCollection SearchType = "collection" SearchTypeSector SearchType = "sector" SearchTypeIndustry SearchType = "industry" )
type SendWebsocketEventRequest ¶
type SendWebsocketEventRequest struct {
ExternalUserID string `json:"externalUserID,omitempty"`
Event json.RawMessage `json:"event"`
Transient *bool `json:"transient,omitempty"`
BroadCastToAll bool `json:"broadCastToAll"`
}
type SortDirection ¶
type SortDirection string
const ( SortDirectionDesc SortDirection = "desc" SortDirectionAsc SortDirection = "asc" )
type Stock ¶
type Stock struct {
ID primitive.ObjectID `json:"id"`
AssetType AssetType `json:"assetType"`
Name string `json:"name"`
Symbol string `json:"symbol"`
SectorId string `json:"sectorId"`
IndustryId string `json:"industryId"`
UpdatedDate time.Time `json:"updatedDate"`
DailyChange float64 `json:"dailyChange,omitempty"`
Active bool `json:"active"`
}
type StockDetail ¶
type StockDetail struct {
ID primitive.ObjectID `json:"id"`
AssetType AssetType `json:"assetType"`
AssetClass AssetClass `json:"assetClass"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Description string `json:"description"`
LocalizedDescription LocaleString `json:"localized_description"`
ShortDescription string `json:"shortDescription"`
LocalizedShortDescription LocaleString `json:"localizedShortDescription"`
Region string `json:"region"`
SectorId string `json:"sectorId"`
IndustryId string `json:"industryId"`
UpdatedDate time.Time `json:"updatedDate"`
Active bool `json:"active"`
Markets []Market `json:"markets,omitempty"`
}
type StockDividend ¶
type StockDividend struct {
Date time.Time `json:"date"`
Currency Currency `json:"currency"`
NetAmount float64 `json:"netAmount"`
NetRatio float64 `json:"netRatio"`
GrossAmount float64 `json:"grossAmount"`
GrossRatio float64 `json:"grossRatio"`
PriceThen float64 `json:"priceThen"`
StoppageRatio float64 `json:"stoppageRatio"`
StoppageAmount float64 `json:"stoppageAmount"`
}
type StockHistoricalRatios ¶
type StockHistoricalRatios struct {
Items []StockHistoricalRatiosData `json:"items"`
FinalValue float64 `json:"finalValue"`
ThreeYearGrowth float64 `json:"threeYearGrowth"`
YearGrowth float64 `json:"yearGrowth"`
FinalSectorValue float64 `json:"finalSectorValue"`
Slug string `json:"slug"`
Currency string `json:"currency"`
Format string `json:"format"`
Name string `json:"name"`
}
type StockHistoricalRatiosDescription ¶
type StockHistoricalRatiosDescription struct {
ID int `json:"id"`
Format string `json:"format"`
Currency string `json:"currency"`
Slug string `json:"slug"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Name string `json:"name"`
Description string `json:"description"`
Locale string `json:"locale"`
IsRealtime bool `json:"isRealtime"`
}
type StockHistoricalRatiosFormatting ¶
type StockHistoricalRatiosFormatting struct {
Name string `json:"name"`
Slug string `json:"slug"`
Precision int `json:"precision"`
Multiplier float64 `json:"multiplier"`
Suffix string `json:"suffix"`
Prefix string `json:"prefix"`
Interval string `json:"interval"`
Description string `json:"description"`
}
type StockPeerFinancialRatioComparison ¶
type StockPeerFinancialRatioComparison struct {
MetricName string `json:"metricName"`
NormalizedValue float64 `json:"normalizedValue"`
Data []StockPeerFinancialRatioComparisonData `json:"data"`
}
type StockPriceGraph ¶
type StockPriceGraph struct {
Symbol string `json:"symbol"`
OneDay []PriceDataPoint `json:"1D"`
OneWeek []PriceDataPoint `json:"1W"`
OneMonth []PriceDataPoint `json:"1M"`
ThreeMonth []PriceDataPoint `json:"3M"`
OneYear []PriceDataPoint `json:"1Y"`
TwoYear []PriceDataPoint `json:"2Y"`
ThreeYear []PriceDataPoint `json:"3Y"`
FiveYear []PriceDataPoint `json:"5Y"`
}
type StockRestriction ¶
type StockStats ¶
type StockStats struct {
PreviousClose float64 `json:"previousClose,omitempty"`
YtdReturn float64 `json:"ytdReturn,omitempty"`
YearlyReturn float64 `json:"yearlyReturn,omitempty"`
MarketCap float64 `json:"marketCap,omitempty"`
PeRatio float64 `json:"peRatio,omitempty"`
PbRatio float64 `json:"pbRatio,omitempty"`
YearLow float64 `json:"yearLow,omitempty"`
YearHigh float64 `json:"yearHigh,omitempty"`
ThreeYearReturn float64 `json:"3YearReturn,omitempty"`
FiveYearReturn float64 `json:"5YearReturn,omitempty"`
ThreeMonthReturn float64 `json:"3MonthReturn,omitempty"`
MonthlyReturn float64 `json:"monthlyReturn,omitempty"`
WeeklyReturn float64 `json:"weeklyReturn,omitempty"`
Symbol string `json:"symbol"`
LatestPrice float64 `json:"latestPrice,omitempty"`
DailyChange float64 `json:"dailyChange,omitempty"`
DayHigh float64 `json:"dayHigh,omitempty"`
DayLow float64 `json:"dayLow,omitempty"`
LowerPriceLimit Price `json:"lowerPriceLimit,omitempty"`
UpperPriceLimit Price `json:"upperPriceLimit,omitempty"`
DayOpen float64 `json:"dayOpen,omitempty"`
Eps float64 `json:"eps,omitempty"`
}
type StreamNewsParams ¶
type StreamNewsParams struct {
Region Region
Locale Locale
Lane NewsLane
Symbols []string
CategoryIds []string
SectorIds []string
IndustryIds []string
ApiSource []string
}
StreamNewsParams holds the parameters for the news stream endpoint.
type TickRule ¶
type TickRule struct {
BasePrice float64 `json:"basePrice"`
AdditionalPrice int `json:"additionalPrice"`
LowerPriceLimit float64 `json:"lowerPriceLimit"`
UpperPriceLimit float64 `json:"upperPriceLimit"`
Rules []TickSizeRule `json:"rules"`
}
type TickSizeRule ¶
type TopHolding ¶
type TopHolding struct {
Symbol string `json:"symbol"`
Company string `json:"company"`
Politicians []TopHoldingPolitician `json:"politicians"`
Count int32 `json:"count"`
}
type TopHoldingPolitician ¶
type TopMover ¶
type TopMover struct {
Symbol string `json:"symbol"`
AssetClass AssetClass `json:"assetClass,omitempty"`
AssetType AssetType `json:"assetType,omitempty"`
Change float64 `json:"change"`
}
type TopMoversDirection ¶
type TopMoversDirection string
const ( TopMoversDirectionGainers TopMoversDirection = "gainers" TopMoversDirectionLosers TopMoversDirection = "losers" )
type USStockLiveData ¶
type UpdateCustomThemeParams ¶
type UpdateCustomThemeParams struct {
Title LocaleString `json:"title,omitempty" bson:"title,omitempty"`
Description LocaleString `json:"description,omitempty" bson:"description,omitempty"`
ImageURL string `json:"image_url" bson:"image_url"`
Image string `json:"image" bson:"image"`
AvatarImageURL string `json:"avatar_url" bson:"avatar_image_url"`
Stocks []primitive.ObjectID `json:"stockIds" bson:"stockIds"`
Status CollectionStatus `json:"status" bson:"status"`
MetaData map[string]any `json:"meta_data,omitempty" bson:"meta_data,omitempty"`
}
type WebSocketUrlParams ¶
type WebSocketUrlResponse ¶
type WebSocketUrlResponse struct {
URL string `json:"url,omitempty"`
Message string `json:"message,omitempty"`
Code MessageCode `json:"code,omitempty"`
ExampleBody any `json:"exampleBody,omitempty"`
}
Source Files
¶
- aggregate.go
- brokers.go
- capital_increase.go
- client.go
- client_test_suite.go
- collections.go
- config.go
- configuration.go
- custom_theme.go
- earning_transcript.go
- errors.go
- financial_fundamentals.go
- financial_ratios.go
- fs.go
- funds.go
- industry.go
- key-insight.go
- live_price.go
- news.go
- politician.go
- screener.go
- search.go
- sector.go
- state.go
- stocks.go
- theme.go
- websocket.go