Documentation ¶
Index ¶
- Constants
- type Agg
- type AssetClass
- type BaseResponse
- type Branding
- type CompanyAddress
- type Comparator
- type Condition
- type ContractType
- type CryptoTrade
- type DataType
- type Date
- type DayOptionContractSnapshot
- type DaySnapshot
- type Details
- type Direction
- type Dividend
- type DividendType
- type ErrorResponse
- type Exchange
- type Financial
- type ForexQuote
- type Frequency
- type FullBookSnapshot
- type GetAggsParams
- type GetAggsResponse
- type GetAllTickersSnapshotParams
- type GetAllTickersSnapshotResponse
- type GetCryptoFullBookSnapshotParams
- type GetCryptoFullBookSnapshotResponse
- type GetDailyOpenCloseAggParams
- type GetDailyOpenCloseAggResponse
- type GetEMAParams
- func (p GetEMAParams) WithAdjusted(q bool) *GetEMAParams
- func (p GetEMAParams) WithExpandUnderlying(q bool) *GetEMAParams
- func (p GetEMAParams) WithLimit(q int) *GetEMAParams
- func (p GetEMAParams) WithOrder(q Order) *GetEMAParams
- func (p GetEMAParams) WithSeriesType(q SeriesType) *GetEMAParams
- func (p GetEMAParams) WithTimespan(q Timespan) *GetEMAParams
- func (p GetEMAParams) WithTimestamp(c Comparator, q Millis) *GetEMAParams
- func (p GetEMAParams) WithWindow(q int) *GetEMAParams
- type GetEMAResponse
- type GetExchangesParams
- type GetExchangesResponse
- type GetGainersLosersSnapshotParams
- type GetGainersLosersSnapshotResponse
- type GetGroupedDailyAggsParams
- type GetGroupedDailyAggsResponse
- type GetIndicesSnapshotParams
- type GetIndicesSnapshotResponse
- type GetLastCryptoTradeParams
- type GetLastCryptoTradeResponse
- type GetLastForexQuoteParams
- type GetLastForexQuoteResponse
- type GetLastQuoteParams
- type GetLastQuoteResponse
- type GetLastTradeParams
- type GetLastTradeResponse
- type GetMACDParams
- func (p GetMACDParams) WithAdjusted(q bool) *GetMACDParams
- func (p GetMACDParams) WithExpandUnderlying(q bool) *GetMACDParams
- func (p GetMACDParams) WithLimit(q int) *GetMACDParams
- func (p GetMACDParams) WithLongWindow(q int) *GetMACDParams
- func (p GetMACDParams) WithOrder(q Order) *GetMACDParams
- func (p GetMACDParams) WithSeriesType(q SeriesType) *GetMACDParams
- func (p GetMACDParams) WithShortWindow(q int) *GetMACDParams
- func (p GetMACDParams) WithSignalWindow(q int) *GetMACDParams
- func (p GetMACDParams) WithTimespan(q Timespan) *GetMACDParams
- func (p GetMACDParams) WithTimestamp(c Comparator, q Millis) *GetMACDParams
- type GetMACDResponse
- type GetMarketHolidaysResponse
- type GetMarketStatusResponse
- type GetOptionContractSnapshotParams
- type GetOptionContractSnapshotResponse
- type GetOptionsContractParams
- type GetOptionsContractResponse
- type GetPreviousCloseAggParams
- type GetPreviousCloseAggResponse
- type GetRSIParams
- func (p GetRSIParams) WithAdjusted(q bool) *GetRSIParams
- func (p GetRSIParams) WithExpandUnderlying(q bool) *GetRSIParams
- func (p GetRSIParams) WithLimit(q int) *GetRSIParams
- func (p GetRSIParams) WithOrder(q Order) *GetRSIParams
- func (p GetRSIParams) WithSeriesType(q SeriesType) *GetRSIParams
- func (p GetRSIParams) WithTimespan(q Timespan) *GetRSIParams
- func (p GetRSIParams) WithTimestamp(c Comparator, q Millis) *GetRSIParams
- func (p GetRSIParams) WithWindow(q int) *GetRSIParams
- type GetRSIResponse
- type GetRealTimeCurrencyConversionParams
- type GetRealTimeCurrencyConversionResponse
- type GetSMAParams
- func (p GetSMAParams) WithAdjusted(q bool) *GetSMAParams
- func (p GetSMAParams) WithExpandUnderlying(q bool) *GetSMAParams
- func (p GetSMAParams) WithLimit(q int) *GetSMAParams
- func (p GetSMAParams) WithOrder(q Order) *GetSMAParams
- func (p GetSMAParams) WithSeriesType(q SeriesType) *GetSMAParams
- func (p GetSMAParams) WithTimespan(q Timespan) *GetSMAParams
- func (p GetSMAParams) WithTimestamp(c Comparator, q Millis) *GetSMAParams
- func (p GetSMAParams) WithWindow(q int) *GetSMAParams
- type GetSMAResponse
- type GetSummaryParams
- type GetSummaryResponse
- type GetTickerDetailsParams
- type GetTickerDetailsResponse
- type GetTickerEventsParams
- type GetTickerEventsResponse
- type GetTickerRelatedCompaniesParams
- type GetTickerRelatedCompaniesResponse
- type GetTickerSnapshotParams
- type GetTickerSnapshotResponse
- type GetTickerTypesParams
- type GetTickerTypesResponse
- type Greeks
- type IndexSession
- type IndexSnapshot
- type Insights
- type LastQuote
- type LastQuoteOptionContractSnapshot
- type LastQuoteSnapshot
- type LastTrade
- type LastTradeOptionContractSnapshot
- type LastTradeSnapshot
- type ListAggsParams
- type ListAggsResponse
- type ListAssetSnapshotsParamsdeprecated
- func (p ListAssetSnapshotsParams) WithTicker(q string) *ListAssetSnapshotsParams
- func (p ListAssetSnapshotsParams) WithTickerAnyOf(q string) *ListAssetSnapshotsParams
- func (p ListAssetSnapshotsParams) WithTickersByComparison(c Comparator, q string) *ListAssetSnapshotsParams
- func (p ListAssetSnapshotsParams) WithType(q string) *ListAssetSnapshotsParams
- type ListAssetSnapshotsResponsedeprecated
- type ListConditionsParams
- func (p ListConditionsParams) WithAssetClass(q AssetClass) *ListConditionsParams
- func (p ListConditionsParams) WithDataType(q DataType) *ListConditionsParams
- func (p ListConditionsParams) WithID(q int64) *ListConditionsParams
- func (p ListConditionsParams) WithLimit(q int) *ListConditionsParams
- func (p ListConditionsParams) WithOrder(q Order) *ListConditionsParams
- func (p ListConditionsParams) WithSIP(q SIP) *ListConditionsParams
- func (p ListConditionsParams) WithSort(q Sort) *ListConditionsParams
- type ListConditionsResponse
- type ListDividendsParams
- func (p ListDividendsParams) WithCashAmount(c Comparator, q float64) *ListDividendsParams
- func (p ListDividendsParams) WithDeclarationDate(c Comparator, q Date) *ListDividendsParams
- func (p ListDividendsParams) WithDividendType(q DividendType) *ListDividendsParams
- func (p ListDividendsParams) WithExDividendDate(c Comparator, q Date) *ListDividendsParams
- func (p ListDividendsParams) WithFrequency(q Frequency) *ListDividendsParams
- func (p ListDividendsParams) WithLimit(q int) *ListDividendsParams
- func (p ListDividendsParams) WithOrder(q Order) *ListDividendsParams
- func (p ListDividendsParams) WithPayDate(c Comparator, q Date) *ListDividendsParams
- func (p ListDividendsParams) WithSort(q Sort) *ListDividendsParams
- func (p ListDividendsParams) WithTicker(c Comparator, q string) *ListDividendsParams
- type ListDividendsResponse
- type ListOptionsChainParams
- func (o ListOptionsChainParams) WithContractType(contractType ContractType) *ListOptionsChainParams
- func (o ListOptionsChainParams) WithExpirationDate(comparator Comparator, expirationDate Date) *ListOptionsChainParams
- func (o ListOptionsChainParams) WithLimit(limit int) *ListOptionsChainParams
- func (o ListOptionsChainParams) WithOrder(order Order) *ListOptionsChainParams
- func (o ListOptionsChainParams) WithSort(sort Sort) *ListOptionsChainParams
- func (o ListOptionsChainParams) WithStrikePrice(comparator Comparator, strikePrice float64) *ListOptionsChainParams
- type ListOptionsChainSnapshotResponse
- type ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithAsOf(q Date) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithContractType(q string) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithExpirationDate(c Comparator, q Date) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithExpired(q bool) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithLimit(q int) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithOrder(q Order) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithSort(q Sort) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithStrikePrice(c Comparator, q float64) *ListOptionsContractsParams
- func (p ListOptionsContractsParams) WithUnderlyingTicker(c Comparator, q string) *ListOptionsContractsParams
- type ListOptionsContractsResponse
- type ListQuotesParams
- func (p ListQuotesParams) WithDay(year int, month time.Month, day int) *ListQuotesParams
- func (p ListQuotesParams) WithLimit(q int) *ListQuotesParams
- func (p ListQuotesParams) WithOrder(q Order) *ListQuotesParams
- func (p ListQuotesParams) WithSort(q Sort) *ListQuotesParams
- func (p ListQuotesParams) WithTimestamp(c Comparator, q Nanos) *ListQuotesParams
- type ListQuotesResponse
- type ListSplitsParams
- func (p ListSplitsParams) WithExecutionDate(c Comparator, q Date) *ListSplitsParams
- func (p ListSplitsParams) WithLimit(q int) *ListSplitsParams
- func (p ListSplitsParams) WithOrder(q Order) *ListSplitsParams
- func (p ListSplitsParams) WithReverseSplit(q bool) *ListSplitsParams
- func (p ListSplitsParams) WithSort(q Sort) *ListSplitsParams
- func (p ListSplitsParams) WithTicker(c Comparator, q string) *ListSplitsParams
- type ListSplitsResponse
- type ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithCIK(q string) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithCompanyName(c NameComparator, q string) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithFilingDate(c Comparator, q Date) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithIncludeSources(q bool) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithLimit(q int) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithOrder(q Order) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithPeriodOfReportDate(c Comparator, q Date) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithSIC(q string) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithSort(q Sort) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithTicker(q string) *ListStockFinancialsParams
- func (p ListStockFinancialsParams) WithTimeframe(q Timeframe) *ListStockFinancialsParams
- type ListStockFinancialsResponse
- type ListTickerNewsParams
- func (p ListTickerNewsParams) WithLimit(q int) *ListTickerNewsParams
- func (p ListTickerNewsParams) WithOrder(q Order) *ListTickerNewsParams
- func (p ListTickerNewsParams) WithPublishedUTC(c Comparator, q Millis) *ListTickerNewsParams
- func (p ListTickerNewsParams) WithSort(q Sort) *ListTickerNewsParams
- func (p ListTickerNewsParams) WithTicker(c Comparator, q string) *ListTickerNewsParams
- type ListTickerNewsResponse
- type ListTickersParams
- func (p ListTickersParams) WithActive(q bool) *ListTickersParams
- func (p ListTickersParams) WithCIK(q int) *ListTickersParams
- func (p ListTickersParams) WithCUSIP(q int) *ListTickersParams
- func (p ListTickersParams) WithDate(q Date) *ListTickersParams
- func (p ListTickersParams) WithExchange(q string) *ListTickersParams
- func (p ListTickersParams) WithLimit(q int) *ListTickersParams
- func (p ListTickersParams) WithMarket(q AssetClass) *ListTickersParams
- func (p ListTickersParams) WithOrder(q Order) *ListTickersParams
- func (p ListTickersParams) WithSearch(q string) *ListTickersParams
- func (p ListTickersParams) WithSort(q Sort) *ListTickersParams
- func (p ListTickersParams) WithTicker(c Comparator, q string) *ListTickersParams
- func (p ListTickersParams) WithType(q string) *ListTickersParams
- type ListTickersResponse
- type ListTradesParams
- func (p ListTradesParams) WithDay(year int, month time.Month, day int) *ListTradesParams
- func (p ListTradesParams) WithLimit(q int) *ListTradesParams
- func (p ListTradesParams) WithOrder(q Order) *ListTradesParams
- func (p ListTradesParams) WithSort(q Sort) *ListTradesParams
- func (p ListTradesParams) WithTimestamp(c Comparator, q Nanos) *ListTradesParams
- type ListTradesResponse
- type ListUniversalSnapshotsParams
- func (p ListUniversalSnapshotsParams) WithTicker(q string) *ListUniversalSnapshotsParams
- func (p ListUniversalSnapshotsParams) WithTickerAnyOf(q string) *ListUniversalSnapshotsParams
- func (p ListUniversalSnapshotsParams) WithTickersByComparison(c Comparator, q string) *ListUniversalSnapshotsParams
- func (p ListUniversalSnapshotsParams) WithType(q string) *ListUniversalSnapshotsParams
- type ListUniversalSnapshotsResponse
- type MACDIndicatorResults
- type MACDIndicatorValue
- type MACDIndicatorValues
- type MarketHoliday
- type MarketLocale
- type MarketType
- type Millis
- type MinuteSnapshot
- type NameComparator
- type Nanos
- type OptionContractSnapshot
- type OptionDetails
- type Options
- type OptionsContract
- type Order
- type OrderBookQuote
- type PaginationHooks
- type Publisher
- type Quote
- type RelatedCompany
- type RequestOption
- type RequestOptions
- type SIP
- type SIPMapping
- type SeriesType
- type Session
- type SingleIndicatorResults
- type SingleIndicatorValue
- type SingleIndicatorValues
- type SnapshotLastQuote
- type SnapshotLastTrade
- type SnapshotResponseModel
- type Sort
- type Split
- type StockFinancial
- type SummaryResult
- type Ticker
- type TickerChangeEvent
- type TickerEvent
- type TickerEventResult
- type TickerNews
- type TickerSnapshot
- type TickerType
- type Time
- type Timeframe
- type Timespan
- type Trade
- type Underlying
- type UnderlyingAsset
- type UnderlyingResults
- type UpdateRules
Constants ¶
const ( // HeaderEdgeID is a required Launchpad header. It identifies the Edge User requesting data. HeaderEdgeID = "X-Polygon-Edge-ID" // HeaderEdgeIPAddress is a required Launchpad header. It denotes the originating IP Address of the Edge User requesting data. HeaderEdgeIPAddress = "X-Polygon-Edge-IP-Address" // HeaderEdgeUserAgent is an optional Launchpad header. It denotes the originating UserAgent of the Edge User requesting data. HeaderEdgeUserAgent = "X-Polygon-Edge-User-Agent" )
Headers required to use the Launchpad product.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agg ¶
type Agg struct { Ticker string `json:"T,omitempty"` Close float64 `json:"c,omitempty"` High float64 `json:"h,omitempty"` Low float64 `json:"l,omitempty"` Transactions int64 `json:"n,omitempty"` Open float64 `json:"o,omitempty"` Timestamp Millis `json:"t,omitempty"` Volume float64 `json:"v,omitempty"` VWAP float64 `json:"vw,omitempty"` OTC bool `json:"otc,omitempty"` }
Agg is an aggregation of all the activity on a specified ticker between the start and end timestamps.
type AssetClass ¶
type AssetClass string
AssetClass is an identifier for a group of similar financial instruments.
const ( AssetStocks AssetClass = "stocks" AssetOptions AssetClass = "options" AssetCrypto AssetClass = "crypto" AssetFx AssetClass = "fx" AssetOTC AssetClass = "otc" AssetIndices AssetClass = "indices" )
type BaseResponse ¶
type BaseResponse struct { PaginationHooks // The status of this request's response. Status string `json:"status,omitempty"` // A request id assigned by the server. RequestID string `json:"request_id,omitempty"` // The total number of results for this request. Count int `json:"count,omitempty"` // A response message for successful requests. Message string `json:"message,omitempty"` // An error message for unsuccessful requests. ErrorMessage string `json:"error,omitempty"` }
BaseResponse has all possible attributes that any response can use. It's intended to be embedded in a domain specific response struct.
type Branding ¶
type Branding struct { LogoURL string `json:"logo_url,omitempty"` IconURL string `json:"icon_url,omitempty"` }
Branding contains information related to a company's brand.
type CompanyAddress ¶
type CompanyAddress struct { Address1 string `json:"address1,omitempty"` Address2 string `json:"address2,omitempty"` // todo: add this to the spec City string `json:"city,omitempty"` PostalCode string `json:"postal_code,omitempty"` State string `json:"state,omitempty"` }
CompanyAddress contains information on the physical address of a company.
type Comparator ¶
type Comparator string
Comparator is the type of comparison to make for a specific query parameter.
const ( EQ Comparator = "eq" LT Comparator = "lt" LTE Comparator = "lte" GT Comparator = "gt" GTE Comparator = "gte" )
type Condition ¶
type Condition struct { Abbreviation string `json:"abbreviation,omitempty"` AssetClass string `json:"asset_class,omitempty"` DataTypes []string `json:"data_types,omitempty"` Description string `json:"description,omitempty"` Exchange int64 `json:"exchange,omitempty"` ID int64 `json:"id,omitempty"` Legacy bool `json:"legacy"` Name string `json:"name,omitempty"` SIPMapping SIPMapping `json:"sip_mapping,omitempty"` Type string `json:"type,omitempty"` UpdateRules UpdateRules `json:"update_rules,omitempty"` }
Condition contains detailed information on a specified condition.
type ContractType ¶ added in v1.7.0
type ContractType string
ContractType is the type of contract.
const ( ContractCall ContractType = "call" ContractPut ContractType = "put" ContractOther ContractType = "other" )
type CryptoTrade ¶
type CryptoTrade struct { Conditions []int `json:"conditions,omitempty"` Exchange int `json:"exchange,omitempty"` Price float64 `json:"price,omitempty"` Size float64 `json:"size,omitempty"` Timestamp Nanos `json:"timestamp,omitempty"` }
CryptoTrade is a trade for a crypto pair.
type Date ¶
Date represents a short date string of the following format: "2006-01-02".
func (*Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type DayOptionContractSnapshot ¶
type DayOptionContractSnapshot struct { Change float64 `json:"change,omitempty"` ChangePercent float64 `json:"change_percent,omitempty"` Close float64 `json:"close,omitempty"` High float64 `json:"high,omitempty"` LastUpdated Nanos `json:"last_updated,omitempty"` Low float64 `json:"low,omitempty"` Open float64 `json:"open,omitempty"` PreviousClose float64 `json:"previous_close,omitempty"` Volume float64 `json:"volume,omitempty"` VWAP float64 `json:"vwap,omitempty"` }
DayOptionContractSnapshot contains the most recent day agg for an option contract.
type DaySnapshot ¶
type DaySnapshot struct { Close float64 `json:"c,omitempty"` High float64 `json:"h,omitempty"` Low float64 `json:"l,omitempty"` Open float64 `json:"o,omitempty"` Volume float64 `json:"v,omitempty"` VolumeWeightedAverage float64 `json:"vw,omitempty"` OTC bool `json:"otc,omitempty"` }
DaySnapshot is the most recent day agg for a ticker.
type Details ¶ added in v1.12.0
type Details struct { ContractType string `json:"contract_type,omitempty"` ExerciseStyle string `json:"exercise_style,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` StrikePrice float64 `json:"strike_price,omitempty"` }
Details contains all the information that might come back in the details attribute of a SnapshotResponse.
type Direction ¶
type Direction string
Direction is the direction of the snapshot results to return.
type Dividend ¶
type Dividend struct { CashAmount float64 `json:"cash_amount,omitempty"` DeclarationDate Date `json:"declaration_date,omitempty"` DividendType string `json:"dividend_type,omitempty"` ExDividendDate string `json:"ex_dividend_date,omitempty"` Frequency int64 `json:"frequency,omitempty"` PayDate Date `json:"pay_date,omitempty"` RecordDate Date `json:"record_date,omitempty"` Ticker string `json:"ticker,omitempty"` }
Dividend contains detailed information on a specified stock dividend.
type DividendType ¶
type DividendType string
DividendType is the type of dividend.
const ( DividendCD DividendType = "CD" DividendLT DividendType = "LT" DividendSC DividendType = "SC" DividendST DividendType = "ST" )
type ErrorResponse ¶
type ErrorResponse struct { BaseResponse // An HTTP status code for unsuccessful requests. StatusCode int }
ErrorResponse represents an API response with an error status code.
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
Error returns the details of an error response.
type Exchange ¶
type Exchange struct { Acronym string `json:"acronym,omitempty"` AssetClass string `json:"asset_class,omitempty"` ID int64 `json:"id,omitempty"` Locale string `json:"locale,omitempty"` MIC string `json:"mic,omitempty"` Name string `json:"name,omitempty"` OperatingMIC string `json:"operating_mic,omitempty"` ParticipantID string `json:"participant_id,omitempty"` Type string `json:"type,omitempty"` URL string `json:"url,omitempty"` }
Exchange contains detailed information on a specified stock Exchange.
type Financial ¶ added in v0.7.0
type Financial map[string]struct { Formula string `json:"formula,omitempty"` Label string `json:"label,omitempty"` Order int32 `json:"order,omitempty"` Unit string `json:"unit,omitempty"` Value float64 `json:"value,omitempty"` Xpath string `json:"xpath,omitempty"` }
Financial aliases nested data points of information for a stock financial.
type ForexQuote ¶
type ForexQuote struct { Ask float64 `json:"ask,omitempty"` Bid float64 `json:"bid,omitempty"` Exchange int `json:"exchange,omitempty"` Timestamp Nanos `json:"timestamp,omitempty"` }
ForexQuote is a BBO for a forex currency pair.
type Frequency ¶
type Frequency int64
Frequency is the number of times a dividend is paid out over the course of one year.
type FullBookSnapshot ¶ added in v0.9.0
type FullBookSnapshot struct { AskCount float64 `json:"askCount,omitempty"` Asks []OrderBookQuote `json:"asks,omitempty"` BidCount float64 `json:"bidCount,omitempty"` Bids []OrderBookQuote `json:"bids,omitempty"` Spread float64 `json:"spread,omitempty"` Ticker string `json:"ticker,omitempty"` Updated Nanos `json:"updated,omitempty"` }
FullBookSnapshot is the level 2 book of a single crypto ticker.
type GetAggsParams ¶
type GetAggsParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan multiplier. Multiplier int `validate:"required" path:"multiplier"` // The size of the time window. Timespan Timespan `validate:"required" path:"timespan"` // The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. From Millis `validate:"required" path:"from"` // The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. To Millis `validate:"required" path:"to"` // Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"sort"` // Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read // more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements: // https://polygon.io/blog/aggs-api-updates/. Limit *int `query:"limit"` }
GetAggsParams is the set of parameters for the GetAggs method.
func (GetAggsParams) WithAdjusted ¶
func (p GetAggsParams) WithAdjusted(q bool) *GetAggsParams
func (GetAggsParams) WithLimit ¶
func (p GetAggsParams) WithLimit(q int) *GetAggsParams
func (GetAggsParams) WithOrder ¶
func (p GetAggsParams) WithOrder(q Order) *GetAggsParams
type GetAggsResponse ¶
type GetAggsResponse struct { BaseResponse Ticker string `json:"ticker,omitempty"` QueryCount int `json:"queryCount,omitempty"` ResultsCount int `json:"resultsCount,omitempty"` Adjusted bool `json:"adjusted"` Results []Agg `json:"results,omitempty"` }
GetAggsResponse is the response returned by the GetAggs method.
type GetAllTickersSnapshotParams ¶
type GetAllTickersSnapshotParams struct { // The locale of the market. Locale MarketLocale `validate:"required" path:"locale"` // The type of market to query. MarketType MarketType `validate:"required" path:"marketType"` // A comma separated list of tickers to get snapshots for. Tickers *string `query:"tickers"` // Include OTC securities in the response. Default is false (don't include OTC securities). IncludeOTC *bool `query:"include_otc"` }
GetAllTickersSnapshotParams is the set of parameters for the GetAllTickersSnapshot method.
func (GetAllTickersSnapshotParams) WithIncludeOTC ¶ added in v1.1.0
func (p GetAllTickersSnapshotParams) WithIncludeOTC(q bool) *GetAllTickersSnapshotParams
func (GetAllTickersSnapshotParams) WithTickers ¶
func (p GetAllTickersSnapshotParams) WithTickers(q string) *GetAllTickersSnapshotParams
type GetAllTickersSnapshotResponse ¶
type GetAllTickersSnapshotResponse struct { BaseResponse Tickers []TickerSnapshot `json:"tickers,omitempty"` }
GetAllTickersSnapshotResponse is the response returned by the GetAllTickersSnapshot method.
type GetCryptoFullBookSnapshotParams ¶
type GetCryptoFullBookSnapshotParams struct {
Ticker string `validate:"required" path:"ticker"`
}
GetCryptoFullBookSnapshotParams is the set of parameters for the GetCryptoFullBookSnapshot method.
type GetCryptoFullBookSnapshotResponse ¶
type GetCryptoFullBookSnapshotResponse struct { BaseResponse Data FullBookSnapshot `json:"data,omitempty"` }
GetCryptoFullBookSnapshotResponse is the response returned by the GetCryptoFullBookSnapshot method.
type GetDailyOpenCloseAggParams ¶
type GetDailyOpenCloseAggParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The date of the requested open/close in the format YYYY-MM-DD. Date Date `validate:"required" path:"date"` // Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` }
GetDailyOpenCloseAggParams is the set of parameters for the GetDailyOpenCloseAgg method.
func (GetDailyOpenCloseAggParams) WithAdjusted ¶
func (p GetDailyOpenCloseAggParams) WithAdjusted(q bool) *GetDailyOpenCloseAggParams
type GetDailyOpenCloseAggResponse ¶
type GetDailyOpenCloseAggResponse struct { BaseResponse Symbol string `json:"symbol,omitempty"` From string `json:"from,omitempty"` Open float64 `json:"open,omitempty"` High float64 `json:"high,omitempty"` Low float64 `json:"low,omitempty"` Close float64 `json:"close,omitempty"` Volume float64 `json:"volume,omitempty"` AfterHours float64 `json:"afterHours,omitempty"` PreMarket float64 `json:"preMarket,omitempty"` OTC bool `json:"otc,omitempty"` }
GetDailyOpenCloseAggResponse is the response for the GetDailyOpenCloseAgg method.
type GetEMAParams ¶ added in v1.3.0
type GetEMAParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan of the underlying aggregates. Timespan *Timespan `query:"timespan"` // Query indicators by timestamp. TimestampEQ *Millis `query:"timestamp"` TimestampLT *Millis `query:"timestamp.lt"` TimestampLTE *Millis `query:"timestamp.lte"` TimestampGT *Millis `query:"timestamp.gt"` TimestampGTE *Millis `query:"timestamp.gte"` // The attribute of the underlying aggregate which will be used to calculate the indicator. SeriesType *SeriesType `query:"series_type"` // Whether to also return the underlying aggregates used to calculate the indicator. ExpandUnderlying *bool `query:"expand_underlying"` // Whether or not the underlying aggregates used to calculate the indicator are adjusted for splits. By default, the aggregates are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 5000 Limit *int `query:"limit"` // The size of the window over which the indicator will be calculated. Window *int `query:"window"` }
GetEMAParams is the set of parameters for the GetEMA method.
func (GetEMAParams) WithAdjusted ¶ added in v1.3.0
func (p GetEMAParams) WithAdjusted(q bool) *GetEMAParams
func (GetEMAParams) WithExpandUnderlying ¶ added in v1.3.0
func (p GetEMAParams) WithExpandUnderlying(q bool) *GetEMAParams
func (GetEMAParams) WithLimit ¶ added in v1.14.1
func (p GetEMAParams) WithLimit(q int) *GetEMAParams
func (GetEMAParams) WithOrder ¶ added in v1.3.0
func (p GetEMAParams) WithOrder(q Order) *GetEMAParams
func (GetEMAParams) WithSeriesType ¶ added in v1.3.0
func (p GetEMAParams) WithSeriesType(q SeriesType) *GetEMAParams
func (GetEMAParams) WithTimespan ¶ added in v1.3.0
func (p GetEMAParams) WithTimespan(q Timespan) *GetEMAParams
func (GetEMAParams) WithTimestamp ¶ added in v1.3.0
func (p GetEMAParams) WithTimestamp(c Comparator, q Millis) *GetEMAParams
func (GetEMAParams) WithWindow ¶ added in v1.3.0
func (p GetEMAParams) WithWindow(q int) *GetEMAParams
type GetEMAResponse ¶ added in v1.3.0
type GetEMAResponse struct { BaseResponse Results SingleIndicatorResults `json:"results,omitempty"` }
type GetExchangesParams ¶
type GetExchangesParams struct { // Filter by asset class. AssetClass *AssetClass `query:"asset_class,omitempty"` // Filter by locale. Locale *MarketLocale `query:"locale,omitempty"` }
GetExchangesParams is the set of parameters for the GetExchanges method.
func (GetExchangesParams) WithAssetClass ¶
func (p GetExchangesParams) WithAssetClass(q AssetClass) *GetExchangesParams
func (GetExchangesParams) WithLocale ¶
func (p GetExchangesParams) WithLocale(q MarketLocale) *GetExchangesParams
type GetExchangesResponse ¶
type GetExchangesResponse struct { BaseResponse Results []Exchange `json:"results,omitempty"` }
GetExchangesResponse is the response returned by the GetExchanges method.
type GetGainersLosersSnapshotParams ¶
type GetGainersLosersSnapshotParams struct { // The locale of the market. Locale MarketLocale `validate:"required" path:"locale"` // The type of market to query. MarketType MarketType `validate:"required" path:"marketType"` // The direction of the snapshot results to return. Direction Direction `validate:"required" path:"direction"` // Include OTC securities in the response. Default is false (don't include OTC securities). IncludeOTC *bool `query:"include_otc"` }
GetGainersLosersSnapshotParams is the set of parameters for the GetGainersLosersSnapshot method.
func (GetGainersLosersSnapshotParams) WithIncludeOTC ¶ added in v1.2.0
func (p GetGainersLosersSnapshotParams) WithIncludeOTC(q bool) *GetGainersLosersSnapshotParams
type GetGainersLosersSnapshotResponse ¶
type GetGainersLosersSnapshotResponse struct { BaseResponse Tickers []TickerSnapshot `json:"tickers,omitempty"` }
GetGainersLosersSnapshotResponse is the response returned by the GetGainersLosersSnapshot method.
type GetGroupedDailyAggsParams ¶
type GetGroupedDailyAggsParams struct { // The locale of the market. Locale MarketLocale `validate:"required" path:"locale"` // The type of market to query. MarketType MarketType `validate:"required" path:"marketType"` // The beginning date for the aggregate window. Date Date `validate:"required" path:"date"` // Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Include OTC securities in the response. Default is false (don't include OTC securities). IncludeOTC *bool `query:"include_otc"` }
GetGroupedDailyAggsParams is the set of parameters for the GetGroupedDailyAggs method.
func (GetGroupedDailyAggsParams) WithAdjusted ¶
func (p GetGroupedDailyAggsParams) WithAdjusted(q bool) *GetGroupedDailyAggsParams
func (GetGroupedDailyAggsParams) WithIncludeOTC ¶ added in v1.1.0
func (p GetGroupedDailyAggsParams) WithIncludeOTC(q bool) *GetGroupedDailyAggsParams
type GetGroupedDailyAggsResponse ¶
type GetGroupedDailyAggsResponse struct { BaseResponse Ticker string `json:"ticker,omitempty"` QueryCount int `json:"queryCount,omitempty"` ResultsCount int `json:"resultsCount,omitempty"` Adjusted bool `json:"adjusted"` Results []Agg `json:"results,omitempty"` }
GetGroupedDailyAggsResponse is the response returned by the GetGroupedDailyAggs method.
type GetIndicesSnapshotParams ¶ added in v1.11.0
type GetIndicesSnapshotParams struct { // The ticker list to get summaries for TickerAnyOf *string `query:"ticker.any_of"` }
GetIndicesSnapshotParams is the set of parameters for the GetIndicesSnapshot method.
func (GetIndicesSnapshotParams) WithTickerAnyOf ¶ added in v1.11.0
func (p GetIndicesSnapshotParams) WithTickerAnyOf(tickers ...string) *GetIndicesSnapshotParams
type GetIndicesSnapshotResponse ¶ added in v1.11.0
type GetIndicesSnapshotResponse struct { BaseResponse Results []IndexSnapshot `json:"results,omitempty"` }
GetIndicesSnapshotResponse is the response returned by the GetIndicesSnapshot method.
type GetLastCryptoTradeParams ¶
type GetLastCryptoTradeParams struct { // The "from" symbol of the pair. From string `validate:"required" path:"from"` // The "to" symbol of the pair. To string `validate:"required" path:"to"` }
GetLastCryptoTradeParams is the set of parameters for the GetLastCryptoTrade method.
type GetLastCryptoTradeResponse ¶
type GetLastCryptoTradeResponse struct { BaseResponse Symbol string `json:"symbol,omitempty"` Last CryptoTrade `json:"last,omitempty"` }
GetLastCryptoTradeResponse is the response returned by the GetLastCryptoTrade method.
type GetLastForexQuoteParams ¶
type GetLastForexQuoteParams struct { // The "from" symbol of the pair. From string `validate:"required" path:"from"` // The "to" symbol of the pair. To string `validate:"required" path:"to"` }
GetLastForexQuoteParams is the set of parameters for the GetLastForexQuote method.
type GetLastForexQuoteResponse ¶
type GetLastForexQuoteResponse struct { BaseResponse Symbol string `json:"symbol,omitempty"` Last ForexQuote `json:"last,omitempty"` }
GetLastForexQuoteResponse is the response returned by the GetLastForexQuote method.
type GetLastQuoteParams ¶
type GetLastQuoteParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` }
GetLastQuoteParams is the set of parameters for the GetLastQuote method.
type GetLastQuoteResponse ¶
type GetLastQuoteResponse struct { BaseResponse Results LastQuote `json:"results,omitempty"` }
GetLastQuoteResponse is the response returned by the GetLastQuote method.
type GetLastTradeParams ¶
type GetLastTradeParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` }
GetLastTradeParams is the set of parameters for GetLastTrade method.
type GetLastTradeResponse ¶
type GetLastTradeResponse struct { BaseResponse Results LastTrade `json:"results,omitempty"` }
GetLastTradeResponse is the response returned by the GetLastTradeResponse method.
type GetMACDParams ¶ added in v1.3.0
type GetMACDParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan of the underlying aggregates. Timespan *Timespan `query:"timespan"` // Query indicators by timestamp. TimestampEQ *Millis `query:"timestamp"` TimestampLT *Millis `query:"timestamp.lt"` TimestampLTE *Millis `query:"timestamp.lte"` TimestampGT *Millis `query:"timestamp.gt"` TimestampGTE *Millis `query:"timestamp.gte"` // The attribute of the underlying aggregate which will be used to calculate the indicator. SeriesType *SeriesType `query:"series_type"` // Whether to also return the underlying aggregates used to calculate the indicator. ExpandUnderlying *bool `query:"expand_underlying"` // Whether or not the underlying aggregates used to calculate the indicator are adjusted for splits. By default, the aggregates are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 5000 Limit *int `query:"limit"` // The size of the window over which the indicator will be calculated. ShortWindow *int `query:"short_window"` // The size of the window over which the indicator will be calculated. LongWindow *int `query:"long_window"` // The size of the window over which the indicator will be calculated. SignalWindow *int `query:"signal_window"` }
GetMACDParams is the set of parameters for the GetMACD method.
func (GetMACDParams) WithAdjusted ¶ added in v1.3.0
func (p GetMACDParams) WithAdjusted(q bool) *GetMACDParams
func (GetMACDParams) WithExpandUnderlying ¶ added in v1.3.0
func (p GetMACDParams) WithExpandUnderlying(q bool) *GetMACDParams
func (GetMACDParams) WithLimit ¶ added in v1.14.1
func (p GetMACDParams) WithLimit(q int) *GetMACDParams
func (GetMACDParams) WithLongWindow ¶ added in v1.3.0
func (p GetMACDParams) WithLongWindow(q int) *GetMACDParams
func (GetMACDParams) WithOrder ¶ added in v1.3.0
func (p GetMACDParams) WithOrder(q Order) *GetMACDParams
func (GetMACDParams) WithSeriesType ¶ added in v1.3.0
func (p GetMACDParams) WithSeriesType(q SeriesType) *GetMACDParams
func (GetMACDParams) WithShortWindow ¶ added in v1.3.0
func (p GetMACDParams) WithShortWindow(q int) *GetMACDParams
func (GetMACDParams) WithSignalWindow ¶ added in v1.3.0
func (p GetMACDParams) WithSignalWindow(q int) *GetMACDParams
func (GetMACDParams) WithTimespan ¶ added in v1.3.0
func (p GetMACDParams) WithTimespan(q Timespan) *GetMACDParams
func (GetMACDParams) WithTimestamp ¶ added in v1.3.0
func (p GetMACDParams) WithTimestamp(c Comparator, q Millis) *GetMACDParams
type GetMACDResponse ¶ added in v1.3.0
type GetMACDResponse struct { BaseResponse Results MACDIndicatorResults `json:"results,omitempty"` }
type GetMarketHolidaysResponse ¶
type GetMarketHolidaysResponse []MarketHoliday
GetMarketHolidaysResponse is the response returned by the GetMarketHolidays method.
type GetMarketStatusResponse ¶
type GetMarketStatusResponse struct { AfterHours bool `json:"afterHours"` Currencies map[string]string `json:"currencies,omitempty"` EarlyHours bool `json:"earlyHours"` Exchanges map[string]string `json:"exchanges,omitempty"` IndicesGroups map[string]string `json:"indicesGroups,omitempty"` Market string `json:"market,omitempty"` ServerTime Time `json:"serverTime,omitempty"` }
GetMarketStatusResponse is the response returned by the GetMarketStatus method.
type GetOptionContractSnapshotParams ¶
type GetOptionContractSnapshotParams struct { UnderlyingAsset string `validate:"required" path:"underlyingAsset"` OptionContract string `validate:"required" path:"optionContract"` }
GetOptionContractSnapshotParams is the set of parameters for the GetOptionContractSnapshot method.
type GetOptionContractSnapshotResponse ¶
type GetOptionContractSnapshotResponse struct { BaseResponse Results OptionContractSnapshot `json:"results,omitempty"` }
GetOptionContractSnapshotResponse is the response returned by the GetOptionContractSnapshot method.
type GetOptionsContractParams ¶ added in v0.10.0
type GetOptionsContractParams struct { // Return the contract that contains this options ticker. Ticker string `validate:"required" path:"ticker"` // Specify a point in time for the contract as of this date. AsOf *Date `query:"as_of"` }
GetOptionsContract is the set of parameters for the GetOptionsContract method.
func (GetOptionsContractParams) WithAsOf ¶ added in v0.10.0
func (p GetOptionsContractParams) WithAsOf(q Date) *GetOptionsContractParams
type GetOptionsContractResponse ¶ added in v0.10.0
type GetOptionsContractResponse struct { BaseResponse Results OptionsContract `json:"results,omitempty"` }
GetOptionsContractResponse is the response returned by the GetOptionsContract method.
type GetPreviousCloseAggParams ¶
type GetPreviousCloseAggParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` }
GetPreviousCloseAggParams is the set of parameters for the GetPreviousCloseAgg method.
func (GetPreviousCloseAggParams) WithAdjusted ¶
func (p GetPreviousCloseAggParams) WithAdjusted(q bool) *GetPreviousCloseAggParams
type GetPreviousCloseAggResponse ¶
type GetPreviousCloseAggResponse struct { BaseResponse Ticker string `json:"ticker,omitempty"` QueryCount int `json:"queryCount,omitempty"` ResultsCount int `json:"resultsCount,omitempty"` Adjusted bool `json:"adjusted"` Results []Agg `json:"results,omitempty"` }
GetPreviousCloseAggResponse is the response returned by the GetPreviousCloseAgg method.
type GetRSIParams ¶ added in v1.3.0
type GetRSIParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan of the underlying aggregates. Timespan *Timespan `query:"timespan"` // Query indicators by timestamp. TimestampEQ *Millis `query:"timestamp"` TimestampLT *Millis `query:"timestamp.lt"` TimestampLTE *Millis `query:"timestamp.lte"` TimestampGT *Millis `query:"timestamp.gt"` TimestampGTE *Millis `query:"timestamp.gte"` // The attribute of the underlying aggregate which will be used to calculate the indicator. SeriesType *SeriesType `query:"series_type"` // Whether to also return the underlying aggregates used to calculate the indicator. ExpandUnderlying *bool `query:"expand_underlying"` // Whether or not the underlying aggregates used to calculate the indicator are adjusted for splits. By default, the aggregates are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 5000 Limit *int `query:"limit"` // The size of the window over which the indicator will be calculated. Window *int `query:"window"` }
GetRSIParams is the set of parameters for the GetRSI method.
func (GetRSIParams) WithAdjusted ¶ added in v1.3.0
func (p GetRSIParams) WithAdjusted(q bool) *GetRSIParams
func (GetRSIParams) WithExpandUnderlying ¶ added in v1.3.0
func (p GetRSIParams) WithExpandUnderlying(q bool) *GetRSIParams
func (GetRSIParams) WithLimit ¶ added in v1.14.1
func (p GetRSIParams) WithLimit(q int) *GetRSIParams
func (GetRSIParams) WithOrder ¶ added in v1.3.0
func (p GetRSIParams) WithOrder(q Order) *GetRSIParams
func (GetRSIParams) WithSeriesType ¶ added in v1.3.0
func (p GetRSIParams) WithSeriesType(q SeriesType) *GetRSIParams
func (GetRSIParams) WithTimespan ¶ added in v1.3.0
func (p GetRSIParams) WithTimespan(q Timespan) *GetRSIParams
func (GetRSIParams) WithTimestamp ¶ added in v1.3.0
func (p GetRSIParams) WithTimestamp(c Comparator, q Millis) *GetRSIParams
func (GetRSIParams) WithWindow ¶ added in v1.3.0
func (p GetRSIParams) WithWindow(q int) *GetRSIParams
type GetRSIResponse ¶ added in v1.3.0
type GetRSIResponse struct { BaseResponse Results SingleIndicatorResults `json:"results,omitempty"` }
type GetRealTimeCurrencyConversionParams ¶ added in v0.5.0
type GetRealTimeCurrencyConversionParams struct { From string `validate:"required" path:"from"` To string `validate:"required" path:"to"` }
GetRealTimeCurrencyConversionParams is the set of parameters for the GetRealTimeCurrencyConversion method.
type GetRealTimeCurrencyConversionResponse ¶ added in v0.5.0
type GetRealTimeCurrencyConversionResponse struct { BaseResponse InitialAmount float64 `json:"initialAmount,omitempty"` Converted float64 `json:"converted,omitempty"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` LastQuote ForexQuote `json:"last,omitempty"` }
GetRealTimeCurrencyConversionResponse is the response returned by the GetRealTimeCurrencyConversion method.
type GetSMAParams ¶ added in v1.3.0
type GetSMAParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan of the underlying aggregates. Timespan *Timespan `query:"timespan"` // Query indicators by timestamp. TimestampEQ *Millis `query:"timestamp"` TimestampLT *Millis `query:"timestamp.lt"` TimestampLTE *Millis `query:"timestamp.lte"` TimestampGT *Millis `query:"timestamp.gt"` TimestampGTE *Millis `query:"timestamp.gte"` // The attribute of the underlying aggregate which will be used to calculate the indicator. SeriesType *SeriesType `query:"series_type"` // Whether to also return the underlying aggregates used to calculate the indicator. ExpandUnderlying *bool `query:"expand_underlying"` // Whether or not the underlying aggregates used to calculate the indicator are adjusted for splits. By default, the aggregates are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 5000 Limit *int `query:"limit"` // The size of the window over which the indicator will be calculated. Window *int `query:"window"` }
GetSMAParams is the set of parameters for the GetSMA method.
func (GetSMAParams) WithAdjusted ¶ added in v1.3.0
func (p GetSMAParams) WithAdjusted(q bool) *GetSMAParams
func (GetSMAParams) WithExpandUnderlying ¶ added in v1.3.0
func (p GetSMAParams) WithExpandUnderlying(q bool) *GetSMAParams
func (GetSMAParams) WithLimit ¶ added in v1.14.1
func (p GetSMAParams) WithLimit(q int) *GetSMAParams
func (GetSMAParams) WithOrder ¶ added in v1.3.0
func (p GetSMAParams) WithOrder(q Order) *GetSMAParams
func (GetSMAParams) WithSeriesType ¶ added in v1.3.0
func (p GetSMAParams) WithSeriesType(q SeriesType) *GetSMAParams
func (GetSMAParams) WithTimespan ¶ added in v1.3.0
func (p GetSMAParams) WithTimespan(q Timespan) *GetSMAParams
func (GetSMAParams) WithTimestamp ¶ added in v1.3.0
func (p GetSMAParams) WithTimestamp(c Comparator, q Millis) *GetSMAParams
func (GetSMAParams) WithWindow ¶ added in v1.3.0
func (p GetSMAParams) WithWindow(q int) *GetSMAParams
type GetSMAResponse ¶ added in v1.3.0
type GetSMAResponse struct { BaseResponse Results SingleIndicatorResults `json:"results,omitempty"` }
GetAggsResponse is the response returned by the GetAggs method.
type GetSummaryParams ¶ added in v1.6.0
type GetSummaryParams struct { // The ticker list to get summaries for TickerAnyOf *string `query:"ticker.any_of"` }
func (GetSummaryParams) WithTickerAnyOf ¶ added in v1.6.0
func (p GetSummaryParams) WithTickerAnyOf(tickers ...string) *GetSummaryParams
type GetSummaryResponse ¶ added in v1.6.0
type GetSummaryResponse struct { BaseResponse Results []SummaryResult `json:"results,omitempty"` }
type GetTickerDetailsParams ¶
type GetTickerDetailsParams struct { // The ticker symbol of the asset. Ticker string `validate:"required" path:"ticker"` // Specify a point in time to get information about the ticker available on that date. When retrieving information // from SEC filings, we compare this date with the period of report date on the SEC filing. // // For example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on // 2019-06-29. That means that the filing was submitted on 2019-07-31, but the filing was created based on // information from 2019-06-29. If you were to query for AAPL details on 2019-06-29, the ticker details would // include information from the SEC filing. // // Defaults to the most recent available date. Date *Date `query:"date"` }
GetTickerDetailsParams is the set of parameters for the GetTickerDetails method.
func (GetTickerDetailsParams) WithDate ¶
func (p GetTickerDetailsParams) WithDate(q Date) *GetTickerDetailsParams
type GetTickerDetailsResponse ¶
type GetTickerDetailsResponse struct { BaseResponse // Ticker with details. Results Ticker `json:"results,omitempty"` }
GetTickerDetailsResponse is the response returned by the GetTickerDetails method.
type GetTickerEventsParams ¶ added in v1.8.0
type GetTickerEventsParams struct { // ID Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI. // When given a ticker, we return events for the entity currently represented by that ticker. // To find events for entities previously associated with a ticker, find the relevant identifier // using the Ticker Details Endpoint (https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker). ID string `validate:"required" path:"id"` // A comma-separated list of the types of event to include. Currently, ticker_change is the only supported event_type. Leave blank to return all supported event_types. Types *string `query:"types"` }
GetTickerEventsParams is the set of parameters for the GetTickerEvents method.
func (GetTickerEventsParams) WithTypes ¶ added in v1.8.0
func (p GetTickerEventsParams) WithTypes(types ...string) *GetTickerEventsParams
type GetTickerEventsResponse ¶ added in v1.8.0
type GetTickerEventsResponse struct { BaseResponse Results []TickerEventResult `json:"results,omitempty"` }
GetTickerEventsResponse is the response returned by the GetTickerEvents method.
type GetTickerRelatedCompaniesParams ¶ added in v1.16.5
type GetTickerRelatedCompaniesParams struct { // The ticker symbol of the asset. Ticker string `validate:"required" path:"ticker"` }
GetTickerRelatedCompaniesParams is the set of parameters for the GetTickerRelatedCompanies method.
type GetTickerRelatedCompaniesResponse ¶ added in v1.16.5
type GetTickerRelatedCompaniesResponse struct { BaseResponse // List if related tickers. Results []RelatedCompany `json:"results,omitempty"` }
GetTickerDetailsResponse is the response returned by the GetTickerRelatedCompanies method.
type GetTickerSnapshotParams ¶
type GetTickerSnapshotParams struct { // The locale of the market. Locale MarketLocale `validate:"required" path:"locale"` // The type of market to query. MarketType MarketType `validate:"required" path:"marketType"` // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` }
GetTickerSnapshotParams is the set of parameters for the GetTickerSnapshot method.
type GetTickerSnapshotResponse ¶
type GetTickerSnapshotResponse struct { BaseResponse Snapshot TickerSnapshot `json:"ticker,omitempty"` }
GetTickerSnapshotResponse is the response returned by the GetTickerSnapshot method.
type GetTickerTypesParams ¶
type GetTickerTypesParams struct { // Filter by asset class. AssetClass *AssetClass `query:"asset_class"` // Filter by locale. Locale *MarketLocale `query:"locale"` }
GetTickerTypesParams is the set of parameters for the GetTickerTypes method.
func (GetTickerTypesParams) WithAssetClass ¶
func (p GetTickerTypesParams) WithAssetClass(q AssetClass) *GetTickerTypesParams
func (GetTickerTypesParams) WithLocale ¶
func (p GetTickerTypesParams) WithLocale(q MarketLocale) *GetTickerTypesParams
type GetTickerTypesResponse ¶
type GetTickerTypesResponse struct { BaseResponse // Ticker type results. Results []TickerType `json:"results,omitempty"` }
GetTickerTypesResponse is the response returned by the GetTickerTypes method.
type Greeks ¶
type Greeks struct { Delta float64 `json:"delta,omitempty"` Gamma float64 `json:"gamma,omitempty"` Theta float64 `json:"theta,omitempty"` Vega float64 `json:"vega,omitempty"` }
Greeks contains the delta, gamma, vega, and theta of an option contract.
type IndexSession ¶ added in v1.11.0
type IndexSession struct { Change float64 `json:"change,omitempty"` ChangePercent float64 `json:"change_percent,omitempty"` Close float64 `json:"close,omitempty"` High float64 `json:"high,omitempty"` Low float64 `json:"low,omitempty"` Open float64 `json:"open,omitempty"` PreviousClose float64 `json:"previous_close,omitempty"` }
type IndexSnapshot ¶ added in v1.11.0
type IndexSnapshot struct { Value float64 `json:"value,omitempty"` Ticker string `json:"ticker,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` MarketStatus string `json:"market_status,omitempty"` Session IndexSession `json:"session,omitempty"` }
IndexSnapshot is a collection of data for an index ticker including the current session information and the most recent value.
type Insights ¶ added in v1.16.5
type Insights struct { Ticker string `json:"ticker"` Sentiment string `json:"sentiment"` SentimentReasoning string `json:"sentiment_reasoning"` }
Insights contains sentiment, reasoning, and the ticker symbol associated with the insight.
type LastQuote ¶
type LastQuote struct { Ticker string `json:"T,omitempty"` TrfTimestamp Nanos `json:"f,omitempty"` SequenceNumber int64 `json:"q,omitempty"` SipTimestamp Nanos `json:"t,omitempty"` ParticipantTimestamp Nanos `json:"y,omitempty"` AskPrice float64 `json:"P,omitempty"` AskSize float64 `json:"S,omitempty"` AskExchange int `json:"X,omitempty"` Conditions []int32 `json:"c,omitempty"` Indicators []int32 `json:"i,omitempty"` BidPrice float64 `json:"p,omitempty"` BidSize float64 `json:"s,omitempty"` BidExchange int `json:"x,omitempty"` Tape int32 `json:"z,omitempty"` }
LastQuote is the most recent NBBO for a ticker symbol.
type LastQuoteOptionContractSnapshot ¶
type LastQuoteOptionContractSnapshot struct { Ask float64 `json:"ask,omitempty"` AskSize float64 `json:"ask_size,omitempty"` Bid float64 `json:"bid,omitempty"` BidSize float64 `json:"bid_size,omitempty"` LastUpdated Nanos `json:"last_updated,omitempty"` Midpoint float64 `json:"midpoint,omitempty"` Timeframe string `json:"timeframe,omitempty"` }
LastQuoteOptionContractSnapshot contains the most recent quote of an option contract.
type LastQuoteSnapshot ¶
type LastQuoteSnapshot struct { AskPrice float64 `json:"P,omitempty"` BidPrice float64 `json:"p,omitempty"` AskSize float64 `json:"S,omitempty"` BidSize float64 `json:"s,omitempty"` Timestamp Nanos `json:"t,omitempty"` }
LastQuoteSnapshot is the most recent quote for a ticker.
type LastTrade ¶
type LastTrade struct { Ticker string `json:"T,omitempty"` TRFTimestamp Nanos `json:"f,omitempty"` SequenceNumber int64 `json:"q,omitempty"` Timestamp Nanos `json:"t,omitempty"` ParticipantTimestamp Nanos `json:"y,omitempty"` Conditions []int32 `json:"c,omitempty"` Correction uint32 `json:"e,omitempty"` ID string `json:"i,omitempty"` Price float64 `json:"p,omitempty"` TRF int32 `json:"r,omitempty"` Size float64 `json:"s,omitempty"` Exchange int32 `json:"x,omitempty"` Tape int32 `json:"z,omitempty"` }
LastTrade is the most recent trade for a specified ticker.
type LastTradeOptionContractSnapshot ¶ added in v1.10.0
type LastTradeOptionContractSnapshot struct { Timestamp Nanos `json:"sip_timestamp,omitempty"` Conditions []int32 `json:"conditions,omitempty"` Price float64 `json:"price,omitempty"` Size float64 `json:"size,omitempty"` Exchange int32 `json:"exchange,omitempty"` Timeframe string `json:"timeframe,omitempty"` }
type LastTradeSnapshot ¶
type LastTradeSnapshot struct { Conditions []int `json:"c,omitempty"` TradeID string `json:"i,omitempty"` Price float64 `json:"p,omitempty"` Size float64 `json:"s,omitempty"` Timestamp Nanos `json:"t,omitempty"` ExchangeID int `json:"x,omitempty"` }
LastTradeSnapshot is the most recent trade for a ticker.
type ListAggsParams ¶ added in v1.9.0
type ListAggsParams struct { // The ticker symbol of the stock/equity. Ticker string `validate:"required" path:"ticker"` // The size of the timespan multiplier. Multiplier int `validate:"required" path:"multiplier"` // The size of the time window. Timespan Timespan `validate:"required" path:"timespan"` // The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. From Millis `validate:"required" path:"from"` // The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp. To Millis `validate:"required" path:"to"` // Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get // results that are NOT adjusted for splits. Adjusted *bool `query:"adjusted"` // Order the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return // results in descending order (newest at the top). Order *Order `query:"sort"` // Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read // more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements: // https://polygon.io/blog/aggs-api-updates/. Limit *int `query:"limit"` }
ListAggsParams is the set of parameters for the ListAggs method.
func (ListAggsParams) WithAdjusted ¶ added in v1.9.0
func (p ListAggsParams) WithAdjusted(q bool) *ListAggsParams
func (ListAggsParams) WithLimit ¶ added in v1.9.0
func (p ListAggsParams) WithLimit(q int) *ListAggsParams
func (ListAggsParams) WithOrder ¶ added in v1.9.0
func (p ListAggsParams) WithOrder(q Order) *ListAggsParams
type ListAggsResponse ¶ added in v1.9.0
type ListAggsResponse struct { BaseResponse Ticker string `json:"ticker,omitempty"` QueryCount int `json:"queryCount,omitempty"` ResultsCount int `json:"resultsCount,omitempty"` Adjusted bool `json:"adjusted"` Results []Agg `json:"results,omitempty"` }
ListAggsResponse is the response returned by the ListAggs method.
type ListAssetSnapshotsParams
deprecated
added in
v1.12.0
type ListAssetSnapshotsParams ListUniversalSnapshotsParams
Deprecated: Please use UniversalSnapshot types instead of AssetSnapshot types.
func (ListAssetSnapshotsParams) WithTicker ¶ added in v1.12.0
func (p ListAssetSnapshotsParams) WithTicker(q string) *ListAssetSnapshotsParams
func (ListAssetSnapshotsParams) WithTickerAnyOf ¶ added in v1.12.0
func (p ListAssetSnapshotsParams) WithTickerAnyOf(q string) *ListAssetSnapshotsParams
func (ListAssetSnapshotsParams) WithTickersByComparison ¶ added in v1.12.0
func (p ListAssetSnapshotsParams) WithTickersByComparison(c Comparator, q string) *ListAssetSnapshotsParams
func (ListAssetSnapshotsParams) WithType ¶ added in v1.12.0
func (p ListAssetSnapshotsParams) WithType(q string) *ListAssetSnapshotsParams
type ListAssetSnapshotsResponse
deprecated
added in
v1.12.0
type ListAssetSnapshotsResponse ListUniversalSnapshotsResponse
Deprecated: Please use UniversalSnapshot types instead of AssetSnapshot types.
type ListConditionsParams ¶
type ListConditionsParams struct { // Filter for conditions within a given asset class. AssetClass *AssetClass `query:"asset_class,omitempty"` // Filter by data type. DataType *DataType `query:"data_type,omitempty"` // Filter for conditions with a given ID. ID *int64 `query:"id,omitempty"` // Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. SIP *SIP `query:"sip,omitempty"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListConditionsParams is the set of parameters for the ListConditions method.
func (ListConditionsParams) WithAssetClass ¶
func (p ListConditionsParams) WithAssetClass(q AssetClass) *ListConditionsParams
func (ListConditionsParams) WithDataType ¶
func (p ListConditionsParams) WithDataType(q DataType) *ListConditionsParams
func (ListConditionsParams) WithID ¶
func (p ListConditionsParams) WithID(q int64) *ListConditionsParams
func (ListConditionsParams) WithLimit ¶
func (p ListConditionsParams) WithLimit(q int) *ListConditionsParams
func (ListConditionsParams) WithOrder ¶
func (p ListConditionsParams) WithOrder(q Order) *ListConditionsParams
func (ListConditionsParams) WithSIP ¶
func (p ListConditionsParams) WithSIP(q SIP) *ListConditionsParams
func (ListConditionsParams) WithSort ¶
func (p ListConditionsParams) WithSort(q Sort) *ListConditionsParams
type ListConditionsResponse ¶
type ListConditionsResponse struct { BaseResponse Results []Condition `json:"results,omitempty"` }
ListConditionsResponse is the response returned by the ListConditions method.
type ListDividendsParams ¶
type ListDividendsParams struct { // Return the dividends that contain this ticker. TickerEQ *string `query:"ticker"` TickerLT *string `query:"ticker.lt"` TickerLTE *string `query:"ticker.lte"` TickerGT *string `query:"ticker.gt"` TickerGTE *string `query:"ticker.gte"` // Query by ex-dividend date with the format YYYY-MM-DD. ExDividendDateEQ *Date `query:"ex_dividend_date"` ExDividendDateLT *Date `query:"ex_dividend_date.lt"` ExDividendDateLTE *Date `query:"ex_dividend_date.lte"` ExDividendDateGT *Date `query:"ex_dividend_date.gt"` ExDividendDateGTE *Date `query:"ex_dividend_date.gte"` // Query by record date with the format YYYY-MM-DD. RecordDateEQ *Date `query:"record_date"` RecordDateLT *Date `query:"record_date.lt"` RecordDateLTE *Date `query:"record_date.lte"` RecordDateGT *Date `query:"record_date.gt"` RecordDateGTE *Date `query:"record_date.gte"` // Query by declaration date with the format YYYY-MM-DD. DeclarationDateEQ *Date `query:"declaration_date"` DeclarationDateLT *Date `query:"declaration_date.lt"` DeclarationDateLTE *Date `query:"declaration_date.lte"` DeclarationDateGT *Date `query:"declaration_date.gt"` DeclarationDateGTE *Date `query:"declaration_date.gte"` // Query by pay date with the format YYYY-MM-DD. PayDateEQ *Date `query:"pay_date"` PayDateLT *Date `query:"pay_date.lt"` PayDateLTE *Date `query:"pay_date.lte"` PayDateGT *Date `query:"pay_date.gt"` PayDateGTE *Date `query:"pay_date.gte"` // Query by the number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 // (bi-annually), 4 (quarterly), and 12 (monthly). Frequency *Frequency `query:"frequency"` // Query by the cash amount of the dividend. CashAmountEQ *float64 `query:"cash_amount"` CashAmountLT *float64 `query:"cash_amount.lt"` CashAmountLTE *float64 `query:"cash_amount.lte"` CashAmountGT *float64 `query:"cash_amount.gt"` CashAmountGTE *float64 `query:"cash_amount.gte"` // Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent // schedules are denoted as CD. Special Cash dividends that have been paid that are infrequent or unusual, and/or // can not be expected to occur in the future are denoted as SC. DividendType *DividendType `query:"dividend_type"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListDividendsParams is the set of parameters for the ListDividends method.
func (ListDividendsParams) WithCashAmount ¶
func (p ListDividendsParams) WithCashAmount(c Comparator, q float64) *ListDividendsParams
func (ListDividendsParams) WithDeclarationDate ¶
func (p ListDividendsParams) WithDeclarationDate(c Comparator, q Date) *ListDividendsParams
func (ListDividendsParams) WithDividendType ¶
func (p ListDividendsParams) WithDividendType(q DividendType) *ListDividendsParams
func (ListDividendsParams) WithExDividendDate ¶
func (p ListDividendsParams) WithExDividendDate(c Comparator, q Date) *ListDividendsParams
func (ListDividendsParams) WithFrequency ¶
func (p ListDividendsParams) WithFrequency(q Frequency) *ListDividendsParams
func (ListDividendsParams) WithLimit ¶
func (p ListDividendsParams) WithLimit(q int) *ListDividendsParams
func (ListDividendsParams) WithOrder ¶
func (p ListDividendsParams) WithOrder(q Order) *ListDividendsParams
func (ListDividendsParams) WithPayDate ¶ added in v1.16.5
func (p ListDividendsParams) WithPayDate(c Comparator, q Date) *ListDividendsParams
func (ListDividendsParams) WithSort ¶
func (p ListDividendsParams) WithSort(q Sort) *ListDividendsParams
func (ListDividendsParams) WithTicker ¶
func (p ListDividendsParams) WithTicker(c Comparator, q string) *ListDividendsParams
type ListDividendsResponse ¶
type ListDividendsResponse struct { BaseResponse Results []Dividend `json:"results,omitempty"` }
ListDividendsResponse is the response returned by the ListDividends method.
type ListOptionsChainParams ¶ added in v1.7.0
type ListOptionsChainParams struct { // The underlying ticker symbol of the option contract. UnderlyingAsset string `validate:"required" path:"underlyingAsset"` // The strike price of the option contract. StrikePrice *float64 `query:"strike_price"` StrikePriceLT *float64 `query:"strike_price.lt"` StrikePriceLTE *float64 `query:"strike_price.lte"` StrikePriceGT *float64 `query:"strike_price.gt"` StrikePriceGTE *float64 `query:"strike_price.gte"` // The type of contract. Can be ContractCall, ContractPut, or in some rare cases, ContractOther. ContractType *ContractType `query:"contract_type"` // The contract's expiration date in YYYY-MM-DD format. ExpirationDateEQ *Date `query:"expiration_date"` ExpirationDateLT *Date `query:"expiration_date.lt"` ExpirationDateLTE *Date `query:"expiration_date.lte"` ExpirationDateGT *Date `query:"expiration_date.gt"` ExpirationDateGTE *Date `query:"expiration_date.gte"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` // Order results based on the sort field. Order *Order `query:"order"` }
ListOptionsChainParams is a set of parameters for the ListOptionsChainSnapshot method.
func (ListOptionsChainParams) WithContractType ¶ added in v1.7.0
func (o ListOptionsChainParams) WithContractType(contractType ContractType) *ListOptionsChainParams
WithContractType sets contract type to params. contractType options include ContractCall and ContractPut.
func (ListOptionsChainParams) WithExpirationDate ¶ added in v1.7.0
func (o ListOptionsChainParams) WithExpirationDate(comparator Comparator, expirationDate Date) *ListOptionsChainParams
WithExpirationDate sets expiration_date query parameter. comparator options include EQ, LT, LTE, GT, and GTE. expirationDate should be in YYYY-MM-DD format
func (ListOptionsChainParams) WithLimit ¶ added in v1.7.0
func (o ListOptionsChainParams) WithLimit(limit int) *ListOptionsChainParams
WithLimit sets number of results returned. Limit default is 10. Limit must fall in range of 0-1000.
func (ListOptionsChainParams) WithOrder ¶ added in v1.7.0
func (o ListOptionsChainParams) WithOrder(order Order) *ListOptionsChainParams
WithOrder sets order of results based on the Sort field.
func (ListOptionsChainParams) WithSort ¶ added in v1.7.0
func (o ListOptionsChainParams) WithSort(sort Sort) *ListOptionsChainParams
WithSort sets sort field. Sort expects to receive TickerSymbol, ExpirationDate, or StrikePrice as an argument.
func (ListOptionsChainParams) WithStrikePrice ¶ added in v1.7.0
func (o ListOptionsChainParams) WithStrikePrice(comparator Comparator, strikePrice float64) *ListOptionsChainParams
WithStrikePrice sets strike price to params. Strike Price is the price at which a put or call option can be exercised. comparator options include EQ, LT, LTE, GT, and GTE. expirationDate should be in YYYY-MM-DD format
type ListOptionsChainSnapshotResponse ¶ added in v1.7.0
type ListOptionsChainSnapshotResponse struct { BaseResponse Results []OptionContractSnapshot `json:"results,omitempty"` }
type ListOptionsContractsParams ¶ added in v0.10.0
type ListOptionsContractsParams struct { // Return contracts relating to this underlying stock ticker. UnderlyingTickerEQ *string `query:"underlying_ticker"` UnderlyingTickerLT *string `query:"underlying_ticker.lt"` UnderlyingTickerLTE *string `query:"underlying_ticker.lte"` UnderlyingTickerGT *string `query:"underlying_ticker.gt"` UnderlyingTickerGTE *string `query:"underlying_ticker.gte"` // Specify the type of contract. ContractType *string `query:"contract_type"` // Specify the expiration date. ExpirationDateEQ *Date `query:"expiration_date"` ExpirationDateLT *Date `query:"expiration_date.lt"` ExpirationDateLTE *Date `query:"expiration_date.lte"` ExpirationDateGT *Date `query:"expiration_date.gt"` ExpirationDateGTE *Date `query:"expiration_date.gte"` // Specify a point in time for contracts as of this date with format YYYY-MM-DD. AsOf *Date `query:"as_of"` // Specify the strike price. StrikePriceEQ *float64 `query:"strike_price"` StrikePriceLT *float64 `query:"strike_price.lt"` StrikePriceLTE *float64 `query:"strike_price.lte"` StrikePriceGT *float64 `query:"strike_price.gt"` StrikePriceGTE *float64 `query:"strike_price.gte"` // Specify whether to query for expired contracts. Expired *bool `query:"expired"` // Sort field used for ordering. Sort *Sort `query:"sort"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` }
ListOptionsContracts is the set of parameters for the ListOptionsContracts method.
func (ListOptionsContractsParams) WithAsOf ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithAsOf(q Date) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithContractType ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithContractType(q string) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithExpirationDate ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithExpirationDate(c Comparator, q Date) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithExpired ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithExpired(q bool) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithLimit ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithLimit(q int) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithOrder ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithOrder(q Order) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithSort ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithSort(q Sort) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithStrikePrice ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithStrikePrice(c Comparator, q float64) *ListOptionsContractsParams
func (ListOptionsContractsParams) WithUnderlyingTicker ¶ added in v0.10.0
func (p ListOptionsContractsParams) WithUnderlyingTicker(c Comparator, q string) *ListOptionsContractsParams
type ListOptionsContractsResponse ¶ added in v0.10.0
type ListOptionsContractsResponse struct { BaseResponse Results []OptionsContract `json:"results,omitempty"` }
type ListQuotesParams ¶
type ListQuotesParams struct { // The ticker symbol to get quotes for. Ticker string `validate:"required" path:"ticker"` // Query by timestamp. To query for a specific day instead of a nanosecond timestamp, // set it via this pattern: params.WithDay(2006, 1, 2) // January 2, 2006. TimestampEQ *Nanos `query:"timestamp"` TimestampLT *Nanos `query:"timestamp.lt"` TimestampLTE *Nanos `query:"timestamp.lte"` TimestampGT *Nanos `query:"timestamp.gt"` TimestampGTE *Nanos `query:"timestamp.gte"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 50000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListQuotesParams is the set of parameters for the ListQuotes method.
func (ListQuotesParams) WithDay ¶ added in v1.1.0
func (p ListQuotesParams) WithDay(year int, month time.Month, day int) *ListQuotesParams
func (ListQuotesParams) WithLimit ¶
func (p ListQuotesParams) WithLimit(q int) *ListQuotesParams
func (ListQuotesParams) WithOrder ¶
func (p ListQuotesParams) WithOrder(q Order) *ListQuotesParams
func (ListQuotesParams) WithSort ¶
func (p ListQuotesParams) WithSort(q Sort) *ListQuotesParams
func (ListQuotesParams) WithTimestamp ¶
func (p ListQuotesParams) WithTimestamp(c Comparator, q Nanos) *ListQuotesParams
type ListQuotesResponse ¶
type ListQuotesResponse struct { BaseResponse Results []Quote `json:"results,omitempty"` }
ListQuotesResponse is the response returned by the ListQuotes method.
type ListSplitsParams ¶
type ListSplitsParams struct { // Return the stock splits that contain this ticker. TickerEQ *string `query:"ticker"` TickerLT *string `query:"ticker.lt"` TickerLTE *string `query:"ticker.lte"` TickerGT *string `query:"ticker.gt"` TickerGTE *string `query:"ticker.gte"` // Query by execution date with the format YYYY-MM-DD. ExecutionDateEQ *Date `query:"execution_date"` ExecutionDateLT *Date `query:"execution_date.lt"` ExecutionDateLTE *Date `query:"execution_date.lte"` ExecutionDateGT *Date `query:"execution_date.gt"` ExecutionDateGTE *Date `query:"execution_date.gte"` // Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse // split. By default this filter is not used. ReverseSplit *bool `query:"reverse_split"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListSplitsParams is the set of parameters for the ListSplits method.
func (ListSplitsParams) WithExecutionDate ¶
func (p ListSplitsParams) WithExecutionDate(c Comparator, q Date) *ListSplitsParams
func (ListSplitsParams) WithLimit ¶
func (p ListSplitsParams) WithLimit(q int) *ListSplitsParams
func (ListSplitsParams) WithOrder ¶
func (p ListSplitsParams) WithOrder(q Order) *ListSplitsParams
func (ListSplitsParams) WithReverseSplit ¶
func (p ListSplitsParams) WithReverseSplit(q bool) *ListSplitsParams
func (ListSplitsParams) WithSort ¶
func (p ListSplitsParams) WithSort(q Sort) *ListSplitsParams
func (ListSplitsParams) WithTicker ¶
func (p ListSplitsParams) WithTicker(c Comparator, q string) *ListSplitsParams
type ListSplitsResponse ¶
type ListSplitsResponse struct { BaseResponse Results []Split `json:"results,omitempty"` }
ListSplitsResponse is the response returned by the ListSplits method.
type ListStockFinancialsParams ¶ added in v0.7.0
type ListStockFinancialsParams struct { // Query by company ticker. Ticker *string `query:"ticker"` // Query by central index key Number (CIK: https://www.sec.gov/edgar/searchedgar/cik.htm). CIK *string `query:"cik"` // Query by company name. CompanyNameFull *string `query:"company_name"` CompanyNameSearch *string `query:"company_name.search"` // Query by standard industrial classification (SIC: // https://www.sec.gov/corpfin/division-of-corporation-finance-standard-industrial-classification-sic-code-list). SIC *string `query:"sic"` // Query by the date when the filing with financials data was filed in YYYY-MM-DD format. // // Best used when querying over date ranges to find financials based on filings that happen in a time period. // // Examples: // // To get financials based on filings that have happened after January 1, 2009 use the query param // filing_date.gte=2009-01-01. // // To get financials based on filings that happened in the year 2009 use the query params // filing_date.gte=2009-01-01&filing_date.lt=2010-01-01. FilingDateEQ *Date `query:"filing_dividend_date"` FilingDateLT *Date `query:"filing_dividend_date.lt"` FilingDateLTE *Date `query:"filing_dividend_date.lte"` FilingDateGT *Date `query:"filing_dividend_date.gt"` FilingDateGTE *Date `query:"filing_dividend_date.gte"` // The period of report for the filing with financials data in YYYY-MM-DD format. PeriodOfReportDateEQ *Date `query:"period_of_report_date"` PeriodOfReportDateLT *Date `query:"period_of_report_date.lt"` PeriodOfReportDateLTE *Date `query:"period_of_report_date.lte"` PeriodOfReportDateGT *Date `query:"period_of_report_date.gt"` PeriodOfReportDateGTE *Date `query:"period_of_report_date.gte"` // Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q // filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their // annual report, so some companies my not return quarterly financials for Q4. Timeframe *Timeframe `query:"timeframe"` // Whether or not to include the xpath and formula attributes for each financial data point. See the xpath and // formula response attributes for more info. False by default. IncludeSources *bool `query:"include_sources"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 100. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListStockFinancialsParams is the set of parameters for the ListStockFinancials method.
func (ListStockFinancialsParams) WithCIK ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithCIK(q string) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithCompanyName ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithCompanyName(c NameComparator, q string) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithFilingDate ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithFilingDate(c Comparator, q Date) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithIncludeSources ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithIncludeSources(q bool) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithLimit ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithLimit(q int) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithOrder ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithOrder(q Order) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithPeriodOfReportDate ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithPeriodOfReportDate(c Comparator, q Date) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithSIC ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithSIC(q string) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithSort ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithSort(q Sort) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithTicker ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithTicker(q string) *ListStockFinancialsParams
func (ListStockFinancialsParams) WithTimeframe ¶ added in v0.7.0
func (p ListStockFinancialsParams) WithTimeframe(q Timeframe) *ListStockFinancialsParams
type ListStockFinancialsResponse ¶ added in v0.7.0
type ListStockFinancialsResponse struct { BaseResponse Results []StockFinancial `json:"results,omitempty"` }
ListStockFinancialsResponse is the response returned by the ListFinancials method.
type ListTickerNewsParams ¶ added in v0.4.0
type ListTickerNewsParams struct { // Return results that contain this ticker. TickerEQ *string `query:"ticker"` TickerLT *string `query:"ticker.lt"` TickerLTE *string `query:"ticker.lte"` TickerGT *string `query:"ticker.gt"` TickerGTE *string `query:"ticker.gte"` // Return results published on, before, or after this date. PublishedUtcEQ *Millis `query:"published_utc"` PublishedUtcLT *Millis `query:"published_utc.lt"` PublishedUtcLTE *Millis `query:"published_utc.lte"` PublishedUtcGT *Millis `query:"published_utc.gt"` PublishedUtcGTE *Millis `query:"published_utc.gte"` // Sort field used for ordering. Sort *Sort `query:"sort"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 1000. Limit *int `query:"limit"` }
ListTickerNewsParams is the set of parameters for the ListTickerNews method.
func (ListTickerNewsParams) WithLimit ¶ added in v0.4.0
func (p ListTickerNewsParams) WithLimit(q int) *ListTickerNewsParams
func (ListTickerNewsParams) WithOrder ¶ added in v0.4.0
func (p ListTickerNewsParams) WithOrder(q Order) *ListTickerNewsParams
func (ListTickerNewsParams) WithPublishedUTC ¶ added in v0.4.0
func (p ListTickerNewsParams) WithPublishedUTC(c Comparator, q Millis) *ListTickerNewsParams
func (ListTickerNewsParams) WithSort ¶ added in v0.4.0
func (p ListTickerNewsParams) WithSort(q Sort) *ListTickerNewsParams
func (ListTickerNewsParams) WithTicker ¶ added in v0.4.0
func (p ListTickerNewsParams) WithTicker(c Comparator, q string) *ListTickerNewsParams
type ListTickerNewsResponse ¶ added in v0.4.0
type ListTickerNewsResponse struct { BaseResponse // Ticker news results. Results []TickerNews `json:"results,omitempty"` }
ListTickerNewsResponse is the response returned by the ListTickerNews method.
type ListTickersParams ¶
type ListTickersParams struct { // Specify a ticker symbol. Defaults to empty string which queries all tickers. TickerEQ *string `query:"ticker"` TickerLT *string `query:"ticker.lt"` TickerLTE *string `query:"ticker.lte"` TickerGT *string `query:"ticker.gt"` TickerGTE *string `query:"ticker.gte"` // Specify the type of the tickers. Find the types that we support via our Ticker Types API. Defaults to empty // string which queries all types. Type *string `query:"type"` // Filter by market type. By default all markets are included. Market *AssetClass `query:"market"` // Specify the asset's primary exchange Market Identifier Code (MIC) according to ISO 10383. Defaults to empty // string which queries all exchanges. Exchange *string `query:"exchange"` // Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes at their // website. Defaults to empty string which queries all CUSIPs. // // Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response. CUSIP *int `query:"cusip"` // Specify the CIK of the asset you want to search for. Find more information about CIK codes at their website. // Defaults to empty string which queries all CIKs. CIK *int `query:"cik"` // Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. Date *Date `query:"date"` // Specify if the tickers returned should be actively traded on the queried date. Default is true. Active *bool `query:"active"` // Search for terms within the ticker and/or company name. Search *string `query:"search"` // The field to sort the results on. Default is ticker. If the search query parameter is present, sort is ignored // and results are ordered by relevance. Sort *Sort `query:"sort"` // The order to sort the results on. Default is asc (ascending). Order *Order `query:"order"` // Limit the size of the response, default is 100 and max is 1000. Limit *int `query:"limit"` }
ListTickersParams is the set of parameters for the ListTickers method.
func (ListTickersParams) WithActive ¶
func (p ListTickersParams) WithActive(q bool) *ListTickersParams
func (ListTickersParams) WithCIK ¶
func (p ListTickersParams) WithCIK(q int) *ListTickersParams
func (ListTickersParams) WithCUSIP ¶
func (p ListTickersParams) WithCUSIP(q int) *ListTickersParams
func (ListTickersParams) WithDate ¶
func (p ListTickersParams) WithDate(q Date) *ListTickersParams
func (ListTickersParams) WithExchange ¶
func (p ListTickersParams) WithExchange(q string) *ListTickersParams
func (ListTickersParams) WithLimit ¶
func (p ListTickersParams) WithLimit(q int) *ListTickersParams
func (ListTickersParams) WithMarket ¶
func (p ListTickersParams) WithMarket(q AssetClass) *ListTickersParams
func (ListTickersParams) WithOrder ¶
func (p ListTickersParams) WithOrder(q Order) *ListTickersParams
func (ListTickersParams) WithSearch ¶
func (p ListTickersParams) WithSearch(q string) *ListTickersParams
func (ListTickersParams) WithSort ¶
func (p ListTickersParams) WithSort(q Sort) *ListTickersParams
func (ListTickersParams) WithTicker ¶
func (p ListTickersParams) WithTicker(c Comparator, q string) *ListTickersParams
func (ListTickersParams) WithType ¶
func (p ListTickersParams) WithType(q string) *ListTickersParams
type ListTickersResponse ¶
type ListTickersResponse struct { BaseResponse // An array of tickers that match your query. Note: Although you can query by CUSIP, due to legal reasons we do not // return the CUSIP in the response. Results []Ticker `json:"results,omitempty"` }
ListTickersResponse is the response returned by the ListTickers method.
type ListTradesParams ¶
type ListTradesParams struct { // The ticker symbol to get trades for. Ticker string `validate:"required" path:"ticker"` // Query by timestamp. To query for a specific day instead of a nanosecond timestamp, // set it via this pattern: params.WithDay(2006, 1, 2) // January 2, 2006. TimestampEQ *Nanos `query:"timestamp"` TimestampLT *Nanos `query:"timestamp.lt"` TimestampLTE *Nanos `query:"timestamp.lte"` TimestampGT *Nanos `query:"timestamp.gt"` TimestampGTE *Nanos `query:"timestamp.gte"` // Order results based on the sort field. Order *Order `query:"order"` // Limit the number of results returned, default is 10 and max is 50000. Limit *int `query:"limit"` // Sort field used for ordering. Sort *Sort `query:"sort"` }
ListTradesParams is the set of parameters for the ListTrades method.
func (ListTradesParams) WithDay ¶ added in v1.1.0
func (p ListTradesParams) WithDay(year int, month time.Month, day int) *ListTradesParams
func (ListTradesParams) WithLimit ¶
func (p ListTradesParams) WithLimit(q int) *ListTradesParams
func (ListTradesParams) WithOrder ¶
func (p ListTradesParams) WithOrder(q Order) *ListTradesParams
func (ListTradesParams) WithSort ¶
func (p ListTradesParams) WithSort(q Sort) *ListTradesParams
func (ListTradesParams) WithTimestamp ¶
func (p ListTradesParams) WithTimestamp(c Comparator, q Nanos) *ListTradesParams
type ListTradesResponse ¶
type ListTradesResponse struct { BaseResponse Results []Trade `json:"results,omitempty"` }
ListTradesResponse is the response returned by the ListTrades method.
type ListUniversalSnapshotsParams ¶ added in v1.12.1
type ListUniversalSnapshotsParams struct { TickerAnyOf *string `query:"ticker.any_of"` Ticker *string `query:"ticker"` TickerLT *string `query:"ticker.lt"` TickerLTE *string `query:"ticker.lte"` TickerGT *string `query:"ticker.gt"` TickerGTE *string `query:"ticker.gte"` Type *string `query:"type"` }
ListUniversalSnapshotsParams is a set of parameters for the ListUniversalSnapshots method.
func (ListUniversalSnapshotsParams) WithTicker ¶ added in v1.12.1
func (p ListUniversalSnapshotsParams) WithTicker(q string) *ListUniversalSnapshotsParams
WithTicker sets the ticker equality query param.
func (ListUniversalSnapshotsParams) WithTickerAnyOf ¶ added in v1.12.1
func (p ListUniversalSnapshotsParams) WithTickerAnyOf(q string) *ListUniversalSnapshotsParams
WithTickerAnyOf sets the ticker.any_of query param.
func (ListUniversalSnapshotsParams) WithTickersByComparison ¶ added in v1.12.1
func (p ListUniversalSnapshotsParams) WithTickersByComparison(c Comparator, q string) *ListUniversalSnapshotsParams
WithTickersByComparison sets the ticker inequality query params. Comparator options include EQ, LT, LTE, GT, and GTE.
func (ListUniversalSnapshotsParams) WithType ¶ added in v1.12.1
func (p ListUniversalSnapshotsParams) WithType(q string) *ListUniversalSnapshotsParams
WithType sets the type query param.
type ListUniversalSnapshotsResponse ¶ added in v1.12.1
type ListUniversalSnapshotsResponse struct { BaseResponse Results []SnapshotResponseModel `json:"results,omitempty"` }
ListUniversalSnapshotsResponse is the response returned by the ListUniversalSnapshots method.
type MACDIndicatorResults ¶ added in v1.3.0
type MACDIndicatorResults struct { Underlying UnderlyingResults `json:"underlying,omitempty"` Values MACDIndicatorValues `json:"values,omitempty"` }
type MACDIndicatorValue ¶ added in v1.3.0
type MACDIndicatorValues ¶ added in v1.3.0
type MACDIndicatorValues []MACDIndicatorValue
type MarketHoliday ¶
type MarketHoliday struct { Exchange string `json:"exchange,omitempty"` Name string `json:"name,omitempty"` Date Date `json:"date,omitempty"` Status string `json:"status,omitempty"` Open Time `json:"open,omitempty"` Close Time `json:"close,omitempty"` }
MarketHoliday represents a market holiday for a specific exchange.
type MarketLocale ¶
type MarketLocale string
Locale is the market location.
const ( US MarketLocale = "us" Global MarketLocale = "global" )
type MarketType ¶
type MarketType string
MarketType is the type of market.
const ( Stocks MarketType = "stocks" Forex MarketType = "forex" Crypto MarketType = "crypto" )
type Millis ¶
Millis represents a Unix time in milliseconds since January 1, 1970 UTC.
func (Millis) MarshalJSON ¶
func (*Millis) UnmarshalJSON ¶
type MinuteSnapshot ¶
type MinuteSnapshot struct { AccumulatedVolume float64 `json:"av,omitempty"` Close float64 `json:"c,omitempty"` High float64 `json:"h,omitempty"` Low float64 `json:"l,omitempty"` Open float64 `json:"o,omitempty"` Volume float64 `json:"v,omitempty"` VolumeWeightedAverage float64 `json:"vw,omitempty"` NumberOfTransactions float64 `json:"n,omitempty"` Timestamp Millis `json:"t,omitempty"` OTC bool `json:"otc,omitempty"` }
MinuteSnapshot is the most recent minute agg for a ticker.
type NameComparator ¶ added in v0.7.0
type NameComparator string
NameComparator is the type of comparison to make for the company_name query parameter in Stock Financials.
const ( Full NameComparator = "full" Search NameComparator = "search" )
type Nanos ¶
Nanos represents a Unix time in nanoseconds since January 1, 1970 UTC.
func (Nanos) MarshalJSON ¶
func (*Nanos) UnmarshalJSON ¶
type OptionContractSnapshot ¶
type OptionContractSnapshot struct { BreakEvenPrice float64 `json:"break_even_price,omitempty"` Day DayOptionContractSnapshot `json:"day,omitempty"` Details OptionDetails `json:"details,omitempty"` Greeks Greeks `json:"greeks,omitempty"` ImpliedVolatility float64 `json:"implied_volatility,omitempty"` LastQuote LastQuoteOptionContractSnapshot `json:"last_quote,omitempty"` LastTrade LastTradeOptionContractSnapshot `json:"last_trade,omitempty"` OpenInterest float64 `json:"open_interest,omitempty"` UnderlyingAsset UnderlyingAsset `json:"underlying_asset,omitempty"` FairMarketValue float64 `json:"fmv,omitempty"` }
OptionContractSnapshot is a collection of data for an option contract ticker including the current day aggregate and the most recent quote.
type OptionDetails ¶
type OptionDetails struct { ContractType string `json:"contract_type,omitempty"` ExerciseStyle string `json:"exercise_style,omitempty"` ExpirationDate Date `json:"expiration_date,omitempty"` StrikePrice float64 `json:"strike_price,omitempty"` Ticker string `json:"ticker,omitempty"` }
OptionDetails contains more detailed information about an option contract.
type OptionsContract ¶ added in v0.10.0
type OptionsContract struct { AdditionalUnderlyings []Underlying `json:"additional_underlyings,omitempty"` CFI string `json:"cfi,omitempty"` ContractType string `json:"contract_type,omitempty"` Correction int32 `json:"correction,omitempty"` ExerciseStyle string `json:"exercise_style,omitempty"` ExpirationDate Date `json:"expiration_date,omitempty"` PrimaryExchange string `json:"primary_exchange,omitempty"` StrikePrice float64 `json:"strike_price,omitempty"` Ticker string `json:"ticker,omitempty"` UnderlyingTicker string `json:"underlying_ticker,omitempty"` }
OptionsContract contains detailed information on a specified options contract.
type Order ¶
type Order string
Order the results. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).
type OrderBookQuote ¶
type OrderBookQuote struct { Price float64 `json:"p,omitempty"` }
OrderBookQuote contains quote information for a crypto ticker.
type PaginationHooks ¶
type PaginationHooks struct { // If present, this value can be used to fetch the next page of data. NextURL string `json:"next_url,omitempty"` }
PaginationHooks are links to next and/or previous pages. Embed this struct into an API response if the endpoint supports pagination.
func (PaginationHooks) NextPage ¶ added in v0.2.0
func (p PaginationHooks) NextPage() string
type Publisher ¶ added in v0.4.0
type Publisher struct { FaviconURL string `json:"favicon_url,omitempty"` HomepageURL string `json:"homepage_url,omitempty"` LogoURL string `json:"logo_url,omitempty"` Name string `json:"name,omitempty"` }
Publisher contains information on a new article publisher.
type Quote ¶
type Quote struct { AskExchange int `json:"ask_exchange,omitempty"` AskPrice float64 `json:"ask_price,omitempty"` AskSize float64 `json:"ask_size,omitempty"` BidExchange int `json:"bid_exchange,omitempty"` BidPrice float64 `json:"bid_price,omitempty"` BidSize float64 `json:"bid_size,omitempty"` Conditions []int32 `json:"conditions,omitempty"` Indicators []int32 `json:"indicators,omitempty"` ParticipantTimestamp Nanos `json:"participant_timestamp,omitempty"` SequenceNumber int64 `json:"sequence_number,omitempty"` SipTimestamp Nanos `json:"sip_timestamp,omitempty"` Tape int32 `json:"tape,omitempty"` TrfTimestamp Nanos `json:"trf_timestamp,omitempty"` }
Quote is an NBBO for a ticker symbol in a given time range.
type RelatedCompany ¶ added in v1.16.5
type RelatedCompany struct {
Ticker string `json:"ticker,omitempty"`
}
RelatedCompany represents a related ticker based on news or sec filings.
type RequestOption ¶
type RequestOption func(o *RequestOptions)
RequestOption changes the configuration of RequestOptions.
func EdgeUserAgent ¶ added in v1.6.0
func EdgeUserAgent(userAgent string) RequestOption
EdgeUserAgent sets the Launchpad optional header denoting the Edge User's UserAgent.
func QueryParam ¶
func QueryParam(key, value string) RequestOption
QueryParam sets a query param as an option.
func RequiredEdgeHeaders ¶ added in v1.6.0
func RequiredEdgeHeaders(edgeID, edgeIPAddress string) RequestOption
RequiredEdgeHeaders sets the required headers for the Launchpad product.
func WithTrace ¶ added in v1.13.1
func WithTrace(trace bool) RequestOption
WithTrace enables or disables request tracing.
type RequestOptions ¶
type RequestOptions struct { // APIKey to pass with the request APIKey *string // Headers to apply to the request Headers http.Header // Query params to apply to the request QueryParams url.Values // Trace enables request tracing Trace bool }
RequestOptions are used to configure client calls.
type SIPMapping ¶ added in v0.9.0
type SIPMapping struct { CTA string `json:"CTA,omitempty"` OPRA string `json:"OPRA,omitempty"` UTP string `json:"UTP,omitempty"` }
SIPMapping maps a condition to symbols for each SIP.
type SeriesType ¶ added in v1.3.0
type SeriesType string
const ( High SeriesType = "high" Open SeriesType = "open" Low SeriesType = "low" Close SeriesType = "close" )
type Session ¶ added in v1.6.0
type Session struct { Change float64 `json:"change,omitempty"` ChangePercent float64 `json:"change_percent,omitempty"` EarlyTradingChange float64 `json:"early_trading_change,omitempty"` EarlyTradingChangePercent float64 `json:"early_trading_change_percent,omitempty"` RegularTradingChange float64 `json:"regular_trading_change,omitempty"` RegularTradingChangePercent float64 `json:"regular_trading_change_percent,omitempty"` LateTradingChange float64 `json:"late_trading_change,omitempty"` LateTradingChangePercent float64 `json:"late_trading_change_percent,omitempty"` Close float64 `json:"close,omitempty"` High float64 `json:"high,omitempty"` Low float64 `json:"low,omitempty"` Open float64 `json:"open,omitempty"` PreviousClose float64 `json:"previous_close,omitempty"` Volume float64 `json:"volume,omitempty"` Price float64 `json:"price,omitempty"` }
type SingleIndicatorResults ¶ added in v1.3.0
type SingleIndicatorResults struct { Underlying UnderlyingResults `json:"underlying,omitempty"` Values SingleIndicatorValues `json:"values,omitempty"` }
type SingleIndicatorValue ¶ added in v1.3.0
type SingleIndicatorValues ¶ added in v1.3.0
type SingleIndicatorValues []SingleIndicatorValue
type SnapshotLastQuote ¶ added in v1.12.0
type SnapshotLastQuote struct { Ask float64 `json:"ask,omitempty"` AskSize float64 `json:"ask_size,omitempty"` Bid float64 `json:"bid,omitempty"` BidSize float64 `json:"bid_size,omitempty"` LastUpdated int64 `json:"last_updated,omitempty"` Midpoint float64 `json:"midpoint,omitempty"` Timeframe string `json:"timeframe,omitempty"` Exchange int64 `json:"exchange,omitempty"` }
SnapshotLastQuote contains all the information that might come back in the last_quote attribute of a SnapshotResponse.
type SnapshotLastTrade ¶ added in v1.12.0
type SnapshotLastTrade struct { Timestamp int64 `json:"sip_timestamp,omitempty"` ParticipantTimestamp int64 `json:"participant_timestamp,omitempty"` Conditions []int32 `json:"conditions,omitempty"` Price float64 `json:"price,omitempty"` Size uint32 `json:"size,omitempty"` Exchange int32 `json:"exchange,omitempty"` Timeframe string `json:"timeframe,omitempty"` ID string `json:"id,omitempty"` LastUpdated int64 `json:"last_updated,omitempty"` }
SnapshotLastTrade contains all the information that might come back in the last_trade attribute of a SnapshotResponse.
type SnapshotResponseModel ¶ added in v1.12.0
type SnapshotResponseModel struct { Name string `json:"name,omitempty"` MarketStatus string `json:"market_status,omitempty"` Ticker string `json:"ticker,omitempty"` Type string `json:"type,omitempty"` LastQuote SnapshotLastQuote `json:"last_quote,omitempty"` LastTrade SnapshotLastTrade `json:"last_trade,omitempty"` Session Session `json:"session,omitempty"` BreakEvenPrice float64 `json:"break_even_price,omitempty"` Details Details `json:"details,omitempty"` Greeks Greeks `json:"greeks,omitempty"` ImpliedVolatility float64 `json:"implied_volatility,omitempty"` OpenInterest float64 `json:"open_interest,omitempty"` UnderlyingAsset UnderlyingAsset `json:"underlying_asset,omitempty"` Value float64 `json:"value,omitempty"` LastUpdated int64 `json:"last_updated,omitempty"` Timeframe string `json:"timeframe,omitempty"` FairMarketValue float64 `json:"fmv,omitempty"` Error string `json:"error"` Message string `json:"message"` }
SnapshotResponseModel contains all the information that might come back in a SnapshotResponse.
type Sort ¶
type Sort string
Sort is a query param type that specifies how the results should be sorted.
const ( TickerSymbol Sort = "ticker" Name Sort = "name" Market Sort = "market" Locale Sort = "locale" PrimaryExchange Sort = "primary_exchange" Type Sort = "type" CurrencySymbol Sort = "currency_symbol" CurrencyName Sort = "currency_name" BaseCurrencySymbol Sort = "base_currency_symbol" BaseCurrencyName Sort = "base_currency_name" CIK Sort = "cik" CompositeFIGI Sort = "composite_figi" PublishedUTC Sort = "published_utc" LastUpdatedUTC Sort = "last_updated_utc" DelistedUTC Sort = "delisted_utc" Timestamp Sort = "timestamp" StrikePrice Sort = "strike_price" ExpirationDate Sort = "expiration_date" FilingDate Sort = "filing_date" PeriodOfReportDate Sort = "period_of_report_date" )
type Split ¶
type Split struct { ExecutionDate Date `json:"execution_date,omitempty"` SplitFrom float64 `json:"split_from,omitempty"` SplitTo float64 `json:"split_to,omitempty"` Ticker string `json:"ticker,omitempty"` }
Split contains detailed information on a specified stock split.
type StockFinancial ¶ added in v0.7.0
type StockFinancial struct { CIK string `json:"cik,omitempty"` CompanyName string `json:"company_name,omitempty"` EndDate string `json:"end_date,omitempty"` FilingDate string `json:"filing_date,omitempty"` Financials map[string]Financial `json:"financials,omitempty"` FiscalPeriod string `json:"fiscal_period,omitempty"` FiscalYear string `json:"fiscal_year,omitempty"` SourceFilingFileUrl string `json:"source_filing_file_url,omitempty"` SourceFilingUrl string `json:"source_filing_url,omitempty"` StartDate string `json:"start_date,omitempty"` }
StockFinancial contains detailed information on a specified stock financial.
type SummaryResult ¶ added in v1.6.0
type SummaryResult struct { Price float64 `json:"price,omitempty"` Name string `json:"name,omitempty"` Ticker string `json:"ticker,omitempty"` Branding Branding `json:"branding,omitempty"` MarketStatus string `json:"market_status,omitempty"` Type string `json:"type,omitempty"` Session Session `json:"session,omitempty"` Options Options `json:"options,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` }
type Ticker ¶
type Ticker struct { Active bool `json:"active"` Address CompanyAddress `json:"address,omitempty"` Branding Branding `json:"branding,omitempty"` CIK string `json:"cik,omitempty"` CompositeFIGI string `json:"composite_figi,omitempty"` CurrencyName string `json:"currency_name,omitempty"` CurrencySymbol string `json:"currency_symbol,omitempty"` BaseCurrencyName string `json:"base_currency_name,omitempty"` BaseCurrencySymbol string `json:"base_currency_symbol,omitempty"` DelistedUTC Time `json:"delisted_utc,omitempty"` Description string `json:"description,omitempty"` HomepageURL string `json:"homepage_url,omitempty"` LastUpdatedUTC Time `json:"last_updated_utc,omitempty"` ListDate Date `json:"list_date,omitempty"` Locale string `json:"locale,omitempty"` Market string `json:"market,omitempty"` MarketCap float64 `json:"market_cap,omitempty"` Name string `json:"name,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` PrimaryExchange string `json:"primary_exchange,omitempty"` SICCode string `json:"sic_code,omitempty"` SICDescription string `json:"sic_description,omitempty"` Ticker string `json:"ticker,omitempty"` TickerRoot string `json:"ticker_root,omitempty"` TickerSuffix string `json:"ticker_suffix,omitempty"` TotalEmployees int32 `json:"total_employees,omitempty"` Type string `json:"type,omitempty"` SourceFeed string `json:"source_feed,omitempty"` }
Ticker contains detailed information on a specified ticker symbol.
type TickerChangeEvent ¶ added in v1.8.0
type TickerChangeEvent struct {
Ticker string `json:"ticker"`
}
TickerChangeEvent represents the data relevant to a ticker_change typed event.
type TickerEvent ¶ added in v1.8.0
type TickerEvent struct { Date Date `json:"date"` Type string `json:"type"` TickerChange *TickerChangeEvent `json:"ticker_change,omitempty"` }
TickerEvent contains the data for the different type of ticker events that could occur.
type TickerEventResult ¶ added in v1.8.0
type TickerEventResult struct { // Name is the company name. Name string `json:"name"` Events []TickerEvent `json:"events"` }
TickerEventResult is the data for a ticker event.
type TickerNews ¶ added in v0.4.0
type TickerNews struct { AMPURL string `json:"amp_url,omitempty"` ArticleURL string `json:"article_url,omitempty"` Author string `json:"author,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id,omitempty"` ImageURL string `json:"image_url,omitempty"` Insights []Insights `json:"insights"` Keywords []string `json:"keywords,omitempty"` PublishedUTC Time `json:"published_utc,omitempty"` Publisher Publisher `json:"publisher,omitempty"` Tickers []string `json:"tickers,omitempty"` Title string `json:"title,omitempty"` }
TickerNews contains information on a ticker news article.
type TickerSnapshot ¶
type TickerSnapshot struct { Day DaySnapshot `json:"day,omitempty"` LastQuote LastQuoteSnapshot `json:"lastQuote,omitempty"` LastTrade LastTradeSnapshot `json:"lastTrade,omitempty"` Minute MinuteSnapshot `json:"min,omitempty"` PrevDay DaySnapshot `json:"prevDay,omitempty"` Ticker string `json:"ticker,omitempty"` TodaysChange float64 `json:"todaysChange,omitempty"` TodaysChangePerc float64 `json:"todaysChangePerc,omitempty"` Updated Nanos `json:"updated,omitempty"` FairMarketValue float64 `json:"fmv,omitempty"` }
TickerSnapshot is a collection of data for a ticker including the current minute, day, and previous day's aggregate, as well as the last trade and quote.
type TickerType ¶
type TickerType struct { AssetClass string `json:"asset_class,omitempty"` Code string `json:"code,omitempty"` Description string `json:"description,omitempty"` Locale string `json:"locale,omitempty"` }
TickerType represents a type of ticker with a code that the API understands.
type Time ¶
Time represents a long date string of the following format: "2006-01-02T15:04:05.000Z".
func (*Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
type Timeframe ¶ added in v0.7.0
type Timeframe string
TimeFrame is the type of time frame query parameter for stock financials.
type Trade ¶
type Trade struct { Conditions []int32 `json:"conditions,omitempty"` Correction int `json:"correction,omitempty"` Exchange int `json:"exchange,omitempty"` ID string `json:"id,omitempty"` ParticipantTimestamp Nanos `json:"participant_timestamp,omitempty"` Price float64 `json:"price,omitempty"` SequenceNumber int64 `json:"sequence_number,omitempty"` SipTimestamp Nanos `json:"sip_timestamp,omitempty"` Size float64 `json:"size,omitempty"` Tape int32 `json:"tape,omitempty"` TrfID int `json:"trf_id,omitempty"` TrfTimestamp Nanos `json:"trf_timestamp,omitempty"` }
Trade contains trade data for a specified ticker symbol.
type Underlying ¶ added in v0.10.0
type Underlying struct { Amount float64 `json:"amount,omitempty"` Type string `json:"type,omitempty"` Underlying string `json:"underlying,omitempty"` }
An underlying or deliverable associated with an option contract.
type UnderlyingAsset ¶
type UnderlyingAsset struct { ChangeToBreakEven float64 `json:"change_to_break_even,omitempty"` LastUpdated int64 `json:"last_updated,omitempty"` Price float64 `json:"price,omitempty"` Value float64 `json:"value,omitempty"` Ticker string `json:"ticker,omitempty"` Timeframe string `json:"timeframe,omitempty"` }
UnderlyingAsset contains information on the underlying stock for this options contract.
type UnderlyingResults ¶ added in v1.3.0
type UpdateRules ¶ added in v0.9.0
type UpdateRules struct { Consolidated struct { UpdatesHighLow bool `json:"updates_high_low,omitempty"` UpdatesOpenClose bool `json:"updates_open_close,omitempty"` UpdatesVolume bool `json:"updates_volume,omitempty"` } `json:"consolidated,omitempty"` MarketCenter struct { UpdatesHighLow bool `json:"updates_high_low,omitempty"` UpdatesOpenClose bool `json:"updates_open_close,omitempty"` UpdatesVolume bool `json:"updates_volume,omitempty"` } `json:"market_center,omitempty"` }
UpdateRules is a list of aggregation rules.