data

package
v2.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package data provides the Webull Market Data API client.

A Client is constructed from the public client:

cl, err := client.New(
	client.WithAppKey(key),
	client.WithAppSecret(secret),
	client.WithSandbox(),
)
if err != nil {
	return err
}
market := data.New(cl)

The individual endpoints are grouped by area: instruments in instrument.go, fundamentals in fundamentals.go, futures static data in futures.go, and snapshot, tick, quotes, bars, footprint, NOII, screener, watchlist, options, and news in their own files.

Numeric values are returned as strings to preserve precision, and timestamps are strings in the format documented by the Webull API.

Index

Constants

This section is empty.

Variables

View Source
var ErrQuoteTimeFormat = errors.New("quote_time is not a Unix millisecond timestamp as a " +
	"number or a quoted decimal")

ErrQuoteTimeFormat is returned when a quote_time value is neither a number nor a quoted decimal, which is not a shape Webull publishes. It is a sentinel so a caller can recognise a malformed timestamp without matching on message text.

Functions

This section is empty.

Types

type AnalystRating

type AnalystRating struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// Category is the instrument's market.
	Category StockCategory `json:"category"`
	// Number is the total number of analysts, as a string.
	Number string `json:"number"`
	// UnderPerform is the number of under-perform ratings, as a string.
	UnderPerform string `json:"under_perform"`
	// Buy is the number of buy ratings, as a string.
	Buy string `json:"buy"`
	// Sell is the number of sell ratings, as a string.
	Sell string `json:"sell"`
	// StrongBuy is the number of strong-buy ratings, as a string.
	StrongBuy string `json:"strong_buy"`
	// Hold is the number of hold (neutral) ratings, as a string.
	Hold string `json:"hold"`
	// EffectiveStartDate is when the figures became effective.
	EffectiveStartDate string `json:"effective_start_date"`
}

AnalystRating holds analyst rating counts for a security.

type AnalystTargetPrice

type AnalystTargetPrice struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// Category is the instrument's market.
	Category StockCategory `json:"category"`
	// Mean is the average target price, as a decimal string.
	Mean money.Money `json:"mean"`
	// Low is the lowest target price, as a decimal string.
	Low money.Money `json:"low"`
	// High is the highest target price, as a decimal string.
	High money.Money `json:"high"`
	// Median is the median target price, as a decimal string.
	Median money.Money `json:"median"`
	// Currency is the target-price currency, for example "USD".
	Currency string `json:"currency"`
	// EffectiveStartDate is when the figures became effective.
	EffectiveStartDate string `json:"effective_start_date"`
}

AnalystTargetPrice holds analyst target-price statistics for a security.

type Bar

type Bar struct {
	// Time is the bar time, as returned by the server. The batch endpoint
	// documents an ISO-8601 string.
	Time string `json:"time"`
	// Open is the open price.
	Open money.Money `json:"open"`
	// Close is the close price.
	Close money.Money `json:"close"`
	// High is the high price.
	High money.Money `json:"high"`
	// Low is the low price.
	Low money.Money `json:"low"`
	// Volume is the volume, as a decimal string.
	Volume string `json:"volume"`
	// TradingSession is the session the bar belongs to, when supplied.
	TradingSession TradingSession `json:"trading_sessions,omitempty"`
}

Bar is a single OHLCV candlestick. Trading sessions use the shared TradingSession type.

type BarQuery

type BarQuery struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string
	// Category is the market to query. Required.
	Category StockCategory
	// Interval is the bar granularity. Required.
	Interval BarTimespan
	// Count is the number of bars to return. Zero means the server default
	// (200); the documented maximum is 1200 (1650 for M1).
	Count int
	// RealTimeRequired requests the latest market data when true. When nil the
	// server default (true) applies.
	RealTimeRequired *bool
	// TradingSessions restricts the result to the given trading sessions.
	TradingSessions []TradingSession
}

BarQuery parameterizes Client.GetBars. Symbol, Category and Interval are required.

type BarTimespan

type BarTimespan string

BarTimespan is the time granularity of a bar. It is the "timespan" body field of the batch bars endpoint.

const (
	// BarTimespanS5 is a 5-second bar.
	BarTimespanS5 BarTimespan = "S5"
	// BarTimespanS15 is a 15-second bar.
	BarTimespanS15 BarTimespan = "S15"
	// BarTimespanM1 is a 1-minute bar.
	BarTimespanM1 BarTimespan = "M1"
	// BarTimespanM5 is a 5-minute bar.
	BarTimespanM5 BarTimespan = "M5"
	// BarTimespanM15 is a 15-minute bar.
	BarTimespanM15 BarTimespan = "M15"
	// BarTimespanM30 is a 30-minute bar.
	BarTimespanM30 BarTimespan = "M30"
	// BarTimespanM60 is a 60-minute bar.
	BarTimespanM60 BarTimespan = "M60"
	// BarTimespanM120 is a 120-minute bar.
	BarTimespanM120 BarTimespan = "M120"
	// BarTimespanM240 is a 240-minute bar.
	BarTimespanM240 BarTimespan = "M240"
	// BarTimespanDay is a daily bar.
	BarTimespanDay BarTimespan = "D"
	// BarTimespanWeek is a weekly bar.
	BarTimespanWeek BarTimespan = "W"
	// BarTimespanMonth is a monthly bar.
	BarTimespanMonth BarTimespan = "M"
	// BarTimespanYear is a yearly bar.
	BarTimespanYear BarTimespan = "Y"
)

Bar time granularities accepted by the bars endpoints.

type BatchBarQuery

type BatchBarQuery struct {
	// Symbols is the list of security symbols to query, at most 100.
	Symbols []string
	// Category is the market to query. Required.
	Category StockCategory
	// Timespan is the bar granularity. Required. The batch endpoint documents
	// this parameter as "timespan".
	Timespan BarTimespan
	// Count is the number of bars to return per symbol. Zero means the server
	// default (200); the documented maximum is 1200 (1650 for M1).
	Count int
	// RealTimeRequired requests the latest market data when true. When nil the
	// server default (true) applies.
	RealTimeRequired *bool
	// TradingSessions restricts the result to the given trading sessions.
	TradingSessions []TradingSession
	// StartTime restricts the result to bars at or after this Unix timestamp in
	// milliseconds. Zero means unbounded.
	StartTime int64
	// EndTime restricts the result to bars at or before this Unix timestamp in
	// milliseconds. Zero means unbounded.
	EndTime int64
}

BatchBarQuery parameterizes Client.GetBatchBars. Symbols, Category and Timespan are required.

type BatchBarSymbol

type BatchBarSymbol struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// Result is the list of bars for Symbol.
	Result []Bar `json:"result"`
}

BatchBarSymbol groups the bars returned for one symbol.

type BatchBars

type BatchBars struct {
	// Result groups the bars by symbol.
	Result []BatchBarSymbol `json:"result"`

	// The two fields below are required by the Display Solution batch bars page and
	// were absent here, for the reason given on [StockBars.Times]. The batch page
	// documents the same two hours arrays with the same two distinct element schemas.
	//
	// Display Solution requires a paid subscription, so no field here is
	// live-verified.
	Times        []ExchangeTimes        `json:"times"`
	SpecialTimes []SpecialExchangeTimes `json:"special_times"`
}

BatchBars is the batch historical-bars response.

type BoolOrSuccess

type BoolOrSuccess struct {
	Success bool
}

func (*BoolOrSuccess) UnmarshalJSON

func (b *BoolOrSuccess) UnmarshalJSON(data []byte) error

type CapitalFlowEntry

type CapitalFlowEntry struct {
	Date      string      `json:"date"`
	LargeIn   money.Money `json:"large_in"`
	LargeOut  money.Money `json:"large_out"`
	MediumIn  money.Money `json:"medium_in"`
	MediumOut money.Money `json:"medium_out"`
	SmallIn   money.Money `json:"small_in"`
	SmallOut  money.Money `json:"small_out"`
}

CapitalFlowEntry describes one trading day's capital flow breakdown.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client exposes the Webull Market Data HTTP API. It is a thin, typed layer on top of client.Client: every request goes through the public client so that signing, transport, and error handling are shared with the rest of the SDK.

A Client is safe for concurrent use and does not own the underlying client.Client; callers close that client themselves.

func New

func New(c *client.Client) *Client

New returns a market-data client bound to c. The underlying client is owned by the caller and is not closed by Client.Close.

func (*Client) AddWatchlistInstruments

func (c *Client) AddWatchlistInstruments(ctx context.Context, params WatchlistInstrumentsParam) (*SuccessResponse, error)

AddWatchlistInstruments adds instruments to a watchlist.

Reference: https://developer.webull.hk/apis/docs/reference/add-watchlist-instruments.md

func (*Client) Close

func (c *Client) Close() error

Close releases resources held by the client. The underlying client.Client is owned by the caller and is not closed here.

func (*Client) Core

func (c *Client) Core() *client.Client

Core returns the underlying public client.

func (*Client) CreateWatchlist

func (c *Client) CreateWatchlist(ctx context.Context, params CreateWatchlistParams) (*CreateWatchlistResult, error)

CreateWatchlist creates a new watchlist and returns its identifier.

Reference: https://developer.webull.hk/apis/docs/reference/create-watchlist.md

func (*Client) DSSubscribe

func (c *Client) DSSubscribe(ctx context.Context, req DSSubscribeRequest) error

DSSubscribe subscribes to real-time streaming data for the given symbols via the Display Solution endpoint.

func (*Client) DSUnsubscribe

func (c *Client) DSUnsubscribe(ctx context.Context, req DSUnsubscribeRequest) error

DSUnsubscribe unsubscribes from real-time streaming data for the given symbols via the Display Solution endpoint.

func (*Client) DeleteWatchlist

func (c *Client) DeleteWatchlist(ctx context.Context, watchlistID string) (*SuccessResponse, error)

DeleteWatchlist deletes the watchlist identified by watchlistID.

Reference: https://developer.webull.hk/apis/docs/reference/delete-watchlist.md

func (*Client) DisplayService

func (c *Client) DisplayService() *display.Service

DisplayService returns the display.Service for Display Solution API calls. It is created lazily on first use using the same app credentials as the underlying client.Client. Tests may replace it with Client.SetDisplaySvcForTesting.

func (*Client) GetAnalystRating

func (c *Client) GetAnalystRating(ctx context.Context, symbol string, category StockCategory) (*AnalystRating, error)

GetAnalystRating retrieves aggregate analyst rating counts for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/get-analyst-rating.md

func (*Client) GetAnalystTargetPrice

func (c *Client) GetAnalystTargetPrice(ctx context.Context, symbol string, category StockCategory) (*AnalystTargetPrice, error)

GetAnalystTargetPrice retrieves aggregate analyst target-price data for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/get-analyst-target-price.md

func (*Client) GetBalanceSheet

func (c *Client) GetBalanceSheet(ctx context.Context, symbol string, category StockCategory) ([]FinancialsItem, error)

GetBalanceSheet retrieves the balance sheet for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/balance-sheet.md

func (*Client) GetBars

func (c *Client) GetBars(ctx context.Context, q BarQuery) (*StockBars, error)

GetBars retrieves historical bars for a single symbol.

The historical single-symbol endpoint GET /market-data/stocks/bars/get is retired: both the official Webull Python SDK (MarketData.get_history_bar) and the live sandbox report it as no longer available. GetBars therefore issues a one-symbol batch request against POST /market-data/stocks/bars/list and unwraps the single result.

Reference: https://developer.webull.hk/apis/docs/reference/historical-bars.md

func (*Client) GetBatchBars

func (c *Client) GetBatchBars(ctx context.Context, q BatchBarQuery) (*BatchBars, error)

GetBatchBars retrieves historical bars for multiple symbols in one request.

Reference: https://developer.webull.hk/apis/docs/reference/historical-bars.md

func (*Client) GetCapitalFlow

func (c *Client) GetCapitalFlow(ctx context.Context, symbol string, category StockCategory, count int) ([]CapitalFlowEntry, error)

GetCapitalFlow retrieves the capital flow breakdown for symbol over the most recent count trading days (default 5, maximum 5). Results are sorted in ascending chronological order.

Reference: https://developer.webull.hk/apis/docs/reference/capital-flow.md

func (*Client) GetCashFlow

func (c *Client) GetCashFlow(ctx context.Context, symbol string, category StockCategory) ([]FinancialsItem, error)

GetCashFlow retrieves the cash flow statement for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/cash-flow-statement.md

func (*Client) GetCompanyProfile

func (c *Client) GetCompanyProfile(ctx context.Context, symbol string, category StockCategory) (*CompanyProfile, error)

GetCompanyProfile retrieves the profile of the company behind symbol. The Webull documentation currently supports US stocks only, so category should normally be StockCategoryUS.

Reference: https://developer.webull.hk/apis/docs/reference/get-company-profile.md

func (*Client) GetCorporateActions

func (c *Client) GetCorporateActions(ctx context.Context, q CorporateActionQuery) ([]CorporateAction, string, error)

GetCorporateActions retrieves corporate action events for one or more symbols using the Display Solution API.

category is required and must be one of: "US_STOCK", "HK_STOCK", "CN_STOCK".

Reference: https://developer.webull.hk/apis/docs/reference/market-display-solution-data-api/corp-action-using-get

func (*Client) GetCorporateActionsByMarket

func (c *Client) GetCorporateActionsByMarket(ctx context.Context, q CorporateActionQuery) ([]CorporateAction, string, error)

GetCorporateActionsByMarket retrieves corporate action events for all securities in a market using the Display Solution API.

Currently only "US" market is supported.

Reference: https://developer.webull.hk/apis/docs/reference/market-display-solution-data-api/corp-market-using-get

func (*Client) GetCryptoBars

func (c *Client) GetCryptoBars(ctx context.Context, q CryptoBarsQuery) ([]CryptoSymbolBars, error)

GetCryptoBars retrieves historical bars for one or more crypto symbols.

func (*Client) GetCryptoInstruments

func (c *Client) GetCryptoInstruments(ctx context.Context, q CryptoInstrumentQuery) (*CryptoInstrumentsResult, error)

GetCryptoInstruments retrieves crypto instrument profiles.

func (*Client) GetCryptoSnapshot

func (c *Client) GetCryptoSnapshot(ctx context.Context, q CryptoSnapshotQuery) ([]CryptoSnapshot, error)

GetCryptoSnapshot retrieves real-time snapshots for one or more crypto symbols.

func (*Client) GetDSAnalystRating

func (c *Client) GetDSAnalystRating(ctx context.Context, symbol string) (*AnalystRating, error)

GetDSAnalystRating retrieves aggregate analyst rating counts for symbol via the Display Solution endpoint.

func (*Client) GetDSAnalystTargetPrice

func (c *Client) GetDSAnalystTargetPrice(ctx context.Context, symbol string) (*AnalystTargetPrice, error)

GetDSAnalystTargetPrice retrieves aggregate analyst target-price data for symbol via the Display Solution endpoint.

func (*Client) GetDSCompanyProfile

func (c *Client) GetDSCompanyProfile(ctx context.Context, symbol string) (*CompanyProfile, error)

GetDSCompanyProfile retrieves the company profile for symbol via the Display Solution endpoint.

func (*Client) GetDSLatestNews

func (c *Client) GetDSLatestNews(ctx context.Context) ([]DSNewsSummaryItem, error)

GetDSLatestNews retrieves the latest news headlines via the Display Solution endpoint.

func (*Client) GetDSMarketNews

func (c *Client) GetDSMarketNews(ctx context.Context, category string) ([]DSNewsSummaryItem, error)

GetDSMarketNews retrieves market-wide news for the given category via the Display Solution endpoint.

func (*Client) GetDSNewsSummary

func (c *Client) GetDSNewsSummary(ctx context.Context, symbols []string) ([]DSNewsSummaryItem, error)

GetDSNewsSummary retrieves news summaries for the given symbols via the Display Solution endpoint.

func (*Client) GetDSSymbolNews

func (c *Client) GetDSSymbolNews(ctx context.Context, symbol string) ([]DSNewsSummaryItem, error)

GetDSSymbolNews retrieves news for a specific symbol via the Display Solution endpoint.

func (*Client) GetDisplayBars

func (c *Client) GetDisplayBars(ctx context.Context, q BatchBarQuery) (*BatchBars, error)

GetDisplayBars retrieves historical bars for multiple symbols via Display Solution. The request is sent as a POST with a JSON body.

func (*Client) GetDisplayBarsSingle

func (c *Client) GetDisplayBarsSingle(ctx context.Context, q BarQuery) (*StockBars, error)

GetDisplayBarsSingle retrieves historical bars for a single symbol via Display Solution. This is a GET request against the single-symbol bars path.

func (*Client) GetDisplayDepth

func (c *Client) GetDisplayDepth(ctx context.Context, q DepthQuery) (*Quote, error)

GetDisplayDepth retrieves the latest bid/ask order-book depth via Display Solution.

func (*Client) GetDisplayGainersLosers

func (c *Client) GetDisplayGainersLosers(ctx context.Context, q GainersLosersQuery) (*types.Page[ScreenerStock], error)

GetDisplayGainersLosers retrieves gainers/losers via Display Solution.

func (*Client) GetDisplaySnapshot

func (c *Client) GetDisplaySnapshot(ctx context.Context, q SnapshotQuery) ([]Snapshot, error)

GetDisplaySnapshot retrieves real-time market snapshots via Display Solution. Its verb and request shape are unverified too: the documented contract is a POST carrying a required category_symbols array in a JSON body, not the flat single-category query parameters sent here, so a fix is a breaking change to SnapshotQuery, which GetSnapshot also takes. The host answers 403 without a paid entitlement, and the reference page snapshot-using-get contradicts itself (operationId snapshotUsingGET, method post), so only a probe settles it.

func (*Client) GetDisplayTick

func (c *Client) GetDisplayTick(ctx context.Context, q TickQuery) (*StockTicks, error)

GetDisplayTick retrieves tick-by-tick trade data via Display Solution.

func (*Client) GetDisplayTopActive

func (c *Client) GetDisplayTopActive(ctx context.Context, q MostActiveQuery) (*types.Page[ScreenerStock], error)

GetDisplayTopActive retrieves top active stocks via Display Solution.

func (*Client) GetDividendCalendar

func (c *Client) GetDividendCalendar(ctx context.Context, symbol string, category StockCategory) ([]DividendCalendarEntry, error)

GetDividendCalendar retrieves the dividend calendar for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/dividend-calendar.md

func (*Client) GetEarningsCalendar

func (c *Client) GetEarningsCalendar(ctx context.Context, symbol string, category StockCategory) ([]EarningsCalendarEntry, error)

GetEarningsCalendar retrieves the earnings calendar for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/earnings-calendar.md

func (*Client) GetEventBars

func (c *Client) GetEventBars(ctx context.Context, q EventBarsQuery) ([]EventBarsResult, error)

GetEventBars retrieves historical bars for one or more event contract symbols.

**Breaking, in v2.1.32.** It now returns []EventBarsResult, one entry per instrument, because that is the shape the page documents. It previously returned []EventBar - the elements of the inner result array - which flattened several instruments' bars into one list and dropped the grouping key. A caller reading out.Result[i] instead of out[i] adapts in one line; a caller that used out[i] as a bar must read out[i].Result.

func (*Client) GetEventContractCategories

func (c *Client) GetEventContractCategories(ctx context.Context) ([]EventContractCategory, error)

GetEventContractCategories retrieves the list of event contract categories.

Reference: https://developer.webull.com/apis/docs/reference/event-categories-list.md

func (*Client) GetEventContractEvents

func (c *Client) GetEventContractEvents(ctx context.Context, q EventContractEventsQuery) ([]EventContractEvent, error)

GetEventContractEvents retrieves events within a series, optionally filtered by symbols and status.

Reference: https://developer.webull.com/apis/docs/reference/event-categories-list.md

func (*Client) GetEventContractEventsList

func (c *Client) GetEventContractEventsList(ctx context.Context, q EventListQuery) (*EventListPage, error)

GetEventContractEventsList lists event-contract events.

func (*Client) GetEventContractMarkets

func (c *Client) GetEventContractMarkets(ctx context.Context, q EventContractMarketsQuery) (*types.Page[EventContractMarket], error)

GetEventContractMarkets retrieves tradable event contract markets, optionally filtered by series, event, symbols, and expiration date.

**Breaking, in v2.1.35.** The page documents the 200 body as `{"data": [...], "pagination_key": "..."}`, which a bare slice cannot decode, so this method failed outright against a conforming server. It returns a types.Page now: a caller reads out.Data instead of out, and passes out.PaginationKey back to fetch the following page. The new form succeeds where the old one could not.

Reference: https://developer.webull.com/apis/docs/reference/event-categories-list.md

func (*Client) GetEventContractMilestones

func (c *Client) GetEventContractMilestones(ctx context.Context, q MilestoneQuery) (*MilestonePage, error)

GetEventContractMilestones lists event-contract milestones.

func (*Client) GetEventContractSeries

func (c *Client) GetEventContractSeries(ctx context.Context, q EventContractSeriesQuery) (*types.Page[EventContractSeries], error)

GetEventContractSeries retrieves event contract series, optionally filtered by category and symbols.

**Breaking, in v2.1.35.** The page documents the 200 body as `{"data": [...], "pagination_key": "..."}`, which a bare slice cannot decode, so this method failed outright against a conforming server. It returns a types.Page now: a caller reads out.Data instead of out, and passes out.PaginationKey back to fetch the following page. The new form succeeds where the old one could not.

Reference: https://developer.webull.com/apis/docs/reference/event-categories-list.md

func (*Client) GetEventContractSeriesList

func (c *Client) GetEventContractSeriesList(ctx context.Context, q EventSeriesListQuery) (*EventSeriesListPage, error)

GetEventContractSeriesList lists event-contract series.

func (*Client) GetEventContractSportsFilters

func (c *Client) GetEventContractSportsFilters(ctx context.Context, tag string) ([]EventSportsFilter, error)

GetEventContractSportsFilters lists the sports filters.

func (*Client) GetEventContractTags

func (c *Client) GetEventContractTags(ctx context.Context) ([]EventContractTag, error)

GetEventContractTags lists the tags per event-contract category.

func (*Client) GetEventDepth

func (c *Client) GetEventDepth(ctx context.Context, q EventDepthQuery) ([]EventDepth, error)

GetEventDepth retrieves the bid/ask order-book depth for a single event contract symbol.

**Breaking, in v2.1.32.** It now returns []EventDepth, because the page documents the 200 body as an array of one entry per instrument rather than a single object. That inverts which shape fails to decode: previously a conforming response could not be read, and now a single-object response cannot be. Neither shape has been verified against a live host.

func (*Client) GetEventGameStats

func (c *Client) GetEventGameStats(ctx context.Context, milestoneID, category string) (*EventGameStats, error)

GetEventGameStats retrieves game statistics for a milestone.

func (*Client) GetEventLiveData

func (c *Client) GetEventLiveData(ctx context.Context, milestoneID, category string) (*EventLiveData, error)

GetEventLiveData retrieves live data for a milestone.

func (*Client) GetEventMarketBars

func (c *Client) GetEventMarketBars(ctx context.Context, q EventMarketBarsQuery) ([]EventMarketBar, error)

GetEventMarketBars retrieves bars for event-contract market symbols.

func (*Client) GetEventMarketBarsByEvent

func (c *Client) GetEventMarketBarsByEvent(ctx context.Context, q EventMarketBarsByEventQuery) ([]EventMarketBar, error)

GetEventMarketBarsByEvent retrieves bars for an event symbol.

func (*Client) GetEventMarketDepth

func (c *Client) GetEventMarketDepth(ctx context.Context, symbol, category string, depth int) (*EventMarketDepth, error)

GetEventMarketDepth retrieves the depth of an event-contract market.

func (*Client) GetEventMarketSnapshot

func (c *Client) GetEventMarketSnapshot(ctx context.Context, symbol, category string) (*EventMarketSnapshot, error)

GetEventMarketSnapshot retrieves the snapshot of an event-contract market.

func (*Client) GetEventSnapshot

func (c *Client) GetEventSnapshot(ctx context.Context, q EventSnapshotQuery) ([]EventSnapshot, error)

GetEventSnapshot retrieves real-time market snapshots for one or more event contract symbols.

func (*Client) GetEventTick

func (c *Client) GetEventTick(ctx context.Context, q EventTickQuery) ([]EventTickResult, error)

GetEventTick retrieves tick-by-tick trade data for a single event contract symbol.

**Breaking, in v2.1.32.** It now returns []EventTickResult, one entry per instrument, because that is the shape the page documents. It previously returned []EventTick - the elements of the inner result array. A caller reading out.Result[i] instead of out[i] adapts in one line.

func (*Client) GetFilings

func (c *Client) GetFilings(ctx context.Context, symbol string, category StockCategory) (*FilingsResponse, error)

GetFilings retrieves SEC filings for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/filings.md

func (*Client) GetFinancialAlert

func (c *Client) GetFinancialAlert(ctx context.Context, symbol string, category StockCategory) (*FinancialAlert, error)

GetFinancialAlert retrieves upcoming earnings-release alert for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/financial-alert.md

func (*Client) GetFinancialIndicators

func (c *Client) GetFinancialIndicators(ctx context.Context, symbol string, category StockCategory) (*FinancialIndicator, error)

GetFinancialIndicators retrieves financial indicators for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/financial-indicators.md

func (*Client) GetFootprint

func (c *Client) GetFootprint(ctx context.Context, q FootprintQuery) ([]StockFootprint, error)

GetFootprint retrieves footprint (order-flow) bars for one or more US stocks. Symbols, Category and Timespan are required.

Reference: https://developer.webull.hk/apis/docs/reference/footprint.md

func (*Client) GetForecastEPS

func (c *Client) GetForecastEPS(ctx context.Context, symbol string, category StockCategory) ([]ForecastEPSEntry, error)

GetForecastEPS retrieves forecast EPS data for symbol for the most recent 5 quarters.

Reference: https://developer.webull.hk/apis/docs/reference/forecast-eps.md

func (*Client) GetFundAllocation

func (c *Client) GetFundAllocation(ctx context.Context, symbol string, category StockCategory) ([]FundAllocation, error)

GetFundAllocation retrieves the asset allocation history of a fund.

func (*Client) GetFundDividends

func (c *Client) GetFundDividends(ctx context.Context, q FundDividendsQuery) (*types.Page[FundDividend], error)

GetFundDividends retrieves dividend history for a fund or ETF.

func (*Client) GetFundFiles

func (c *Client) GetFundFiles(ctx context.Context, symbol string, category StockCategory) ([]FundFile, error)

GetFundFiles retrieves the documents of a fund.

func (*Client) GetFundHoldings

func (c *Client) GetFundHoldings(ctx context.Context, symbol string, category StockCategory) ([]FundHolding, error)

GetFundHoldings retrieves the top holdings of a fund.

func (*Client) GetFundInfo

func (c *Client) GetFundInfo(ctx context.Context, q FundInfoQuery) (*FundInfo, error)

GetFundInfo retrieves basic information for a fund or ETF.

func (*Client) GetFundList

func (c *Client) GetFundList(ctx context.Context, q FundListQuery) ([]FundListItem, error)

GetFundList retrieves a list of funds or ETFs by market and category.

func (*Client) GetFundNav

func (c *Client) GetFundNav(ctx context.Context, q FundNavQuery) ([]FundNav, error)

GetFundNav retrieves NAV history for a fund or ETF.

func (*Client) GetFundPerformance

func (c *Client) GetFundPerformance(ctx context.Context, symbol string, category StockCategory) (*FundPerformance, error)

GetFundPerformance retrieves the performance returns of a fund.

func (*Client) GetFundRating

func (c *Client) GetFundRating(ctx context.Context, symbol string, category StockCategory) ([]FundRating, error)

GetFundRating retrieves the rating history of a fund.

func (*Client) GetFundSplits

func (c *Client) GetFundSplits(ctx context.Context, symbol string, category StockCategory) ([]FundSplit, error)

GetFundSplits retrieves the split history of a fund.

func (*Client) GetFuturesBars

func (c *Client) GetFuturesBars(ctx context.Context, q FuturesBarsQuery) (*BatchBars, error)

GetFuturesBars retrieves historical bars for one or more futures contracts.

func (*Client) GetFuturesDepth

func (c *Client) GetFuturesDepth(ctx context.Context, q FuturesDepthQuery) (*Quote, error)

GetFuturesDepth retrieves the latest bid/ask order-book depth for a single futures contract.

func (*Client) GetFuturesFootprint

func (c *Client) GetFuturesFootprint(ctx context.Context, q FuturesFootprintQuery) ([]StockFootprint, error)

GetFuturesFootprint retrieves footprint (order-flow) bars for one or more futures contracts.

func (*Client) GetFuturesInstruments

func (c *Client) GetFuturesInstruments(ctx context.Context, q FuturesInstrumentQuery) ([]FuturesInstrument, error)

GetFuturesInstruments retrieves static detail for one or more futures contracts. Category is required, and at least one of Symbols or Code must be provided.

Reference: https://developer.webull.hk/apis/docs/reference/futures-instrument-list.md

func (*Client) GetFuturesProductClasses

func (c *Client) GetFuturesProductClasses(ctx context.Context, category FuturesCategory) ([]FuturesProductClass, error)

GetFuturesProductClasses retrieves the futures product classification groups for category.

Reference: https://developer.webull.hk/apis/docs/reference/futures-products-class.md

func (*Client) GetFuturesProductCodes

func (c *Client) GetFuturesProductCodes(ctx context.Context, q FuturesProductCodeQuery) ([]FuturesProduct, error)

GetFuturesProductCodes retrieves the futures products and their product codes for q.Category.

Reference: https://developer.webull.hk/apis/docs/reference/futures-products.md

func (*Client) GetFuturesSnapshot

func (c *Client) GetFuturesSnapshot(ctx context.Context, q FuturesSnapshotQuery) ([]Snapshot, error)

GetFuturesSnapshot retrieves real-time market snapshots for one or more futures contracts.

func (*Client) GetFuturesTick

func (c *Client) GetFuturesTick(ctx context.Context, q FuturesTickQuery) (*StockTicks, error)

GetFuturesTick retrieves tick-by-tick trade data for a single futures contract.

func (*Client) GetHighDividendRank

func (c *Client) GetHighDividendRank(ctx context.Context, q HighDividendQuery) ([]ScreenerStock, error)

GetHighDividendRank retrieves US stocks ranked by dividend yield.

Reference: https://developer.webull.hk/apis/docs/reference/get-high-dividend-ranks.md

func (*Client) GetIncomeStatement

func (c *Client) GetIncomeStatement(ctx context.Context, symbol string, category StockCategory) ([]FinancialsItem, error)

GetIncomeStatement retrieves the income statement for symbol.

Reference: https://developer.webull.hk/apis/docs/reference/income-statement.md

func (*Client) GetIndustryComparison

func (c *Client) GetIndustryComparison(ctx context.Context, symbol string, category StockCategory, sortBy string) (*IndustryComparison, error)

GetIndustryComparison retrieves peer comparison data for the industry that symbol belongs to. sortBy defaults to EPS_TTM.

Reference: https://developer.webull.hk/apis/docs/reference/industry-comparison.md

func (*Client) GetLogos

func (c *Client) GetLogos(ctx context.Context, q LogoQuery) ([]Logo, error)

GetLogos retrieves logo image URLs for the specified securities.

Reference: https://developer.webull.hk/apis/docs/reference/market-display-solution-data-api/batch-logo-using-post

func (*Client) GetMarketSectorDetail

func (c *Client) GetMarketSectorDetail(ctx context.Context, q MarketSectorDetailQuery) (*types.Page[ScreenerStock], error)

GetMarketSectorDetail retrieves the constituent stocks of a single market sector, with optional sorting.

**Breaking, in v2.1.35.** The page documents the 200 body as `{"data": [...], "pagination_key": "..."}`, which a bare slice cannot decode, so this method failed outright against a conforming server. It returns a types.Page now: a caller reads out.Data instead of out, and passes out.PaginationKey back to fetch the following page. The new form succeeds where the old one could not.

Reference: https://developer.webull.hk/apis/docs/reference/get-market-sector-detail.md

func (*Client) GetMarketSectors

func (c *Client) GetMarketSectors(ctx context.Context, paginationKey string) (*types.Page[MarketSector], error)

GetMarketSectors retrieves the list of market sectors with their aggregate statistics and constituent stocks.

Pass an empty paginationKey for the first page, then the types.Page.PaginationKey of the page just read. The cursor is opaque and server-issued, so it is passed back unmodified and cannot be constructed.

**Breaking, in v2.1.35.** The page documents the 200 body as `{"data": [...], "pagination_key": "..."}`, which a bare slice cannot decode, so this method failed outright against a conforming server. It returns a types.Page now: a caller reads out.Data instead of out, and passes out.PaginationKey back to fetch the following page. The new form succeeds where the old one could not.

Reference: https://developer.webull.hk/apis/docs/reference/get-market-sectors.md

func (*Client) GetMostActive

func (c *Client) GetMostActive(ctx context.Context, q MostActiveQuery) ([]ScreenerStock, error)

GetMostActive retrieves the most actively traded US stocks, ranked by the metric selected with MostActiveQuery.RankType.

The Webull reference URL get-most-active.md does not exist; the endpoint is documented as "List Top Actives" (operationId getTopActive).

Reference: https://developer.webull.hk/apis/docs/reference/get-top-active.md

func (*Client) GetNOIIBars

func (c *Client) GetNOIIBars(ctx context.Context, q NOIIQuery) ([]NOIIBar, error)

GetNOIIBars retrieves Net Order Imbalance Indicator (NOII) bars for the opening or closing auction of a US stock. Only a single symbol is supported.

Reference: https://developer.webull.hk/apis/docs/reference/get-noii-bars.md

func (*Client) GetNOIISnapshot

func (c *Client) GetNOIISnapshot(ctx context.Context, q NOIIQuery) (*NOIISnapshot, error)

GetNOIISnapshot retrieves the latest Net Order Imbalance Indicator (NOII) snapshot for the opening or closing auction of a US stock. Only a single symbol is supported.

Reference: https://developer.webull.hk/apis/docs/reference/get-noii-snapshot.md

func (*Client) GetNewsSummary

func (c *Client) GetNewsSummary(ctx context.Context, params NewsSummaryParam) (*NewsSummaryStream, error)

GetNewsSummary opens a news-summary stream for the requested symbols. The caller must close the returned stream. A non-2xx response is returned as a typed error instead of a stream.

Reference: https://developer.webull.hk/apis/docs/reference/news-summary.md

func (*Client) GetOptionBars

func (c *Client) GetOptionBars(ctx context.Context, q OptionBarsQuery) ([]OptionSymbolBars, error)

GetOptionBars retrieves historical bars for one or more option contracts.

Reference: https://developer.webull.hk/apis/docs/reference/option-historical-bars.md

func (*Client) GetOptionContracts

func (c *Client) GetOptionContracts(ctx context.Context, q OptionContractsQuery) (*OptionContractsResult, error)

GetOptionContracts lists the option contracts available for an underlying symbol, optionally narrowed by expiration, option type, and strike range.

Reference: https://developer.webull.hk/apis/docs/reference/instrument returns 404.

func (*Client) GetOptionSnapshot

func (c *Client) GetOptionSnapshot(ctx context.Context, q OptionSnapshotQuery) ([]OptionSnapshot, error)

GetOptionSnapshot retrieves real-time snapshots for up to 20 option contracts.

Reference: https://developer.webull.hk/apis/docs/reference/option-snapshot.md

func (*Client) GetOptionTick

func (c *Client) GetOptionTick(ctx context.Context, q OptionTickQuery) (*OptionTickResult, error)

GetOptionTick retrieves tick-by-tick trade data for one option contract.

Reference: https://developer.webull.hk/apis/docs/reference/option-tick.md

func (*Client) GetQuotes

func (c *Client) GetQuotes(ctx context.Context, q DepthQuery) (*Quote, error)

GetQuotes retrieves the latest bid/ask order-book depth for a single symbol.

Reference: https://developer.webull.hk/apis/docs/reference/quotes.md

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(ctx context.Context, q SnapshotQuery) ([]Snapshot, error)

GetSnapshot retrieves real-time market snapshots for one or more symbols.

Reference: https://developer.webull.hk/apis/docs/reference/snapshot.md

func (*Client) GetStockInstruments

func (c *Client) GetStockInstruments(ctx context.Context, q StockInstrumentQuery) ([]StockInstrument, error)

GetStockInstruments retrieves profile information for one or more stock instruments. When q.Symbols is empty it returns the instruments of q.Category page by page; when set, it returns the requested symbols directly.

Reference: https://developer.webull.hk/apis/docs/reference/instrument-list.md

func (*Client) GetStockProfilesV3

func (c *Client) GetStockProfilesV3(ctx context.Context, q StockProfilesV3Query) (*StockProfilesV3Result, error)

GetStockProfilesV3 retrieves profile information for one or more stock instruments using the Display Solution (v3) endpoint. Unlike the v2 endpoint (Client.GetStockInstruments), this uses POST and returns a paginated {data, pagination_key} envelope.

Reference: https://developer.webull.hk/apis/docs/reference/market-display-solution-data-api/list-using-get

func (*Client) GetTick

func (c *Client) GetTick(ctx context.Context, q TickQuery) (*StockTicks, error)

GetTick retrieves tick-by-tick trade data for a single symbol.

Reference: https://developer.webull.hk/apis/docs/reference/tick.md

func (*Client) GetTopGainersLosers

func (c *Client) GetTopGainersLosers(ctx context.Context, q GainersLosersQuery) ([]ScreenerStock, error)

GetTopGainersLosers retrieves the top gaining or losing US stocks for a ranking window. Pass SortDirectionAsc to rank losers.

Reference: https://developer.webull.hk/apis/docs/reference/get-gainers-losers.md

func (*Client) GetWatchlistInstruments

func (c *Client) GetWatchlistInstruments(ctx context.Context, watchlistID string) (*WatchlistInstruments, error)

GetWatchlistInstruments retrieves the instruments held in watchlistID.

Reference: https://developer.webull.hk/apis/docs/reference/get-watchlist-instruments.md

func (*Client) GetWatchlists

func (c *Client) GetWatchlists(ctx context.Context) ([]Watchlist, error)

GetWatchlists retrieves the authenticated user's watchlists.

Reference: https://developer.webull.hk/apis/docs/reference/get-watchlist.md

func (*Client) GetWeek52HighLow

func (c *Client) GetWeek52HighLow(ctx context.Context, q Week52HighLowQuery) ([]ScreenerStock, error)

GetWeek52HighLow retrieves US stocks based on their 52-week high/low performance.

Reference: https://developer.webull.hk/apis/docs/reference/get-week52-high-low.md

func (*Client) RemoveWatchlistInstruments

func (c *Client) RemoveWatchlistInstruments(ctx context.Context, params WatchlistInstrumentsParam) (*SuccessResponse, error)

RemoveWatchlistInstruments removes instruments from a watchlist.

Reference: https://developer.webull.hk/apis/docs/reference/remove-watchlist-instruments.md

func (*Client) SetDisplaySvcForTesting

func (c *Client) SetDisplaySvcForTesting(svc *display.Service)

SetDisplaySvcForTesting is for unit tests only (package data only).

func (*Client) UpdateWatchlist

func (c *Client) UpdateWatchlist(ctx context.Context, params UpdateWatchlistParams) (*SuccessResponse, error)

UpdateWatchlist renames a watchlist and/or changes its sort order.

Reference: https://developer.webull.hk/apis/docs/reference/update-watchlist.md

func (*Client) UpdateWatchlistInstruments

func (c *Client) UpdateWatchlistInstruments(ctx context.Context, params WatchlistInstrumentsParam) (*SuccessResponse, error)

UpdateWatchlistInstruments changes the sort order of instruments in a watchlist.

Reference: https://developer.webull.hk/apis/docs/reference/update-watchlist-instruments.md

type CompanyProfile

type CompanyProfile struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// Category is the instrument's market.
	Category StockCategory `json:"category"`
	// CompanyName is the registered company name.
	CompanyName string `json:"company_name"`
	// EstablishDate is the date of incorporation (YYYY-MM-DD).
	EstablishDate string `json:"establish_date"`
	// ExhibitionCode is the market where the company is listed.
	ExhibitionCode string `json:"exhibition_code"`
	// Profile is the free-text business description.
	Profile string `json:"profile"`
	// Employees is the number of employees, as a string.
	Employees string `json:"employees"`
	// Address is the headquarters address.
	Address string `json:"address"`
	// CEO is the name of the chief executive officer.
	CEO string `json:"ceo"`
	// Industries lists the company's industries.
	Industries []string `json:"industries"`
}

CompanyProfile describes a company's static profile.

type CorporateAction

type CorporateAction struct {
	InstrumentID int64  `json:"instrument_id"`
	Symbol       string `json:"symbol"`
	ExchangeCode string `json:"exchange_code"`
	EventType    string `json:"event_type"`
	EventAction  string `json:"event_action"`
	EventID      int64  `json:"event_id"`
	Source       string `json:"source"`
	RatioOld     string `json:"ratio_old"`
	RatioNew     string `json:"ratio_new"`
	EventDate    string `json:"event_date"`
	UpdateTime   string `json:"update_time"`
	CreateTime   string `json:"create_time"`
}

CorporateAction represents a corporate action event such as a dividend or stock split.

Reference: https://developer.webull.hk/apis/docs/reference/market-display-solution-data-api/corp-action-using-get

type CorporateActionQuery

type CorporateActionQuery struct {
	Symbols       []string
	Market        string
	StartDate     string
	EndDate       string
	EventTypes    []string
	PageSize      int
	PaginationKey string
}

CorporateActionQuery parameterizes Client.GetCorporateActions.

type CreateWatchlistParams

type CreateWatchlistParams struct {
	// Name is the watchlist name. Required.
	Name string `json:"name"`
	// Sort is the display ordering number. Zero means unset.
	Sort int32 `json:"sort,omitempty"`
}

CreateWatchlistParams parameterizes Client.CreateWatchlist. Name is required; a zero Sort lets the server choose the next display order.

type CreateWatchlistResult

type CreateWatchlistResult struct {
	// WatchlistID is the identifier assigned to the new watchlist.
	WatchlistID string `json:"watchlist_id"`
}

CreateWatchlistResult is returned by Client.CreateWatchlist.

type CryptoBar

type CryptoBar struct {
	Time   string      `json:"time"`
	Open   money.Money `json:"open"`
	Close  money.Money `json:"close"`
	High   money.Money `json:"high"`
	Low    money.Money `json:"low"`
	Volume string      `json:"volume"`
}

CryptoBar is a single crypto price bar.

type CryptoBarsQuery

type CryptoBarsQuery struct {
	// Symbols is the list of crypto symbols to query. Required.
	Symbols []string
	// Category is the crypto market category. Required.
	Category string
	// Timespan is the bar granularity. Required.
	Timespan BarTimespan
	// Count is the number of bars to return. Zero means the server default.
	Count int
	// RealTimeRequired asks the server to include the latest in-progress bar.
	RealTimeRequired bool
}

CryptoBarsQuery parameterizes Client.GetCryptoBars.

type CryptoInstrument

type CryptoInstrument struct {
	Symbol       string `json:"symbol"`
	Name         string `json:"name"`
	Category     string `json:"category"`
	Currency     string `json:"currency"`
	Status       string `json:"status"`
	InstrumentID string `json:"instrument_id"`
}

CryptoInstrument is the profile of one crypto instrument.

type CryptoInstrumentQuery

type CryptoInstrumentQuery struct {
	// Category is the crypto market category. Required.
	Category string
	// Symbols optionally restricts the result to specific symbols.
	Symbols []string
	// Status optionally filters by instrument status.
	Status string
	// PaginationKey continues from a previous page. Empty means unset.
	PaginationKey string
}

CryptoInstrumentQuery parameterizes Client.GetCryptoInstruments.

type CryptoInstrumentsResult

type CryptoInstrumentsResult struct {
	Instruments   []CryptoInstrument
	PaginationKey string
}

CryptoInstrumentsResult is the result of Client.GetCryptoInstruments.

type CryptoSnapshot

type CryptoSnapshot struct {
	InstrumentID  string      `json:"instrument_id"`
	Symbol        string      `json:"symbol"`
	PreClose      money.Money `json:"pre_close"`
	LastTradeTime int64       `json:"last_trade_time"`
	Price         money.Money `json:"price"`
	Open          money.Money `json:"open"`
	High          money.Money `json:"high"`
	Low           money.Money `json:"low"`
	Change        money.Money `json:"change"`
	ChangeRatio   string      `json:"change_ratio"`
	QuoteTime     string      `json:"quote_time"`
	Bid           money.Money `json:"bid"`
	BidSize       string      `json:"bid_size"`
	Ask           money.Money `json:"ask"`
	AskSize       string      `json:"ask_size"`
}

CryptoSnapshot is the real-time market snapshot of one crypto symbol.

type CryptoSnapshotQuery

type CryptoSnapshotQuery struct {
	// Symbols is the list of crypto symbols to query. Required.
	Symbols []string
	// Category is the crypto market category. Required.
	Category string
}

CryptoSnapshotQuery parameterizes Client.GetCryptoSnapshot.

type CryptoSymbolBars

type CryptoSymbolBars struct {
	Symbol       string      `json:"symbol"`
	InstrumentID string      `json:"instrument_id"`
	Result       []CryptoBar `json:"result"`
}

CryptoSymbolBars is the historical bars of one crypto symbol.

type DSNewsSummaryItem

type DSNewsSummaryItem struct {
	Title    string `json:"title"`
	Content  string `json:"content"`
	Source   string `json:"source"`
	URL      string `json:"url"`
	PubTime  string `json:"pub_time"`
	Symbol   string `json:"symbol"`
	Category string `json:"category"`

	// The fields below are declared by the news and summary pages but not marked
	// required, so they were absent here and a response carrying them decoded the
	// value to the zero value with no error reported. That is weaker evidence than a
	// missing-required-name row: these pages publish no required list, so a name may
	// be optional or conditionally sent, and nothing here asserts that a live server
	// sends it.
	//
	// The pages spell these facts differently from the fields above, and the two
	// spellings are carried side by side: NewsID, NewsTime, NewsURL, SourceName and
	// Thumbnail are the page names, and ID and Type are new. The summary page's Type
	// selects which of Args, Headers and Message is populated, so a caller reading
	// one of them must read Type first. Args, Headers and Rows are free-form objects
	// the page declares without naming any property inside, so they are carried
	// untyped.
	//
	// Display Solution requires a paid subscription, so no field here is
	// live-verified.
	ID         int64          `json:"id"`
	NewsTime   string         `json:"news_time"`
	NewsURL    string         `json:"news_url"`
	SourceName string         `json:"source_name"`
	Thumbnail  string         `json:"thumbnail"`
	Type       string         `json:"type"`
	Message    string         `json:"message"`
	Args       map[string]any `json:"args"`
	Headers    map[string]any `json:"headers"`
	Rows       map[string]any `json:"rows"`
}

DSNewsSummaryItem is a single news item returned by the Display Solution news endpoints.

type DSSubscribeRequest

type DSSubscribeRequest struct {
	Symbols []string `json:"symbols"`
}

DSSubscribeRequest is the request body for Client.DSSubscribe.

type DSUnsubscribeRequest

type DSUnsubscribeRequest struct {
	Symbols []string `json:"symbols"`
}

DSUnsubscribeRequest is the request body for Client.DSUnsubscribe.

type DepthLevel

type DepthLevel struct {
	// Price is the level price, as a decimal string.
	Price money.Money `json:"price"`
	// Size is the aggregate quantity at the level, as a decimal string.
	Size string `json:"size"`
}

DepthLevel is a single price level in the event-contract order book.

type DepthQuery

type DepthQuery struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string
	// Category is the market to query. Required.
	Category StockCategory
	// Depth is the number of order-book levels to return: 1 for L1, 10 for the
	// default L2 depth. Zero means the server default.
	Depth int
	// OvernightRequired includes overnight trading data when true.
	OvernightRequired bool
}

DepthQuery parameterizes Client.GetQuotes. Symbol and Category are required.

type DividendCalendarEntry

type DividendCalendarEntry struct {
	Symbol      string      `json:"symbol"`
	Market      string      `json:"market"`
	Currency    string      `json:"currency"`
	Amount      money.Money `json:"amount"`
	DivType     string      `json:"div_type"`
	DeclareDate string      `json:"declare_date"`
	ExDivDate   string      `json:"ex_div_date"`
	RecordDate  string      `json:"record_date"`
	PayDate     string      `json:"pay_date"`
}

DividendCalendarEntry is one dividend event.

type EarningsCalendarEntry

type EarningsCalendarEntry struct {
	FiscalYear          int    `json:"fiscal_year"`
	FiscalPeriod        int    `json:"fiscal_period"`
	Currency            string `json:"currency"`
	ExpectedPublishDate string `json:"expected_publish_date"`
	EPSActual           string `json:"eps_actual"`
	EPSEst              string `json:"eps_est"`
	RevActual           string `json:"rev_actual"`
	RevEst              string `json:"rev_est"`
}

EarningsCalendarEntry is one earnings announcement.

type EventBar

type EventBar struct {
	// Symbol is the event-contract symbol.
	Symbol string `json:"symbol"`
	// Open is the open price, as a decimal string.
	Open money.Money `json:"open"`
	// High is the high price, as a decimal string.
	High money.Money `json:"high"`
	// Low is the low price, as a decimal string.
	Low money.Money `json:"low"`
	// Close is the close price, as a decimal string.
	Close money.Money `json:"close"`
	// Volume is the volume, as a decimal string.
	Volume string `json:"volume"`
	// Timestamp is the bar time, as a string. The page calls this time; see Time.
	Timestamp string `json:"timestamp"`
	// Timespan is the bar granularity.
	Timespan BarTimespan `json:"timespan"`
	// Time is the documented name for the bar time, as a string. The page requires
	// time on every bar and does not mention timestamp, so a response honouring the
	// documentation left this type's own field empty.
	Time string `json:"time"`
}

EventBar is a candlestick bar for an event contract.

type EventBarsQuery

type EventBarsQuery struct {
	// Symbols is the list of event-contract symbols to query.
	Symbols []string
	// Category is the market to query. Required.
	Category string
	// Timespan is the bar granularity. Required.
	Timespan BarTimespan
	// Count is the number of bars to return per symbol. Zero means the server
	// default.
	Count int
	// RealTimeRequired requests the latest market data when true. When nil the
	// server default applies.
	RealTimeRequired *bool
}

EventBarsQuery parameterizes Client.GetEventBars. Symbols, Category and Timespan are required.

type EventBarsResult

type EventBarsResult struct {
	// InstrumentID is the unique identifier of the instrument these bars belong to.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the event-contract symbol these bars belong to.
	Symbol string `json:"symbol"`
	// Result is the bar series, in the order the page documents them.
	Result []EventBar `json:"result"`
}

EventBarsResult is one element of the documented response to Client.GetEventBars.

The page documents the 200 body as an array of objects, each requiring instrument_id, result and symbol, where result is itself an array of bars. This type is that outer element. The SDK previously returned the inner bars directly, which discarded the grouping key: bars from several instruments arrived in one flat list with nothing to say which instrument each belonged to, and instrument_id and symbol were unreachable.

type EventContractCategory

type EventContractCategory struct {
	// Category is the SDK's own spelling, kept for callers that already read it.
	Category string `json:"category"`
	// Name is the SDK's own spelling, kept for callers that already read it.
	Name string `json:"name"`
	// CategoryID is the documented numeric identifier.
	CategoryID int64 `json:"category_id"`
	// CategoryCode is the documented short code, for example ECONOMICS.
	CategoryCode string `json:"category_code"`
	// CategoryName is the documented display name.
	CategoryName string `json:"category_name"`
}

EventContractCategory represents an event contract category.

The page documents category_id, category_code and category_name, and marks all three required. Category and Name are the SDK's own spellings and are carried alongside them rather than replaced: a response that honours the documentation previously left all three required values unreadable, with nothing in the return path to distinguish that from a genuinely empty category. Exactly one naming set is populated per response.

type EventContractEvent

type EventContractEvent struct {
	// EventSymbol is the SDK's own spelling of the documented symbol.
	EventSymbol string `json:"event_symbol"`
	// SeriesSymbol is the SDK's own spelling of the documented series_id.
	SeriesSymbol string `json:"series_symbol"`
	Name         string `json:"name"`
	Status       string `json:"status"`
	// Symbol is the documented event symbol.
	Symbol string `json:"symbol"`
	// SeriesID is the documented series identifier.
	SeriesID string `json:"series_id"`
	// ShortName is the documented abbreviated name.
	ShortName string `json:"short_name"`
	// MutuallyExclusive reports whether the event is mutually exclusive within its
	// series, as the page documents it.
	MutuallyExclusive bool `json:"mutually_exclusive"`
	// StrikeDate and StrikePeriod are documented but not required; they are omitted
	// when the server does not send them.
	StrikeDate   string `json:"strike_date,omitempty"`
	StrikePeriod string `json:"strike_period,omitempty"`
}

EventContractEvent represents a single event within a series.

The page documents symbol, series_id, name, status, short_name, strike_date, strike_period and mutually_exclusive, and requires six of them. EventSymbol and SeriesSymbol are the SDK's own spellings for what the page calls symbol and series_id; both sets are carried so a caller reading either name gets a value, and so no call that works today breaks. Exactly one naming set is populated per response.

type EventContractEventsQuery

type EventContractEventsQuery struct {
	SeriesSymbol string
	Symbols      []string
	Status       string
}

EventContractEventsQuery parameterizes Client.GetEventContractEvents.

type EventContractMarket

type EventContractMarket struct {
	Symbol         string      `json:"symbol"`
	EventSymbol    string      `json:"event_symbol"`
	SeriesSymbol   string      `json:"series_symbol"`
	Status         string      `json:"status"`
	StrikePrice    money.Money `json:"strike_price,omitempty"`
	ExpirationDate string      `json:"expiration_date,omitempty"`
}

EventContractMarket represents a tradable event contract instrument.

type EventContractMarketsQuery

type EventContractMarketsQuery struct {
	SeriesSymbol        string
	EventSymbol         string
	Symbols             []string
	ExpirationDateAfter string
	PaginationKey       string
}

EventContractMarketsQuery parameterizes Client.GetEventContractMarkets.

type EventContractSeries

type EventContractSeries struct {
	SeriesSymbol string `json:"series_symbol"`
	Category     string `json:"category"`
	Name         string `json:"name"`
	Status       string `json:"status"`
}

EventContractSeries represents a series of related events.

type EventContractSeriesQuery

type EventContractSeriesQuery struct {
	Category      string
	Symbols       []string
	PaginationKey string
}

EventContractSeriesQuery parameterizes Client.GetEventContractSeries.

type EventContractTag

type EventContractTag struct {
	Tags         []string `json:"tags"`
	CategoryID   int      `json:"category_id"`
	CategoryName string   `json:"category_name"`
	CategoryCode string   `json:"category_code"`
}

EventContractTag groups the tags available for a category.

type EventDepth

type EventDepth struct {
	// Symbol is the event-contract symbol.
	Symbol string `json:"symbol"`
	// Timestamp is the SDK's own spelling of the depth time.
	Timestamp string `json:"timestamp"`
	// YesBids is the bid side of the book, best (highest) price first.
	YesBids []DepthLevel `json:"yes_bids"`
	// YesAsks is the ask side of the book, best (lowest) price first.
	YesAsks []DepthLevel `json:"yes_asks"`

	// InstrumentID is the unique identifier of the instrument.
	InstrumentID string `json:"instrument_id"`
	// QuoteTime is the documented depth time, as a Unix epoch millisecond timestamp.
	QuoteTime int64 `json:"quote_time"`
	// NoBids is the no-side bid book, best (highest) price first. The SDK carried no
	// no-side book at all, so a caller could not read the no side of an event
	// contract's depth, which is the side such an instrument is named for.
	NoBids []DepthLevel `json:"no_bids"`
	// NoAsks is the no-side ask book, best (lowest) price first.
	NoAsks []DepthLevel `json:"no_asks"`
}

EventDepth is the order book for one event contract instrument.

The page documents the 200 body as an **array** of these, each requiring instrument_id, symbol, quote_time, yes_bids, yes_asks, no_bids and no_asks, so Client.GetEventDepth returns a slice of them. The no-side book was absent here entirely, and the depth time was named timestamp rather than the documented quote_time, so a response honouring the documentation left both unreadable. QuoteTime is carried alongside Timestamp because a required name is one a conforming server always sends and which of the two a live server sends is unverified.

type EventDepthQuery

type EventDepthQuery struct {
	// Symbol is the event-contract symbol.
	Symbol string
	// Category is the market to query. Required.
	Category string
	// Depth is the number of order-book levels to return.
	Depth int
}

EventDepthQuery parameterizes Client.GetEventDepth. Symbol, Category and Depth are required.

type EventGameStats

type EventGameStats struct {
	MilestoneID string           `json:"milestone_id"`
	Periods     []map[string]any `json:"periods"`
}

EventGameStats is the game statistics for an event-contract milestone.

type EventListPage

type EventListPage struct {
	Data          []map[string]any `json:"data"`
	PaginationKey string           `json:"pagination_key"`
}

EventListPage is a paginated list of event items.

type EventListQuery

type EventListQuery struct {
	SeriesSymbol  string
	Status        string
	PaginationKey string
}

EventListQuery parameterizes Client.GetEventContractEventsList.

type EventLiveData

type EventLiveData struct {
	Type          string         `json:"type"`
	MilestoneID   string         `json:"milestone_id"`
	Status        string         `json:"status"`
	Winner        string         `json:"winner"`
	LastPlay      map[string]any `json:"last_play"`
	LastUpdatedTS int64          `json:"last_updated_ts"`
	Details       map[string]any `json:"details"`
}

EventLiveData is the live state of an event-contract milestone.

type EventMarketBar

type EventMarketBar struct {
	EndPeriodTime string      `json:"end_period_time"`
	Volume        string      `json:"volume"`
	Open          money.Money `json:"open"`
	High          money.Money `json:"high"`
	Low           money.Money `json:"low"`
	Close         money.Money `json:"close"`
}

EventMarketBar is a single event-contract market bar.

type EventMarketBarsByEventQuery

type EventMarketBarsByEventQuery struct {
	EventSymbol string
	Category    string
	StartTime   int64
	EndTime     int64
	Count       int
	Timespan    string
}

EventMarketBarsByEventQuery parameterizes Client.GetEventMarketBarsByEvent.

type EventMarketBarsQuery

type EventMarketBarsQuery struct {
	Symbols   []string
	Category  string
	StartTime int64
	EndTime   int64
	Count     int
	Timespan  string
}

EventMarketBarsQuery parameterizes Client.GetEventMarketBars.

type EventMarketDepth

type EventMarketDepth struct {
	Symbol       string           `json:"symbol"`
	InstrumentID string           `json:"instrument_id"`
	YesAsks      []map[string]any `json:"yes_asks"`
	YesBids      []map[string]any `json:"yes_bids"`
	NoAsks       []map[string]any `json:"no_asks"`
	NoBids       []map[string]any `json:"no_bids"`
}

EventMarketDepth is the order-book depth of an event-contract market.

type EventMarketSnapshot

type EventMarketSnapshot struct {
	Symbol        string      `json:"symbol"`
	InstrumentID  string      `json:"instrument_id"`
	EventSymbol   string      `json:"event_symbol"`
	YesSubTitle   string      `json:"yes_sub_title"`
	NoSubTitle    string      `json:"no_sub_title"`
	Status        string      `json:"status"`
	YesBid        money.Money `json:"yes_bid"`
	YesAsk        money.Money `json:"yes_ask"`
	NoBid         money.Money `json:"no_bid"`
	NoAsk         money.Money `json:"no_ask"`
	Price         money.Money `json:"price"`
	Volume        string      `json:"volume"`
	OpenInterest  string      `json:"open_interest"`
	LastTradeTime string      `json:"last_trade_time"`
}

EventMarketSnapshot is the market snapshot of an event-contract market.

type EventSeriesListPage

type EventSeriesListPage struct {
	Data          []map[string]any `json:"data"`
	PaginationKey string           `json:"pagination_key"`
}

EventSeriesListPage is a paginated list of event series.

type EventSeriesListQuery

type EventSeriesListQuery struct {
	Category      string
	Tags          string
	Symbols       []string
	PaginationKey string
}

EventSeriesListQuery parameterizes Client.GetEventContractSeriesList.

type EventSnapshot

type EventSnapshot struct {
	// Symbol is the event-contract symbol.
	Symbol string `json:"symbol"`
	// LastPrice is the last traded price, as a decimal string. The page calls this
	// price; see Price.
	LastPrice money.Money `json:"last_price"`
	// YesBid is the best bid price for the yes side, as a decimal string.
	YesBid money.Money `json:"yes_bid"`
	// YesAsk is the best ask price for the yes side, as a decimal string.
	YesAsk money.Money `json:"yes_ask"`
	// Volume is the traded volume, as a decimal string.
	Volume string `json:"volume"`
	// OpenInterest is the open interest, as a decimal string.
	OpenInterest string `json:"open_interest"`
	// Timestamp is the snapshot time, as a string.
	Timestamp string `json:"timestamp"`

	// InstrumentID is the unique identifier of the instrument.
	InstrumentID string `json:"instrument_id"`
	// Name is the event's display name.
	Name string `json:"name"`
	// Price is the documented name for the snapshot price, as a decimal string.
	Price money.Money `json:"price"`
	// LastTradeTime is the last trade time, as a Unix epoch millisecond timestamp.
	LastTradeTime int64 `json:"last_trade_time"`
	// YesBidSize is the size resting at the best yes bid.
	YesBidSize string `json:"yes_bid_size"`
	// YesAskSize is the size resting at the best yes ask.
	YesAskSize string `json:"yes_ask_size"`
	// NoBid is the best bid price for the no side, as a decimal string.
	NoBid money.Money `json:"no_bid"`
	// NoBidSize is the size resting at the best no bid.
	NoBidSize string `json:"no_bid_size"`
	// NoAsk is the best ask price for the no side, as a decimal string.
	NoAsk money.Money `json:"no_ask"`
	// NoAskSize is the size resting at the best no ask.
	NoAskSize string `json:"no_ask_size"`
}

EventSnapshot is a real-time snapshot for an event contract.

The page documents 15 required names and this type originally carried 7, several under names the page does not use: it has LastPrice where the page says price, and no size companion for any side, so a caller could not read the depth a snapshot exists to report. The documented names are carried **alongside** the existing ones rather than replacing them, because a required name is one a conforming server always sends and replacing a field would break a caller that reads it. Which set a live server sends is unverified, so both are present and exactly one is populated per response.

type EventSnapshotQuery

type EventSnapshotQuery struct {
	// Symbols is the list of event-contract symbols to query, at most 100.
	Symbols []string
	// Category is the market to query. Required.
	Category string
}

EventSnapshotQuery parameterizes Client.GetEventSnapshot. Symbols and Category are required.

type EventSportsFilter

type EventSportsFilter struct {
	Tag          string   `json:"tag"`
	Competitions []string `json:"competitions"`
	Scopes       []string `json:"scopes"`
}

EventSportsFilter is a sports filter for event contracts.

type EventTick

type EventTick struct {
	// Symbol is the event-contract symbol.
	Symbol string `json:"symbol"`
	// YesPrice is the yes-side trade price, as a decimal string.
	YesPrice money.Money `json:"yes_price"`
	// NoPrice is the no-side trade price, as a decimal string.
	NoPrice money.Money `json:"no_price"`
	// Side is the aggressor side.
	Side string `json:"side"`
	// Volume is the executed trade volume, as a decimal string.
	Volume string `json:"volume"`
	// TradeID is the unique trade identifier.
	TradeID string `json:"trade_id"`
	// Timestamp is the trade time, as a string. The page calls this time; see Time.
	Timestamp string `json:"timestamp"`
	// Time is the documented name for the trade time, as a string. The page requires
	// time on every tick and does not mention timestamp, so a response honouring the
	// documentation left this type's own field empty.
	Time string `json:"time"`
}

EventTick is a tick trade for an event contract.

type EventTickQuery

type EventTickQuery struct {
	// Symbol is the event-contract symbol.
	Symbol string
	// Category is the market to query. Required.
	Category string
	// Count is the number of ticks to return.
	Count int
}

EventTickQuery parameterizes Client.GetEventTick. Symbol, Category and Count are required.

type EventTickResult

type EventTickResult struct {
	// InstrumentID is the unique identifier of the instrument these ticks belong to.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the event-contract symbol these ticks belong to.
	Symbol string `json:"symbol"`
	// Result is the tick series, in the order the page documents them.
	Result []EventTick `json:"result"`
}

EventTickResult is one element of the documented response to Client.GetEventTick.

The page documents the 200 body as an array of objects, each requiring instrument_id, result and symbol, where result is itself an array of ticks. This type is that outer element. The SDK previously returned the inner ticks directly, which discarded the grouping key, so ticks from several instruments arrived in one flat list with nothing to say which instrument each belonged to.

type ExchangeTimes

type ExchangeTimes struct {
	// Start is the exchange start time as a wall-clock string, for example "09:30:00".
	Start string `json:"start"`
	// End is the exchange end time as a wall-clock string, for example "16:00:00".
	End string `json:"end"`
	// TradingSession names the session, for example "RTH" or "PRE".
	TradingSession string `json:"trading_session"`
}

ExchangeTimes is one entry of a response's exchange trading hours, as documented by the Display Solution bars pages.

The two documented hours arrays are not the same schema, and this type exists because of that: Times requires start and end as **strings** such as "09:30:00" and EndTime/StartTime carry wall-clock times, whereas SpecialTimes documents the same three names as an **integer** epoch. One shared element type cannot represent both honestly, so the two are separate types rather than one with a widened field.

type FilingEntry

type FilingEntry struct {
	Title       string `json:"title"`
	URL         string `json:"url"`
	PublishDate string `json:"publish_date"`
}

FilingEntry is one SEC filing.

type FilingsResponse

type FilingsResponse struct {
	Symbol   string        `json:"symbol"`
	Category string        `json:"category"`
	Filings  []FilingEntry `json:"filings"`
}

FilingsResponse wraps the filings list.

type FinancialAlert

type FinancialAlert struct {
	Symbol             string `json:"symbol"`
	Category           string `json:"category"`
	ExpectedReportDate string `json:"expected_report_date"`
	EstimatedEPS       string `json:"estimated_eps"`
	LastYearEPS        string `json:"last_year_eps"`

	// The nine fields below are declared by the page but not marked required, so they
	// were absent here and a response carrying them decoded the value to the zero
	// value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent.
	//
	// The page's EPSEstimate and EPSLastYear are the same facts this type spells
	// EstimatedEPS and LastYearEPS, and its RevenueEstimate and RevenueLastYear are
	// the earnings figures this type has no field for. Both spellings are carried,
	// because which one a live server sends is unverified. FiscalYear and
	// FiscalPeriod are integers on the page and are carried as int64; every other
	// field here is a decimal string, as Webull sends money and ratios.
	Currency     string `json:"currency"`
	StartDate    string `json:"start_date"`
	EndDate      string `json:"end_date"`
	FiscalYear   int64  `json:"fiscal_year"`
	FiscalPeriod int64  `json:"fiscal_period"`
	EPSEstimate  string `json:"eps_est"`
	EPSLastYear  string `json:"eps_ly"`
	RevEstimate  string `json:"rev_est"`
	RevLastYear  string `json:"rev_ly"`
}

FinancialAlert holds upcoming earnings-release alert information.

type FinancialIndicator

type FinancialIndicator struct {
	ROA       string `json:"roa"`
	ROE       string `json:"roe"`
	EPS       string `json:"eps"`
	NetMargin string `json:"net_margin"`
	DebtRatio string `json:"debt_ratio"`

	// The two fields below are declared by the page but not marked required, so they
	// were absent here and a response carrying them decoded the value to the zero
	// value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent.
	//
	// Values is a free-form object the page declares without naming any property
	// inside, so it is carried untyped; the indicator's own name is what keys it.
	// Currency is the denomination of the values.
	Currency string         `json:"currency"`
	Values   map[string]any `json:"values"`
}

FinancialIndicator holds key financial ratios and metrics.

type FinancialsItem

type FinancialsItem map[string]any

FinancialsItem is one period's financial data entry. Field names are preserved from the API response. Values are any because the API returns a mix of strings and numbers (e.g. integer fiscal periods).

type FootprintBar

type FootprintBar struct {
	// Time is the bar timestamp, for example
	// "2025-09-30T05:47:00.000+0000".
	Time string `json:"time"`
	// TradingSession is the session the bar belongs to.
	TradingSession TradingSession `json:"trading_session"`
	// Total is the sum of buy and sell volume, as a decimal string.
	Total string `json:"total"`
	// Delta is buy volume minus sell volume, as a decimal string.
	Delta string `json:"delta"`
	// BuyTotal is the buy-initiated volume, as a decimal string.
	BuyTotal string `json:"buy_total"`
	// SellTotal is the sell-initiated volume, as a decimal string.
	SellTotal string `json:"sell_total"`
	// BuyDetail maps price levels to buy volume at that price; both the price
	// and the volume are decimal strings.
	BuyDetail map[string]string `json:"buy_detail"`
	// SellDetail maps price levels to sell volume at that price; both the price
	// and the volume are decimal strings.
	SellDetail map[string]string `json:"sell_detail"`
}

FootprintBar is a single footprint bar: aggregated buy and sell volume with a per-price breakdown.

type FootprintQuery

type FootprintQuery struct {
	// Symbols are the security symbols to query, at most 20 per request.
	// Required.
	Symbols []string
	// Category is the security type. Required, and only [StockCategoryUS] is
	// supported.
	Category StockCategory
	// Timespan is the bar granularity. Required.
	Timespan FootprintTimespan
	// Count is the number of bars to return, between 1 and 1200. Zero means
	// the server default of 200.
	Count int
	// RealTimeRequired reports whether bars that are not yet finalized should
	// be included. It only applies to minute timespans.
	RealTimeRequired bool
	// TradingSessions restricts the result to one trading session. Empty means
	// all sessions. The endpoint does not accept [TradingSessionOvernight].
	TradingSessions TradingSession
}

FootprintQuery parameterizes Client.GetFootprint. Symbols, Category and Timespan are required; the remaining fields are optional.

type FootprintTimespan

type FootprintTimespan string

FootprintTimespan is the bar granularity of a footprint request.

const (
	// FootprintTimespanS5 is a five-second bar.
	FootprintTimespanS5 FootprintTimespan = "S5"
	// FootprintTimespanS15 is a fifteen-second bar.
	FootprintTimespanS15 FootprintTimespan = "S15"
	// FootprintTimespanM1 is a one-minute bar.
	FootprintTimespanM1 FootprintTimespan = "M1"
	// FootprintTimespanM5 is a five-minute bar.
	FootprintTimespanM5 FootprintTimespan = "M5"
	// FootprintTimespanM30 is a thirty-minute bar.
	FootprintTimespanM30 FootprintTimespan = "M30"
)

Footprint granularities accepted by the footprint endpoint. Only these values are supported; the endpoint does not accept arbitrary intervals.

type ForecastEPSEntry

type ForecastEPSEntry struct {
	FiscalYear   int    `json:"fiscal_year"`
	FiscalPeriod int    `json:"fiscal_period"`
	Actual       string `json:"actual"`
	Est          string `json:"est"`
	Reported     bool   `json:"reported"`
}

ForecastEPSEntry is one quarter's EPS forecast data.

type FundAllocation

type FundAllocation struct {
	Date        string         `json:"date"`
	Aum         money.Money    `json:"aum"`
	Cash        map[string]any `json:"cash"`
	Bond        map[string]any `json:"bond"`
	Stock       map[string]any `json:"stock"`
	Preferred   map[string]any `json:"preferred"`
	Convertible map[string]any `json:"convertible"`
	Other       map[string]any `json:"other"`
}

FundAllocation is one fund asset-allocation record. The asset-class fields are returned as decoded objects because their schema is not fixed.

type FundDividend

type FundDividend struct {
	Symbol     string      `json:"symbol"`
	Name       string      `json:"name"`
	Currency   string      `json:"currency"`
	Exchange   string      `json:"exchange"`
	Amount     money.Money `json:"amount"`
	ExDate     string      `json:"ex_date"`
	PayDate    string      `json:"pay_date"`
	RecordDate string      `json:"record_date"`
	Frequency  string      `json:"frequency"`
}

FundDividend represents a fund or ETF dividend event.

type FundDividendsQuery

type FundDividendsQuery struct {
	Symbol    string
	StartDate string
	EndDate   string
	PageSize  int
	// PaginationKey is the opaque cursor from the previous page's
	// [types.Page.PaginationKey]. Empty starts at the first page; pass the returned
	// key unmodified to get the next one.
	PaginationKey string
}

FundDividendsQuery parameterizes Client.GetFundDividends.

type FundFile

type FundFile struct {
	PublishDate string `json:"publish_date"`
	URL         string `json:"url"`
	Type        int    `json:"type"`
	FileName    string `json:"file_name"`
}

FundFile is one fund document.

type FundHolding

type FundHolding struct {
	TargetSymbol    string `json:"target_symbol"`
	StockName       string `json:"stock_name"`
	ShareHeldPct    string `json:"share_held_pct"`
	ShareHeldChgPct string `json:"share_held_chg_pct"`
	MaturityDate    string `json:"maturity_date"`
	UpdateTime      string `json:"update_time"`
}

FundHolding is one fund holding.

type FundInfo

type FundInfo struct {
	Symbol        string      `json:"symbol"`
	Name          string      `json:"name"`
	Currency      string      `json:"currency"`
	Exchange      string      `json:"exchange"`
	Aum           money.Money `json:"aum"`
	ExpenseRatio  string      `json:"expense_ratio"`
	DividendYield string      `json:"dividend_yield"`
	InceptionDate string      `json:"inception_date"`
	FundType      string      `json:"fund_type"`
	Category      string      `json:"category"`

	// The six fields below are declared by the page but not marked required, so they
	// were absent here and a response carrying them decoded the value to the zero
	// value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent.
	//
	// The page's LaunchDate is the same fact this type spells InceptionDate, so both
	// are carried. The remaining five have no counterpart above.
	Issuer              string            `json:"issuer"`
	Custodian           string            `json:"custodian"`
	Benchmark           string            `json:"benchmark"`
	InvestmentObjective string            `json:"investment_objective"`
	LaunchDate          string            `json:"launch_date"`
	Managers            []FundInfoManager `json:"managers"`
}

FundInfo represents basic information for a fund or ETF.

type FundInfoManager

type FundInfoManager struct {
	// Name is the manager's name.
	Name string `json:"name"`
	// Title is the manager's role, for example "Manager".
	Title string `json:"title"`
	// StartDate is when the manager took the role, as YYYY-MM-DD.
	StartDate string `json:"start_date"`
	// EndDate is when the manager left the role, as YYYY-MM-DD, or empty while
	// incumbent.
	EndDate string `json:"end_date"`
	// IsIncumbent reports whether the manager currently holds the role. The page
	// documents it as an integer, so it is carried as int64 and a caller reads
	// Incumbent rather than assuming a bool.
	IsIncumbent int64 `json:"is_incumbent"`
	// TenureDays is the manager's tenure in days.
	TenureDays int64 `json:"tenure_days"`
	// TenureYears is the manager's tenure in years, as a decimal string.
	TenureYears string `json:"tenure_years"`
	// TenureReturn is the return over the manager's tenure, as a decimal string.
	TenureReturn string `json:"tenure_return"`
}

FundInfoManager is one manager of a fund.

The page declares every field without marking any required, so each may be absent.

type FundInfoQuery

type FundInfoQuery struct {
	Symbol string
}

FundInfoQuery parameterizes Client.GetFundInfo.

type FundListItem

type FundListItem struct {
	Symbol        string `json:"symbol"`
	Name          string `json:"name"`
	Currency      string `json:"currency"`
	Exchange      string `json:"exchange"`
	FundType      string `json:"fund_type"`
	Category      string `json:"category"`
	DividendYield string `json:"dividend_yield"`
}

FundListItem represents a fund or ETF in a list response.

type FundListQuery

type FundListQuery struct {
	Market   string
	Category string
	Exchange string
	PageSize int
}

FundListQuery parameterizes Client.GetFundList.

type FundNav

type FundNav struct {
	Symbol         string      `json:"symbol"`
	Name           string      `json:"name"`
	Currency       string      `json:"currency"`
	Exchange       string      `json:"exchange"`
	Nav            money.Money `json:"nav"`
	NavDate        string      `json:"nav_date"`
	PrevNav        money.Money `json:"prev_nav"`
	NavChange      money.Money `json:"nav_change"`
	NavChangeRatio string      `json:"nav_change_ratio"`

	// The two fields below are declared by the page but not marked required, so they
	// were absent here and a response carrying them decoded the value to the zero
	// value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent.
	//
	// The page's NetValue is this type's Nav and its Date is this type's NavDate, so
	// both sets are carried and a response populates whichever it sends. This type
	// already carries Currency, which the page's element also declares.
	NetValue money.Money `json:"net_value"`
	Date     string      `json:"date"`
}

FundNav represents fund NAV (Net Asset Value) history data.

type FundNavQuery

type FundNavQuery struct {
	Symbol    string
	StartDate string
	EndDate   string
	PageSize  int
}

FundNavQuery parameterizes Client.GetFundNav.

type FundPerformance

type FundPerformance struct {
	Currency  string `json:"currency"`
	EndDate   string `json:"end_date"`
	Return1M  string `json:"return_1m"`
	Return3M  string `json:"return_3m"`
	Return6M  string `json:"return_6m"`
	Return1Y  string `json:"return_1y"`
	Return3Y  string `json:"return_3y"`
	Return5Y  string `json:"return_5y"`
	Return10Y string `json:"return_10y"`
	ReturnSI  string `json:"return_si"`
}

FundPerformance is the performance-return history of a fund.

type FundRating

type FundRating struct {
	RatingDate    string `json:"rating_date"`
	RatingAgency  string `json:"rating_agency"`
	RatingCycle   string `json:"rating_cycle"`
	RatingResults int    `json:"rating_results"`
}

FundRating is one fund rating record.

type FundSplit

type FundSplit struct {
	SplitDate  string  `json:"split_date"`
	SplitType  string  `json:"split_type"`
	SplitRatio string  `json:"split_ratio"`
	From       float64 `json:"from"`
	To         float64 `json:"to"`
}

FundSplit is one fund split record.

type FuturesBarsQuery

type FuturesBarsQuery struct {
	// Symbols is the list of futures contract symbols to query.
	Symbols []string
	// Category is the futures market category. Defaults to US_FUTURES if empty.
	Category FuturesCategory
	// Interval is the bar granularity. Required.
	Interval BarTimespan
	// Count is the number of bars to return per symbol. Zero means the server
	// default (200); the documented maximum is 1200 (1650 for M1).
	Count int
}

FuturesBarsQuery parameterizes Client.GetFuturesBars. Symbols and Interval are required.

type FuturesCategory

type FuturesCategory string

FuturesCategory identifies the futures market to query.

const (
	// FuturesCategoryUS identifies United States futures.
	FuturesCategoryUS FuturesCategory = "US_FUTURES"
	// FuturesCategoryHK identifies Hong Kong futures.
	FuturesCategoryHK FuturesCategory = "HK_FUTURES"
	// FuturesCategoryCN identifies China futures.
	FuturesCategoryCN FuturesCategory = "CN_FUTURES"
)

Futures market categories.

type FuturesContractType

type FuturesContractType string

FuturesContractType distinguishes regular month contracts from continuous main contracts.

const (
	// FuturesContractTypeMonthly is a regular delivery-month contract.
	FuturesContractTypeMonthly FuturesContractType = "MONTHLY"
	// FuturesContractTypeMain is a main/continuous contract.
	FuturesContractTypeMain FuturesContractType = "MAIN"
)

Futures contract types.

type FuturesDepthQuery

type FuturesDepthQuery struct {
	// Symbol is the futures contract symbol, for example "ESZ5".
	Symbol string
	// Category is the futures market category. Defaults to US_FUTURES if empty.
	Category FuturesCategory
	// Depth is the number of order-book levels to return: 1 for L1, 10 for the
	// default L2 depth. Zero means the server default.
	Depth int
}

FuturesDepthQuery parameterizes Client.GetFuturesDepth. Symbol is required.

type FuturesFootprintQuery

type FuturesFootprintQuery struct {
	// Symbols are the futures contract symbols to query, at most 20 per request.
	Symbols []string
	// Category is the futures market category. Defaults to US_FUTURES if empty.
	Category FuturesCategory
	// Timespan is the bar granularity. Required.
	Timespan FootprintTimespan
	// Count is the number of bars to return, between 1 and 1200. Zero means
	// the server default of 200.
	Count int
}

FuturesFootprintQuery parameterizes Client.GetFuturesFootprint. Symbols and Timespan are required.

type FuturesInstrument

type FuturesInstrument struct {
	// Symbol is the contract symbol used in trading and market data, for
	// example "ESZ5" or the continuous "ESmain".
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the contract. For a main or
	// continuous contract this identifies the main contract itself.
	InstrumentID string `json:"instrument_id"`
	// ExchangeCode is the exchange code, for example "XCME".
	ExchangeCode string `json:"exchange_code"`
	// Code is the product code, for example "ES".
	Code string `json:"code"`
	// Name is the display name of the contract.
	Name string `json:"name"`
	// ProductClassID identifies the product class, for example 2.
	ProductClassID int32 `json:"product_class_id"`
	// ProductClassName is the product class name, for example "Equities".
	ProductClassName string `json:"product_class_name"`
	// Status is the tradable status.
	Status InstrumentStatus `json:"status"`
	// Currency is the trading currency, for example "USD".
	Currency string `json:"currency"`
	// ContractMonth is the delivery month in yyyyMM form, for example "202512".
	ContractMonth string `json:"contract_month"`
	// SettlementDate is the final settlement date (YYYY-MM-DD).
	SettlementDate string `json:"settlement_date"`
	// Size is the contract multiplier, as a decimal string.
	Size string `json:"size"`
	// Unit describes the pricing unit and quantity. The API returns this as
	// either a string (e.g., "1-index points") or a bare number.
	Unit StringOrNumber `json:"unit"`
	// MinTick is the minimum price increment, as a decimal string.
	MinTick string `json:"min_tick"`
	// FirstNoticeDate is the first notice date (YYYY-MM-DD), when applicable.
	FirstNoticeDate string `json:"first_notice_date"`
	// LastNoticeDate is the last notice date (YYYY-MM-DD), when applicable.
	LastNoticeDate string `json:"last_notice_date"`
	// FirstTradingDate is the first tradable date (YYYY-MM-DD).
	FirstTradingDate string `json:"first_trading_date"`
	// LastTradingDate is the final trading date (YYYY-MM-DD).
	LastTradingDate string `json:"last_trading_date"`
	// ContractType distinguishes monthly from main/continuous contracts.
	ContractType FuturesContractType `json:"contract_type"`
	// Settlement is the settlement method.
	Settlement FuturesSettlement `json:"settlement"`
}

FuturesInstrument is the static profile of a single futures contract.

type FuturesInstrumentQuery

type FuturesInstrumentQuery struct {
	// Category is the futures market to query. Required.
	Category FuturesCategory
	// Symbols restricts the result to the named trading symbols (for example
	// "ESZ5" or "NQZ5"), at most 100 per query.
	Symbols []string
	// Code restricts the result to a product code (for example "ES"). Either
	// Symbols or Code must be set.
	Code string
	// Status filters by tradable status.
	Status InstrumentStatus
}

FuturesInstrumentQuery parameterizes Client.GetFuturesInstruments. Category is required, and at least one of Symbols or Code must be provided.

type FuturesProduct

type FuturesProduct struct {
	// Name is the display name, for example "E-Mini S&P 500".
	Name string `json:"name"`
	// Code is the product code, for example "ES".
	Code string `json:"code"`
	// ProductClassID identifies the product class.
	ProductClassID int32 `json:"product_class_id"`
	// ProductClassName is the product class name, for example "Equities".
	ProductClassName string `json:"product_class_name"`
	// ExchangeCode is the exchange code, for example "XCME".
	ExchangeCode string `json:"exchange_code"`
}

FuturesProduct is a futures underlying product and its code.

type FuturesProductClass

type FuturesProductClass struct {
	// ProductClassID is the product class identifier.
	ProductClassID int32 `json:"product_class_id"`
	// ProductClassName is the product class name, for example "Equities".
	ProductClassName string `json:"product_class_name"`
}

FuturesProductClass is a futures product classification group.

type FuturesProductCodeQuery

type FuturesProductCodeQuery struct {
	// Category is the futures market to query. Required.
	Category FuturesCategory
	// ProductClassID optionally restricts the result to one product class.
	// Zero means no filter.
	ProductClassID int32
}

FuturesProductCodeQuery parameterizes Client.GetFuturesProductCodes. Category is required.

type FuturesSettlement

type FuturesSettlement string

FuturesSettlement is the settlement method of a futures contract.

const (
	// FuturesSettlementCash settles in cash.
	FuturesSettlementCash FuturesSettlement = "Cash"
	// FuturesSettlementPhysical settles by physical delivery.
	FuturesSettlementPhysical FuturesSettlement = "Physical"
)

Futures settlement methods.

type FuturesSnapshotQuery

type FuturesSnapshotQuery struct {
	// Symbols is the list of futures contract symbols to query, at most 100.
	Symbols []string
	// Category is the futures market category. Defaults to US_FUTURES if empty.
	Category FuturesCategory
}

FuturesSnapshotQuery parameterizes Client.GetFuturesSnapshot. Symbols is required.

type FuturesTickQuery

type FuturesTickQuery struct {
	// Symbol is the futures contract symbol, for example "ESZ5".
	Symbol string
	// Category is the futures market category. Defaults to US_FUTURES if empty.
	Category FuturesCategory
	// Count is the number of ticks to return. Zero means the server default
	// (30); the documented maximum is 1000.
	Count int
}

FuturesTickQuery parameterizes Client.GetFuturesTick. Symbol is required.

type GainersLosersQuery

type GainersLosersQuery struct {
	// RankType is the time window used to rank the price change. Required.
	RankType GainersLosersRankType
	// Category is the security market. Required, and only [StockCategoryUS]
	// is supported.
	Category StockCategory
	// SortBy is the secondary sort field. Required.
	SortBy ScreenerSortBy
	// Direction is the sort direction. Empty uses the server default.
	Direction SortDirection
	// PaginationKey is the opaque cursor from the previous page's
	// [types.Page.PaginationKey]. Empty starts at the first page; pass the returned
	// key unmodified to get the next one.
	PaginationKey string
}

GainersLosersQuery parameterizes Client.GetTopGainersLosers. RankType, Category and SortBy are required. Direction defaults to descending on the server; pass SortDirectionAsc to retrieve losers rather than gainers.

type GainersLosersRankType

type GainersLosersRankType string

GainersLosersRankType is the time window over which gainers and losers are ranked.

const (
	// GainersLosersRankPreMarket ranks by the pre-market move.
	GainersLosersRankPreMarket GainersLosersRankType = "PRE_MARKET"
	// GainersLosersRankAfterMarket ranks by the after-market move.
	GainersLosersRankAfterMarket GainersLosersRankType = "AFTER_MARKET"
	// GainersLosersRankMin3 ranks by the three-minute move.
	GainersLosersRankMin3 GainersLosersRankType = "MIN_3"
	// GainersLosersRankMin5 ranks by the five-minute move.
	GainersLosersRankMin5 GainersLosersRankType = "MIN_5"
	// GainersLosersRankDay1 ranks by the one-day move.
	GainersLosersRankDay1 GainersLosersRankType = "DAY_1"
	// GainersLosersRankDay5 ranks by the five-day move.
	GainersLosersRankDay5 GainersLosersRankType = "DAY_5"
	// GainersLosersRankMonth1 ranks by the one-month move.
	GainersLosersRankMonth1 GainersLosersRankType = "MONTH_1"
	// GainersLosersRankMonth3 ranks by the three-month move.
	GainersLosersRankMonth3 GainersLosersRankType = "MONTH_3"
	// GainersLosersRankWeek52 ranks by the 52-week move.
	GainersLosersRankWeek52 GainersLosersRankType = "WEEK_52"
)

Gainers/losers ranking windows.

type HighDividendQuery

type HighDividendQuery struct {
	// Category is the security market. Required.
	Category StockCategory
	// SortBy is the secondary sort field. Empty uses the server default.
	SortBy ScreenerSortBy
	// Direction is the sort direction. Empty uses the server default.
	Direction SortDirection
}

HighDividendQuery parameterizes Client.GetHighDividendRank.

type IndustryComparison

type IndustryComparison struct {
	FiscalYear   int                      `json:"fiscal_year"`
	FiscalPeriod int                      `json:"fiscal_period"`
	IndustryName string                   `json:"industry_name"`
	Type         string                   `json:"type"`
	Data         []IndustryComparisonItem `json:"data"`
}

IndustryComparison holds industry comparison data for a single fiscal period.

type IndustryComparisonItem

type IndustryComparisonItem struct {
	Symbol string `json:"symbol"`
	Name   string `json:"name"`
	Rank   int    `json:"rank"`
	Value  string `json:"value"`
}

IndustryComparisonItem is one entry in an industry comparison.

type InstrumentStatus

type InstrumentStatus string

InstrumentStatus is the tradable status of a stock or futures instrument.

const (
	// InstrumentStatusTradable means the instrument is available for trading
	// (OC).
	InstrumentStatusTradable InstrumentStatus = "OC"
	// InstrumentStatusLiquidateOnly means the instrument can only be sold, with
	// no purchases allowed (CO).
	InstrumentStatusLiquidateOnly InstrumentStatus = "CO"
	// InstrumentStatusNonTradable means the instrument cannot be traded (NT).
	InstrumentStatusNonTradable InstrumentStatus = "NT"
)

Instrument tradable status values.

type Logo struct {
	Symbol string `json:"symbol"`

	// The two fields below are declared by the page but not marked required, so they
	// were absent here and a response carrying them decoded the value to the zero
	// value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent.
	//
	// The page's LogoURL is this type's Logo, so both are carried and a response
	// populates whichever it sends. Category is the instrument's market.
	//
	// Display Solution requires a paid subscription, so no field here is
	// live-verified.
	Category string `json:"category"`
	LogoURL  string `json:"logo_url"`
}

Logo URLs returned by the batch logo endpoint. URLs are hosted on Webull's CDN.

type LogoQuery

type LogoQuery struct {
	Symbols []string
}

LogoQuery parameterizes Client.GetLogos.

type MarketSector

type MarketSector struct {
	SectorName  string          `json:"sector_name"`
	ChangeRatio string          `json:"change_ratio"`
	Volume      string          `json:"volume"`
	MarketValue string          `json:"market_value"`
	Stocks      []ScreenerStock `json:"stocks"`
}

MarketSector represents a market sector overview.

type MarketSectorDetailQuery

type MarketSectorDetailQuery struct {
	// SectorName is the sector to query. Required.
	SectorName string
	// Category is the security market. Required.
	Category StockCategory
	// SortBy is the secondary sort field. Empty uses the server default.
	SortBy ScreenerSortBy
	// Direction is the sort direction. Empty uses the server default.
	Direction SortDirection
	// PaginationKey is the opaque cursor from the previous page's
	// [types.Page.PaginationKey]. Empty starts at the first page; pass the returned
	// key unmodified to get the next one.
	PaginationKey string
}

MarketSectorDetailQuery parameterizes Client.GetMarketSectorDetail.

type MilestonePage

type MilestonePage struct {
	Data          []map[string]any `json:"data"`
	PaginationKey string           `json:"pagination_key"`
}

MilestonePage is a paginated list of milestones.

type MilestoneQuery

type MilestoneQuery struct {
	MinimumStartDate   string
	Category           string
	Competition        string
	RelatedEventSymbol string
	PaginationKey      string
}

MilestoneQuery parameterizes Client.GetEventContractMilestones.

type MostActiveQuery

type MostActiveQuery struct {
	// Category is the security market. Required, and only [StockCategoryUS]
	// is supported.
	Category StockCategory
	// RankType is the activity metric used to rank the result. Empty uses the
	// server default of [MostActiveRankVolume].
	RankType MostActiveRankType
	// SortBy is the secondary sort field. Empty uses the server default of
	// [ScreenerSortVolume].
	SortBy ScreenerSortBy
	// Direction is the sort direction. Empty uses the server default.
	Direction SortDirection
	// PaginationKey is the opaque cursor from the previous page's
	// [types.Page.PaginationKey]. Empty starts at the first page; pass the returned
	// key unmodified to get the next one.
	PaginationKey string
}

MostActiveQuery parameterizes Client.GetMostActive. Category is required; the remaining fields default on the server.

type MostActiveRankType

type MostActiveRankType string

MostActiveRankType is the activity metric used to rank the most active stocks.

const (
	// MostActiveRankVolume ranks by cumulative volume.
	MostActiveRankVolume MostActiveRankType = "VOLUME"
	// MostActiveRankRelativeVolume10D ranks by relative volume against the
	// ten-day average.
	MostActiveRankRelativeVolume10D MostActiveRankType = "RELATIVE_VOLUME_10D"
	// MostActiveRankTurnover ranks by cumulative turnover.
	MostActiveRankTurnover MostActiveRankType = "TURNOVER"
	// MostActiveRankTurnoverRate ranks by turnover rate.
	MostActiveRankTurnoverRate MostActiveRankType = "TURNOVER_RATE"
	// MostActiveRankAmplitude ranks by price amplitude.
	MostActiveRankAmplitude MostActiveRankType = "AMPLITUDE"
)

Most-active ranking metrics.

type NOIIActionType

type NOIIActionType string

NOIIActionType selects which auction imbalance a NOII request describes.

const (
	// NOIIActionPreOpen is the opening auction imbalance.
	NOIIActionPreOpen NOIIActionType = "PRE_OPEN"
	// NOIIActionPreClose is the closing auction imbalance.
	NOIIActionPreClose NOIIActionType = "PRE_CLOSE"
)

NOII auction types.

type NOIIBar

type NOIIBar struct {
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the security symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// ImbalanceTime is the data publish time, in milliseconds since the Unix
	// epoch.
	ImbalanceTime int64 `json:"imbalance_time"`
	// ImbalanceRefPrice is the reference price, as a decimal string.
	ImbalanceRefPrice money.Money `json:"imbalance_ref_price"`
	// ImbalanceNearPrice is the indicative match price (the most likely
	// execution price), as a decimal string.
	ImbalanceNearPrice money.Money `json:"imbalance_near_price"`
	// ImbalanceFarPrice is the far price (the price at which orders could
	// execute in extreme scenarios), as a decimal string.
	ImbalanceFarPrice money.Money `json:"imbalance_far_price"`
	// ImbalanceActionType is the auction the bar belongs to.
	ImbalanceActionType NOIIActionType `json:"imbalance_action_type"`
}

NOIIBar is a single Net Order Imbalance Indicator bar.

type NOIIQuery

type NOIIQuery struct {
	// Symbol is the security symbol. Only a single symbol is supported.
	Symbol string
	// Category is the security type. Only [StockCategoryUS] is supported.
	Category StockCategory
	// ImbalanceActionType selects the opening or closing auction.
	ImbalanceActionType NOIIActionType
}

NOIIQuery parameterizes Client.GetNOIIBars and Client.GetNOIISnapshot. Every field is required.

type NOIISnapshot

type NOIISnapshot struct {
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the security symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// PairedShares is the number of shares that can be matched under current
	// conditions, as a decimal string.
	PairedShares string `json:"paired_shares"`
	// ImbalanceShares is the number of unmatched buy or sell shares, as a
	// decimal string.
	ImbalanceShares string `json:"imbalance_shares"`
	// ImbalanceSide is the direction of the imbalance.
	ImbalanceSide string `json:"imbalance_side"`
	// ImbalanceRefPrice is the reference price, as a decimal string.
	ImbalanceRefPrice money.Money `json:"imbalance_ref_price"`
	// ImbalanceNearPrice is the indicative match price (the most likely
	// execution price), as a decimal string.
	ImbalanceNearPrice money.Money `json:"imbalance_near_price"`
	// ImbalanceFarPrice is the far price (the price at which orders could
	// execute in extreme scenarios), as a decimal string.
	ImbalanceFarPrice money.Money `json:"imbalance_far_price"`
	// ImbalanceActionType is the auction the snapshot describes.
	ImbalanceActionType NOIIActionType `json:"imbalance_action_type"`
	// ImbalanceTime is the snapshot timestamp, in milliseconds since the Unix
	// epoch.
	ImbalanceTime int64 `json:"imbalance_time"`
	// ImbalanceVarIndicator is the volatility/imbalance status indicator.
	ImbalanceVarIndicator string `json:"imbalance_var_indicator"`
}

NOIISnapshot is the latest Net Order Imbalance Indicator snapshot.

type NewsCategorySymbols

type NewsCategorySymbols struct {
	// Category is the security type. Only [StockCategoryUS] is currently
	// accepted.
	Category StockCategory `json:"category"`
	// Symbols lists the security symbols, for example ["AAPL", "GOOG"].
	Symbols []string `json:"symbols"`
}

NewsCategorySymbols groups the security symbols of one category in a news summary request.

type NewsSummaryEvent

type NewsSummaryEvent struct {
	// Type is the event kind: "meta", "text", or "table".
	Type string `json:"type"`
	// Message is the Markdown text of a "text" event.
	Message string `json:"message,omitempty"`
	// Args is the raw JSON metadata of a "meta" event, for example
	// {"sessionId":"1","convId":451107711450219}. It is left undecoded so
	// callers can read the fields they need.
	Args json.RawMessage `json:"args,omitempty"`
	// Headers is the column headers of a "table" event.
	Headers []NewsSummaryText `json:"headers,omitempty"`
	// Rows is the row data of a "table" event.
	Rows [][]NewsSummaryText `json:"rows,omitempty"`
}

NewsSummaryEvent is one event in the news-summary SSE stream.

The stream emits a single "meta" event that carries the conversation identifiers in RawArgs, followed by any number of "text" events (Markdown in Message) and "table" events (Headers and Rows). Unknown event types are returned with only Type populated so callers can ignore or log them.

type NewsSummaryParam

type NewsSummaryParam struct {
	// CategorySymbols lists the security symbols to summarize, grouped by
	// category. Required.
	CategorySymbols []NewsCategorySymbols `json:"category_symbols"`
	// Lang is the response language. Only "en" is currently supported; empty
	// means the server default.
	Lang string `json:"lang,omitempty"`
}

NewsSummaryParam parameterizes Client.GetNewsSummary. CategorySymbols is required.

type NewsSummaryStream

type NewsSummaryStream struct {
	// contains filtered or unexported fields
}

NewsSummaryStream reads a news-summary SSE response. Call [Next] until it returns io.EOF, then [Close]. A stream is NOT safe for concurrent use.

func (*NewsSummaryStream) Close

func (s *NewsSummaryStream) Close() error

Close releases the underlying HTTP response body. It is safe to call more than once.

func (*NewsSummaryStream) Next

Next returns the next news-summary event, or io.EOF when the stream ends. SSE comment lines and field lines other than "data" are skipped.

type NewsSummaryText

type NewsSummaryText struct {
	// Text is the cell text, which may contain Markdown.
	Text string `json:"text"`
}

NewsSummaryText is a single cell of a news-summary table event.

type OptionBar

type OptionBar struct {
	// Time is the bar time in ISO 8601 form.
	Time string `json:"time"`
	// Open is the open price, as a decimal string.
	Open money.Money `json:"open"`
	// Close is the close price, as a decimal string.
	Close money.Money `json:"close"`
	// High is the high price, as a decimal string.
	High money.Money `json:"high"`
	// Low is the low price, as a decimal string.
	Low money.Money `json:"low"`
	// Volume is the bar volume, as a string.
	Volume string `json:"volume"`
}

OptionBar is a single historical option price bar.

type OptionBarTimespan

type OptionBarTimespan string

OptionBarTimespan is the time granularity of option historical bars.

const (
	// OptionBarTimespanM1 is a one-minute bar.
	OptionBarTimespanM1 OptionBarTimespan = "M1"
	// OptionBarTimespanM5 is a five-minute bar.
	OptionBarTimespanM5 OptionBarTimespan = "M5"
	// OptionBarTimespanM15 is a fifteen-minute bar.
	OptionBarTimespanM15 OptionBarTimespan = "M15"
	// OptionBarTimespanM30 is a thirty-minute bar.
	OptionBarTimespanM30 OptionBarTimespan = "M30"
	// OptionBarTimespanM60 is a sixty-minute bar.
	OptionBarTimespanM60 OptionBarTimespan = "M60"
	// OptionBarTimespanM120 is a two-hour bar.
	OptionBarTimespanM120 OptionBarTimespan = "M120"
	// OptionBarTimespanM240 is a four-hour bar.
	OptionBarTimespanM240 OptionBarTimespan = "M240"
	// OptionBarTimespanD is a daily bar.
	OptionBarTimespanD OptionBarTimespan = "D"
	// OptionBarTimespanW is a weekly bar.
	OptionBarTimespanW OptionBarTimespan = "W"
	// OptionBarTimespanM is a monthly bar.
	OptionBarTimespanM OptionBarTimespan = "M"
	// OptionBarTimespanY is a yearly bar.
	OptionBarTimespanY OptionBarTimespan = "Y"
)

Option bar timespans.

type OptionBarsQuery

type OptionBarsQuery struct {
	// Symbols is the option contract symbols to query, at most 20 per query.
	// Required.
	Symbols []string
	// Category is the option market. Empty means [OptionCategoryUS].
	Category OptionCategory
	// Timespan is the bar granularity. Required.
	Timespan OptionBarTimespan
	// Count is the number of bars to return, at most 1200. Zero means unset.
	Count int
	// RealTimeRequired, when true, asks the server to include the latest
	// in-progress bar.
	RealTimeRequired bool
}

OptionBarsQuery parameterizes Client.GetOptionBars. Symbols, Category, and Timespan are required; Count defaults to the server's value when zero.

type OptionCategory

type OptionCategory string

OptionCategory identifies the option market. The option endpoints currently support US options only.

const (
	// OptionCategoryUS identifies United States options, the only category
	// currently supported by the option endpoints.
	OptionCategoryUS OptionCategory = "US_OPTION"
	// OptionCategoryHK identifies Hong Kong options.
	OptionCategoryHK OptionCategory = "HK"
	// OptionCategoryCN identifies China options.
	OptionCategoryCN OptionCategory = "CN"
)

Option market categories.

type OptionContract

type OptionContract struct {
	// InstrumentID is the unique identifier of the option contract.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the option contract symbol, for example
	// "AAPL260116C00300000".
	Symbol string `json:"symbol"`
	// UnderlyingSymbol is the symbol of the underlying stock, for example
	// "AAPL".
	UnderlyingSymbol string `json:"underlying_symbol"`
	// OptionType is the contract direction, a call or a put.
	OptionType OptionType `json:"option_type"`
	// StrikePrice is the strike price, as a decimal string.
	StrikePrice string `json:"strike_price"`
	// ExpirationDate is the contract expiration date as returned by the API.
	ExpirationDate string `json:"expiration_date"`
	// ExchangeCode is the listing exchange code, for example "OPRA".
	ExchangeCode string `json:"exchange_code"`
	// Category is the option market.
	Category OptionCategory `json:"category"`
	// Currency is the trading currency, for example "USD".
	Currency string `json:"currency"`
	// LotSize is the contract size, as a decimal string.
	LotSize string `json:"lot_size"`
}

OptionContract is the profile of a single option contract.

type OptionContractsQuery

type OptionContractsQuery struct {
	// Symbol is the underlying stock symbol, for example "AAPL". Required.
	Symbol string
	// Category is the option market. Empty means [OptionCategoryUS].
	Category OptionCategory
	// Expiration restricts the result to one expiration date. Empty means
	// all expirations.
	Expiration string
	// OptionType restricts the result to calls or puts. Empty means both.
	OptionType OptionType
	// StrikeMin is the inclusive lower bound of the strike range, as a
	// decimal string. Empty means unset.
	StrikeMin string
	// StrikeMax is the inclusive upper bound of the strike range, as a
	// decimal string. Empty means unset.
	StrikeMax string
	// PaginationKey continues from a previous page. Empty means unset.
	PaginationKey string
}

OptionContractsQuery parameterizes Client.GetOptionContracts. Symbol is required; every other field narrows the result set and is optional.

type OptionContractsResult

type OptionContractsResult struct {
	// Contracts lists the option contracts matching the query.
	Contracts []OptionContract
	// PaginationKey continues from a previous page; empty when there are no
	// more pages.
	PaginationKey string
}

OptionContractsResult is the result of Client.GetOptionContracts.

type OptionSnapshot

type OptionSnapshot struct {
	// InstrumentID is the unique identifier of the option contract.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the option contract symbol.
	Symbol string `json:"symbol"`
	// Price is the last traded price, as a decimal string.
	Price money.Money `json:"price"`
	// Open is the session open price, as a decimal string.
	Open money.Money `json:"open"`
	// High is the session high price, as a decimal string.
	High money.Money `json:"high"`
	// Low is the session low price, as a decimal string.
	Low money.Money `json:"low"`
	// PreClose is the previous settlement or close price, as a decimal string.
	PreClose money.Money `json:"pre_close"`
	// Volume is the accumulated session volume, as a String.
	Volume string `json:"volume"`
	// Change is the absolute change from PreClose, as a decimal string.
	Change money.Money `json:"change"`
	// ChangeRatio is the change relative to PreClose, as a decimal string.
	ChangeRatio string `json:"change_ratio"`
	// LastTradeTime is the last trade time as a Unix epoch millisecond
	// timestamp.
	LastTradeTime int64 `json:"last_trade_time"`
	// Close is the close price, as a decimal string.
	Close money.Money `json:"close"`
	// StrikePrice is the option strike price, as a decimal string.
	StrikePrice money.Money `json:"strike_price"`
	// Gamma is the option gamma, as a decimal string.
	Gamma string `json:"gamma"`
	// Delta is the option delta, as a decimal string.
	Delta string `json:"delta"`
	// Rho is the option rho, as a decimal string.
	Rho string `json:"rho"`
	// Theta is the option theta, as a decimal string.
	Theta string `json:"theta"`
	// Vega is the option vega, as a decimal string.
	Vega string `json:"vega"`
	// ImpVol is the implied volatility, as a decimal string.
	ImpVol string `json:"imp_vol"`
	// OpenInterest is the open interest, as a string.
	OpenInterest string `json:"open_interest"`
	// QuoteTime is the quote time as a Unix epoch millisecond timestamp.
	QuoteTime int64 `json:"quote_time"`
	// Bid is the best bid price, as a decimal string.
	Bid money.Money `json:"bid"`
	// Ask is the best ask price, as a decimal string.
	Ask money.Money `json:"ask"`
	// AskSize is the quantity available at the best ask, as a string.
	AskSize string `json:"ask_size"`
	// BidSize is the quantity available at the best bid, as a string.
	BidSize string `json:"bid_size"`
	// DealAmount is the accumulated traded value, as a decimal string.
	DealAmount money.Money `json:"deal_amount"`
}

OptionSnapshot is the real-time market snapshot of one option contract.

type OptionSnapshotQuery

type OptionSnapshotQuery struct {
	// Symbols is the option contract symbols to query. Required.
	Symbols []string
	// Category is the option market. Empty means [OptionCategoryUS].
	Category OptionCategory
}

OptionSnapshotQuery parameterizes Client.GetOptionSnapshot. Symbols is required and is limited to 20 symbols per query; Category defaults to OptionCategoryUS.

type OptionSymbolBars

type OptionSymbolBars struct {
	// Symbol is the option contract symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the option contract.
	InstrumentID string `json:"instrument_id"`
	// Result lists the historical bars.
	Result []OptionBar `json:"result"`
}

OptionSymbolBars is the historical bars of one option contract.

type OptionTick

type OptionTick struct {
	// Time is the trade time as a Unix epoch millisecond timestamp string.
	Time string `json:"time"`
	// Price is the executed trade price, as a decimal string.
	Price money.Money `json:"price"`
	// Volume is the executed trade volume, as a string.
	Volume string `json:"volume"`
	// Side is the aggressor side, for example "B" or "S".
	Side string `json:"side"`
}

OptionTick is a single executed option trade.

type OptionTickQuery

type OptionTickQuery struct {
	// Symbol is the option contract symbol, for example
	// "AAPL260522C00300000". Required.
	Symbol string
	// Category is the option market. Empty means [OptionCategoryUS].
	Category OptionCategory
	// Count is the number of ticks to return, at most 1200. Zero means unset.
	Count int
}

OptionTickQuery parameterizes Client.GetOptionTick. Symbol is required; Category defaults to OptionCategoryUS and Count defaults to the server's value when zero.

type OptionTickResult

type OptionTickResult struct {
	// Symbol is the option contract symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the option contract.
	InstrumentID string `json:"instrument_id"`
	// Result lists the trade ticks.
	Result []OptionTick `json:"result"`
}

OptionTickResult is the tick history of one option contract.

type OptionType

type OptionType string

OptionType is the contract direction of an option, a call or a put.

const (
	// OptionTypeCall identifies a call option contract.
	OptionTypeCall OptionType = "CALL"
	// OptionTypePut identifies a put option contract.
	OptionTypePut OptionType = "PUT"
)

Option contract types.

type Quote

type Quote struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// QuoteTime is the quote time, as a Unix timestamp in milliseconds. It is a
	// [QuoteTime] rather than an int64 because Webull's own pages publish this
	// property both ways: the stock and Display Solution depth pages show a quoted
	// string and the futures and event-contract depth pages show a bare number. An
	// int64 field decoded the two pages that showed a number and failed the other
	// two with an error that abandoned the whole response.
	QuoteTime QuoteTime `json:"quote_time"`
	// Asks is the ask side of the book, best (lowest) price first.
	Asks []QuoteLevel `json:"asks"`
	// Bids is the bid side of the book, best (highest) price first.
	Bids []QuoteLevel `json:"bids"`
}

Quote is the order-book depth for a single security.

type QuoteBroker

type QuoteBroker struct {
	// Bid is the broker identifier.
	Bid string `json:"bid"`
	// Name is the broker display name.
	Name string `json:"name"`
}

QuoteBroker is a broker attribution for a price level.

type QuoteLevel

type QuoteLevel struct {
	// Price is the level price, as a decimal string.
	Price money.Money `json:"price"`
	// Size is the aggregate quantity at the level, as a decimal string.
	Size string `json:"size"`
	// Order lists the contributing market-participant orders.
	Order []QuoteOrder `json:"order"`
	// Broker lists the contributing brokers, when supplied.
	Broker []QuoteBroker `json:"broker"`
}

QuoteLevel is one side of the order book at a single price.

type QuoteOrder

type QuoteOrder struct {
	// MPID is the market participant identifier, for example "NSDQ".
	MPID string `json:"mpid"`
	// Size is the quantity contributed by the participant, as a decimal string.
	Size string `json:"size"`
}

QuoteOrder is a single market-participant order contributing to a price level.

type QuoteTime

type QuoteTime int64

QuoteTime is a Unix epoch millisecond timestamp that decodes from either of the two JSON representations Webull publishes for the same field.

Four documented pages carry a `quote_time` property, and Webull's own published examples disagree about its type: the stock depth and Display Solution depth pages show a quoted string ("1640688000000") while the futures and event-contract depth pages show a bare number (1761131409276). An int64 field therefore decodes two of them and fails the other two with an error that abandons the whole response, and the SDK cannot know which a live server will send.

This type is the resolution that needs no probe: it reads both, so it is correct whichever the server does. A second field carrying the same name is not an alternative - two fields claiming one json tag is the defect described in conformance/tags.go, where encoding/json drops both.

The zero value is the Unix epoch, matching the int64 this replaces. A field the server omits or sends as null decodes to it without an error, which is what an absent optional timestamp should do.

func (QuoteTime) Int64

func (q QuoteTime) Int64() int64

Int64 returns the timestamp in Unix milliseconds, for a caller that needs the underlying value.

func (QuoteTime) MarshalJSON

func (q QuoteTime) MarshalJSON() ([]byte, error)

MarshalJSON writes the number, not the string.

No endpoint in this SDK sends a Quote back to Webull, so nothing here is constrained by the wire format; the number is chosen because it is what the field held before this type existed, so a caller that round-trips a decoded value through encoding/json sees no change.

func (QuoteTime) String

func (q QuoteTime) String() string

String renders the timestamp in Unix milliseconds, matching how it arrives.

func (QuoteTime) Time

func (q QuoteTime) Time() time.Time

Time returns the timestamp as a UTC time. The zero QuoteTime is the Unix epoch.

func (*QuoteTime) UnmarshalJSON

func (q *QuoteTime) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a quoted decimal, a bare number, null, and an empty string.

It is written the way money.Money.UnmarshalJSON is: ask for a string, and if that fails ask for a number. That is simpler than walking the bytes and handles escapes correctly, and the float fallback covers a server sending 1.761131409276e12 for the same instant.

type ScreenerSortBy

type ScreenerSortBy string

ScreenerSortBy is the secondary sort field shared by the screener endpoints.

const (
	// ScreenerSortChangeRatio sorts by price change percentage.
	ScreenerSortChangeRatio ScreenerSortBy = "CHANGE_RATIO"
	// ScreenerSortRelativeVolume10D sorts by relative ten-day volume.
	ScreenerSortRelativeVolume10D ScreenerSortBy = "RELATIVE_VOLUME_10D"
	// ScreenerSortMarketValue sorts by market capitalization.
	ScreenerSortMarketValue ScreenerSortBy = "MARKET_VALUE"
	// ScreenerSortClose sorts by the latest close.
	ScreenerSortClose ScreenerSortBy = "CLOSE"
	// ScreenerSortPrice sorts by the latest price.
	ScreenerSortPrice ScreenerSortBy = "PRICE"
	// ScreenerSortPETTM sorts by trailing-twelve-month price/earnings.
	ScreenerSortPETTM ScreenerSortBy = "PE_TTM"
	// ScreenerSortHigh sorts by the intraday high.
	ScreenerSortHigh ScreenerSortBy = "HIGH"
	// ScreenerSortLow sorts by the intraday low.
	ScreenerSortLow ScreenerSortBy = "LOW"
	// ScreenerSortAmplitude sorts by price amplitude.
	ScreenerSortAmplitude ScreenerSortBy = "AMPLITUDE"
	// ScreenerSortTurnover sorts by turnover.
	ScreenerSortTurnover ScreenerSortBy = "TURNOVER"
	// ScreenerSortVolume sorts by volume.
	ScreenerSortVolume ScreenerSortBy = "VOLUME"
)

Screener sort fields.

type ScreenerStock

type ScreenerStock struct {
	// InstrumentID is the unique identifier of the tradable instrument.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the trading symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// Name is the full name of the instrument.
	Name string `json:"name"`
	// ExchangeCode is the standardized exchange code, for example "NSQ".
	ExchangeCode string `json:"exchange_code"`
	// CurrencyCode is the denomination currency (ISO 4217), for example "USD".
	CurrencyCode string `json:"currency_code"`
	// PreClose is the previous trading day's closing price.
	PreClose money.Money `json:"pre_close"`
	// Open is the opening price for the current trading day.
	Open money.Money `json:"open"`
	// High is the intraday high for the current trading day.
	High money.Money `json:"high"`
	// Low is the intraday low for the current trading day.
	Low money.Money `json:"low"`
	// Close is the latest traded price for the current trading day.
	Close money.Money `json:"close"`
	// Price is the most recent quoted price within the selected time interval.
	Price money.Money `json:"price"`
	// Change is the absolute price change within the selected time interval.
	Change money.Money `json:"change"`
	// ChangeRatio is the price change percentage within the selected time
	// interval, as a decimal ratio.
	ChangeRatio string `json:"change_ratio"`
	// Volume is the cumulative traded volume for the current day.
	Volume string `json:"volume"`
	// Turnover is the cumulative turnover amount in the denomination currency.
	Turnover money.Money `json:"turnover"`
	// TurnoverRate is the turnover rate as a decimal ratio.
	TurnoverRate string `json:"turnover_rate"`
	// MarketValue is the total market capitalization in the denomination
	// currency.
	MarketValue money.Money `json:"market_value"`
	// Amplitude is (high-low)/pre_close as a decimal ratio.
	Amplitude string `json:"amplitude"`
	// RelativeVolume10D is the current-day volume divided by the ten-day
	// average volume.
	RelativeVolume10D string `json:"relative_volume_10d"`

	// The fields below are declared by the three screener pages that resolve to this
	// type but not marked required, so they were absent here and a response carrying
	// them decoded the value to the zero value with no error reported. That is weaker
	// evidence than a missing-required-name row: those pages publish no required
	// list, so a name may be optional or conditionally sent, and nothing here asserts
	// that a live server sends it. Not live-verified: the HK sandbox market data is
	// limited to AAPL and the screener v2 surface is not reachable there.
	//
	// The 52-week page's ChangeRatio52W, Price1W and Price52W are this type's own
	// ChangeRatio, Price and High over a different window, and the dividend page's
	// Dividend, ExDate and Yield have no counterpart above. The sector-detail page's
	// counts are string-typed on the page even though they are counts, and are carried
	// as string to match. This type already carries InstrumentID, which the
	// sector-detail page spells Id.
	Category       string      `json:"category"`
	Currency       string      `json:"currency"`
	ChangeRatio52W string      `json:"change_ratio_52w"`
	Price1W        money.Money `json:"price_1w"`
	Price52W       money.Money `json:"price_52w"`
	Dividend       money.Money `json:"dividend"`
	ExDate         string      `json:"ex_date"`
	Yield          string      `json:"yield"`
	PETTM          string      `json:"pe_ttm"`
	ID             string      `json:"id"`
	Advanced       string      `json:"advanced"`
	Declined       string      `json:"declined"`
	Flat           string      `json:"flat"`
}

ScreenerStock is a single stock row returned by the screener endpoints. Not every field is populated by every endpoint; for example RelativeVolume10D is only reported by the most-active endpoint.

type Snapshot

type Snapshot struct {
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// PreClose is the previous close price, as a decimal string.
	PreClose money.Money `json:"pre_close"`
	// ChangeRatio is the price change ratio, as a decimal string.
	ChangeRatio string `json:"change_ratio"`
	// Symbol is the trading symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// LastTradeTime is the last trade time, as a Unix timestamp in
	// milliseconds.
	LastTradeTime int64 `json:"last_trade_time"`
	// Price is the current price, as a decimal string.
	Price money.Money `json:"price"`
	// Open is the intraday open price, as a decimal string. For US stocks this
	// excludes pre/post-market data and is unset when no trading occurred.
	Open money.Money `json:"open"`
	// Close is the intraday close price, as a decimal string.
	Close money.Money `json:"close"`
	// High is the intraday high price, as a decimal string.
	High money.Money `json:"high"`
	// Low is the intraday low price, as a decimal string.
	Low money.Money `json:"low"`
	// Volume is the traded volume, as a decimal string.
	Volume string `json:"volume"`
	// Change is the price change amount, as a decimal string.
	Change money.Money `json:"change"`
	// Ask is the best ask price, as a decimal string.
	Ask money.Money `json:"ask"`
	// AskSize is the best ask size, as a decimal string.
	AskSize string `json:"ask_size"`
	// Bid is the best bid price, as a decimal string.
	Bid money.Money `json:"bid"`
	// BidSize is the best bid size, as a decimal string.
	BidSize string `json:"bid_size"`
	// Turnover is the turnover rate, as a decimal string.
	Turnover money.Money `json:"turnover"`
	// EPS is the earnings per share, as a decimal string.
	EPS money.Money `json:"eps"`
	// EPSTTM is the trailing-twelve-month earnings per share, as a decimal
	// string.
	EPSTTM money.Money `json:"eps_ttm"`
	// LotSize is the number of shares per lot, as a decimal string.
	LotSize string `json:"lot_size"`
	// BPS is the book value per share, as a decimal string.
	BPS money.Money `json:"bps"`
	// ExtendHourLastPrice is the pre/post-market latest price, as a decimal
	// string.
	ExtendHourLastPrice money.Money `json:"extend_hour_last_price"`
	// ExtendHourHigh is the pre/post-market high price, as a decimal string.
	ExtendHourHigh money.Money `json:"extend_hour_high"`
	// ExtendHourLow is the pre/post-market low price, as a decimal string.
	ExtendHourLow money.Money `json:"extend_hour_low"`
	// ExtendHourChange is the pre/post-market change amount, as a decimal
	// string.
	ExtendHourChange money.Money `json:"extend_hour_change"`
	// ExtendHourChangeRatio is the pre/post-market change ratio, as a decimal
	// string.
	ExtendHourChangeRatio string `json:"extend_hour_change_ratio"`
	// ExtendHourVolume is the pre/post-market volume, as a decimal string.
	ExtendHourVolume string `json:"extend_hour_volume"`
	// ExtendHourLastTradeTime is the pre/post-market last trade time, as a Unix
	// timestamp in milliseconds.
	ExtendHourLastTradeTime int64 `json:"extend_hour_last_trade_time"`
	// OvnPrice is the overnight price, as a decimal string.
	OvnPrice money.Money `json:"ovn_price"`
	// OvnHigh is the overnight high price, as a decimal string.
	OvnHigh money.Money `json:"ovn_high"`
	// OvnLow is the overnight low price, as a decimal string.
	OvnLow money.Money `json:"ovn_low"`
	// OvnVolume is the overnight volume, as a decimal string.
	OvnVolume string `json:"ovn_volume"`
	// OvnChange is the overnight change amount, as a decimal string.
	OvnChange money.Money `json:"ovn_change"`
	// OvnChangeRatio is the overnight change ratio, as a decimal string.
	OvnChangeRatio string `json:"ovn_change_ratio"`
	// OvnLastTradeTime is the overnight last trade time, as a Unix timestamp in
	// milliseconds.
	OvnLastTradeTime int64 `json:"ovn_last_trade_time"`
	// OvnAsk is the overnight best ask price, as a decimal string.
	OvnAsk money.Money `json:"ovn_ask"`
	// OvnAskSize is the overnight best ask size, as a decimal string.
	OvnAskSize string `json:"ovn_ask_size"`
	// OvnBid is the overnight best bid price, as a decimal string.
	OvnBid money.Money `json:"ovn_bid"`
	// OvnBidSize is the overnight best bid size, as a decimal string.
	OvnBidSize string `json:"ovn_bid_size"`
}

Snapshot is a real-time market snapshot for a single security.

type SnapshotQuery

type SnapshotQuery struct {
	// Symbols is the list of security symbols to query, at most 100.
	Symbols []string
	// Category is the market to query. Required. Besides the
	// [StockCategoryUS], [StockCategoryHK] and [StockCategoryCN] values it
	// accepts the snapshot-specific StockCategory("US_ETF").
	Category StockCategory
	// ExtendHourRequired includes pre-market and after-hours trading data when
	// true.
	ExtendHourRequired bool
	// OvernightRequired includes overnight trading data when true.
	OvernightRequired bool
}

SnapshotQuery parameterizes Client.GetSnapshot. Symbols and Category are required; the remaining fields are optional.

type SortDirection

type SortDirection string

SortDirection is the direction of a screener sort.

const (
	// SortDirectionAsc sorts ascending.
	SortDirectionAsc SortDirection = "ASC"
	// SortDirectionDesc sorts descending.
	SortDirectionDesc SortDirection = "DESC"
)

Sort directions.

type SpecialExchangeTimes

type SpecialExchangeTimes struct {
	// Start is the special session start as a Unix epoch millisecond timestamp. The
	// page documents no unit and its example is 0, so the value is passed through
	// unchanged rather than interpreted.
	Start int64 `json:"start"`
	// End is the special session end, in the same form as [SpecialExchangeTimes.Start].
	End int64 `json:"end"`
	// TradingSession names the session, for example "RTH" or "PRE".
	TradingSession string `json:"trading_session"`
}

SpecialExchangeTimes is one entry of a response's special trading hours.

The page documents start and end as int64 here while the ordinary ExchangeTimes documents them as strings, so the numeric form is a separate type rather than a widened field on the same one.

type StockBars

type StockBars struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// Result is the list of bars.
	Result []Bar `json:"result"`

	// The two fields below are required by the Display Solution bars page and were
	// absent here, so the exchange hours a response was computed against decoded to
	// the zero value with no error reported. They are the display host's trading
	// calendar, not the market-wide one, which is why a caller reading a bar cannot
	// otherwise tell why a session is absent from the result.
	//
	// Display Solution requires a paid subscription, so no field here is
	// live-verified.
	Times        []ExchangeTimes        `json:"times"`
	SpecialTimes []SpecialExchangeTimes `json:"special_times"`
}

StockBars is the historical-bars response for a single symbol.

type StockCategory

type StockCategory string

StockCategory identifies the market of a stock instrument.

const (
	// StockCategoryUS identifies United States stocks.
	StockCategoryUS StockCategory = "US_STOCK"
	// StockCategoryHK identifies Hong Kong stocks.
	StockCategoryHK StockCategory = "HK_STOCK"
	// StockCategoryCN identifies mainland China stocks.
	StockCategoryCN StockCategory = "CN_STOCK"
)

Stock market categories accepted by the instrument-list endpoint.

type StockFootprint

type StockFootprint struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// Result is the ordered footprint bars.
	Result []FootprintBar `json:"result"`
}

StockFootprint is the footprint (order-flow) chart for a single symbol.

type StockInstrument

type StockInstrument struct {
	// Name is the display name, for example "APPLE INC".
	Name string `json:"name"`
	// InstrumentID is the unique identifier of the security.
	InstrumentID string `json:"instrument_id"`
	// ExchangeCode is the exchange code, for example "NSQ" (Nasdaq).
	ExchangeCode string `json:"exchange_code"`
	// Category is the instrument's market.
	Category StockCategory `json:"category"`
	// Symbol is the trading symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// Status is the tradable status.
	Status InstrumentStatus `json:"status"`
	// Shortable reports whether the instrument can be sold short.
	Shortable bool `json:"shortable"`
	// Fractionable reports whether fractional trading is supported.
	Fractionable bool `json:"fractionable"`
	//nolint:misspell // "marginable" is the Webull API field name, not a typo.
	// Marginable reports whether the instrument can be bought on margin.
	Marginable bool `json:"marginable"` //nolint:misspell
	// OvernightTradingSupported reports whether overnight trading is supported.
	OvernightTradingSupported bool `json:"overnight_trading_supported"`
	// MarginRequirementLong is the margin requirement ratio for a long
	// position, as a decimal string.
	MarginRequirementLong string `json:"margin_requirement_long"`

	// The two fields below are declared by the v3 profiles page but not marked
	// required, so they were absent here and a response carrying them decoded the
	// value to the zero value with no error reported. That is weaker evidence than a
	// missing-required-name row: the page publishes no required list for this call,
	// so a name may be optional or conditionally sent. The page documents IsADR as
	// a string spelling a boolean, so it is carried as string and a caller reads
	// "true" rather than true.
	//
	// Display Solution requires a paid subscription, so no field here is
	// live-verified.
	IsADR   string `json:"is_adr"`
	Subtype string `json:"subtype"`
	// MarginRequirementShort is the margin requirement ratio for a short
	// position, as a decimal string.
	MarginRequirementShort string `json:"margin_requirement_short"`
	// IntradayMarginLong is the intraday margin requirement ratio for a long
	// position, as a decimal string.
	IntradayMarginLong string `json:"intraday_margin_long"`
	// IntradayMarginShort is the intraday margin requirement ratio for a short
	// position, as a decimal string.
	IntradayMarginShort string `json:"intraday_margin_short"`
	// MaintenanceMarginLong is the maintenance margin ratio for a long
	// position, as a decimal string.
	MaintenanceMarginLong string `json:"maintenance_margin_long"`
	// MaintenanceMarginShort is the maintenance margin ratio for a short
	// position, as a decimal string.
	MaintenanceMarginShort string `json:"maintenance_margin_short"`
	// EasyToBorrow reports whether the instrument is easy to borrow.
	EasyToBorrow bool `json:"easy_to_borrow"`
	// LotSize is the minimum tradable quantity, as a decimal string.
	LotSize string `json:"lot_size"`
	// Currency is the trading currency, for example "USD".
	Currency string `json:"currency"`
	// SubCategory is the finer instrument classification.
	SubCategory StockSubCategory `json:"sub_category"`
}

StockInstrument is the profile of a single stock instrument.

type StockInstrumentQuery

type StockInstrumentQuery struct {
	// Category is the market to query. Required.
	Category StockCategory
	// Symbols restricts the result to the named symbols, at most 100 per query.
	// When empty the endpoint pages through all instruments in Category.
	Symbols []string
	// Status filters by tradable status.
	Status InstrumentStatus
	// SubCategory filters by sub-category. It is only effective when Symbols is
	// empty.
	SubCategory StockSubCategory
	// PaginationKey continues from a previous page. It is only used by
	// paginated endpoints.
	PaginationKey string
}

StockInstrumentQuery parameterizes Client.GetStockInstruments. Category is required; every other field is optional.

type StockProfilesV3Query

type StockProfilesV3Query struct {
	Symbols       []string
	Category      StockCategory
	SubCategory   StockSubCategory
	ExchangeCodes []string
	Status        InstrumentStatus
	PaginationKey string
}

StockProfilesV3Query parameterizes Client.GetStockProfilesV3.

type StockProfilesV3Result

type StockProfilesV3Result struct {
	Instruments   []StockInstrument
	PaginationKey string
}

StockProfilesV3Result is the result of Client.GetStockProfilesV3.

type StockSubCategory

type StockSubCategory string

StockSubCategory is a finer classification of a stock instrument. It is only effective when a symbol list is not supplied.

const (
	// StockSubCategoryCommonStock identifies common shares.
	StockSubCategoryCommonStock StockSubCategory = "COMMON_STOCK"
	// StockSubCategoryETF identifies exchange-traded funds.
	StockSubCategoryETF StockSubCategory = "ETF"
	// StockSubCategoryPreferredStock identifies preferred shares.
	StockSubCategoryPreferredStock StockSubCategory = "PREFERRED_STOCK"
	// StockSubCategoryWarrant identifies warrants.
	StockSubCategoryWarrant StockSubCategory = "WARRANT"
	// StockSubCategoryUnits identifies units.
	StockSubCategoryUnits StockSubCategory = "UNITS"
	// StockSubCategoryRight identifies rights.
	StockSubCategoryRight StockSubCategory = "RIGHT"
)

Stock sub-categories. All values are accepted for US stocks; Hong Kong and mainland China stocks support only StockSubCategoryCommonStock and StockSubCategoryETF.

type StockTicks

type StockTicks struct {
	// Symbol is the security symbol.
	Symbol string `json:"symbol"`
	// InstrumentID is the unique identifier of the security.
	//
	// Webull documents instrument_id and the futures sandbox sends
	// instrumentId, so decoding accepts both. The field name and the marshalled
	// member stay instrument_id: see UnmarshalJSON.
	InstrumentID string `json:"instrument_id"`
	// Result is the list of executed trades, newest first.
	Result []Tick `json:"result"`
}

StockTicks is the tick-by-tick response for a single security.

func (*StockTicks) UnmarshalJSON

func (t *StockTicks) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes InstrumentID from either instrument_id or instrumentId.

encoding/json matches a member name exactly and then case-insensitively, and an underscore is not a case, so a response sending instrumentId leaves the field at its zero value with no error: the caller reads "" and nothing says a value was missed. The two spellings are both real observations of the same identifier, so both are accepted.

Decoding goes through an alias so it does not recurse, and the camelCase member is read by a separate field rather than by walking the bytes, which leaves Tick and money.Money on the stdlib path and cannot change how they decode.

instrument_id wins when a body carries both, because that is the name the SDK documents and marshals. Marshaling is untouched: the struct tags are still what encoding/json writes, so the wire form a caller observes is unchanged.

type StringOrNumber

type StringOrNumber struct {
	Str string
}

StringOrNumber handles JSON values that may be either a string or a numeric type. The Webull API occasionally sends numeric values where a string is expected (for example, the futures instrument unit field).

func (StringOrNumber) String

func (s StringOrNumber) String() string

func (*StringOrNumber) UnmarshalJSON

func (s *StringOrNumber) UnmarshalJSON(data []byte) error

type SuccessResponse

type SuccessResponse struct {
	// Success reports whether the server applied the operation.
	Success bool `json:"success"`
}

SuccessResponse reports the outcome of a mutating watchlist operation.

type Tick

type Tick struct {
	// Time is the trade time, as a Unix timestamp in milliseconds encoded as a
	// string.
	Time string `json:"time"`
	// Price is the executed trade price, as a decimal string.
	Price money.Money `json:"price"`
	// Volume is the executed trade volume, as a decimal string.
	Volume string `json:"volume"`
	// Side is the aggressor side. Documented values include "B", "S", "G",
	// "L" and "N".
	Side string `json:"side"`
}

Tick is a single executed trade.

type TickQuery

type TickQuery struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string
	// Category is the market to query. Required.
	Category StockCategory
	// Count is the number of ticks to return. Zero means the server default
	// (30); the documented maximum is 1000.
	Count int
	// TradingSessions restricts the result to the given trading sessions.
	// When empty the server default applies.
	TradingSessions []TradingSession
}

TickQuery parameterizes Client.GetTick. Symbol and Category are required.

type TradingSession

type TradingSession string

TradingSession identifies a portion of the trading day. It is shared by the market-data endpoints that accept a trading_sessions parameter.

const (
	// TradingSessionPre is the pre-market session.
	TradingSessionPre TradingSession = "PRE"
	// TradingSessionRTH is the regular trading hours session.
	TradingSessionRTH TradingSession = "RTH"
	// TradingSessionAfter is the after-hours session.
	TradingSessionAfter TradingSession = "ATH"
	// TradingSessionOvernight is the overnight session.
	TradingSessionOvernight TradingSession = "OVN"
)

Trading sessions accepted by the market-data endpoints. The footprint endpoint does not accept TradingSessionOvernight.

type UpdateWatchlistParams

type UpdateWatchlistParams struct {
	// WatchlistID identifies the watchlist to update. Required.
	WatchlistID string `json:"watchlist_id"`
	// Name is the new watchlist name. Empty means unchanged.
	Name string `json:"name,omitempty"`
	// Sort is the new display ordering number. Zero means unchanged.
	Sort int32 `json:"sort,omitempty"`
}

UpdateWatchlistParams parameterizes Client.UpdateWatchlist. WatchlistID is required; a zero Sort or empty Name leaves the corresponding field unchanged.

type Watchlist

type Watchlist struct {
	// WatchlistID is the unique identifier of the watchlist, for example
	// "12345678".
	WatchlistID string `json:"watchlist_id"`
	// Name is the display name of the watchlist.
	Name string `json:"name"`
	// Sort is the display ordering number.
	Sort int32 `json:"sort"`
	// CreateTime is the watchlist creation time in ISO 8601 form.
	CreateTime string `json:"create_time"`
	// UpdateTime is the time of the last watchlist update in ISO 8601 form.
	UpdateTime string `json:"update_time"`
}

Watchlist is the metadata of one user watchlist.

type WatchlistInstrument

type WatchlistInstrument struct {
	// InstrumentID is the unique identifier of the instrument.
	InstrumentID string `json:"instrument_id"`
	// Symbol is the trading symbol, for example "AAPL" or "00700".
	Symbol string `json:"symbol"`
	// Name is the display name of the instrument.
	Name string `json:"name"`
	// ExchangeCode is the standardized exchange code, for example "NSQ".
	ExchangeCode string `json:"exchange_code"`
	// Sort is the sort order within the watchlist.
	Sort int32 `json:"sort"`
	// AddedTime is when the instrument was added, in ISO 8601 form.
	AddedTime string `json:"added_time"`
}

WatchlistInstrument is one instrument held in a watchlist.

type WatchlistInstrumentParam

type WatchlistInstrumentParam struct {
	// Symbol is the security symbol, for example "AAPL".
	Symbol string `json:"symbol"`
	// Category is the security category, for example
	// [StockCategoryUS]. Required.
	Category StockCategory `json:"category"`
	// Sort is the display ordering number. Zero means unset.
	Sort int32 `json:"sort,omitempty"`
}

WatchlistInstrumentParam identifies one instrument in a watchlist mutation request. Symbol and Category are required; Sort is only meaningful for Client.UpdateWatchlistInstruments.

type WatchlistInstruments

type WatchlistInstruments struct {
	// WatchlistID is the unique identifier of the watchlist.
	WatchlistID string `json:"watchlist_id"`
	// Instruments lists the instruments in the watchlist.
	Instruments []WatchlistInstrument `json:"instruments"`
}

WatchlistInstruments is a watchlist together with the instruments it holds.

type WatchlistInstrumentsParam

type WatchlistInstrumentsParam struct {
	// WatchlistID identifies the watchlist to mutate. Required.
	WatchlistID string `json:"watchlist_id"`
	// Instruments is the non-empty list of instruments to add, remove, or
	// reorder. Required.
	Instruments []WatchlistInstrumentParam `json:"instruments"`
}

WatchlistInstrumentsParam parameterizes the watchlist instrument mutation endpoints (Client.AddWatchlistInstruments, Client.RemoveWatchlistInstruments, and Client.UpdateWatchlistInstruments).

type Week52HighLowQuery

type Week52HighLowQuery struct {
	// Category is the security market. Required.
	Category StockCategory
	// SortBy is the secondary sort field. Empty uses the server default.
	SortBy ScreenerSortBy
	// Direction is the sort direction. Empty uses the server default.
	Direction SortDirection
}

Week52HighLowQuery parameterizes Client.GetWeek52HighLow.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL