Skip to main content

Module polygon

Module polygon 

Source
Expand description

Polygon.io financial data API (requires polygon feature). Polygon.io API client for financial data.

Requires the polygon feature flag and an API key from https://polygon.io/.

Call [init] once at startup before using any query functions.

§Quick Start

use finance_query::adapters::polygon;
use finance_query::adapters::polygon::Timespan;

polygon::init("YOUR_API_KEY")?;

// Stock aggregate bars
let bars = polygon::stock_aggregates("AAPL", 1, Timespan::Day, "2024-01-01", "2024-01-31", None).await?;

// Snapshot
let snap = polygon::stock_snapshot("AAPL").await?;

// Last trade
let trade = polygon::stock_last_trade("AAPL").await?;

Re-exports§

pub use models::*;

Modules§

aggregates
Stock aggregate bar endpoints: OHLCV bars, daily summary, previous close.
corporate_actions
Corporate action endpoints: dividends, splits, IPOs, ticker events.
filings
SEC filing endpoints: 10-K sections, 8-K text, EDGAR index, risk factors.
fundamentals
Stock fundamental data: balance sheets, cash flow, income statements, ratios, short interest, float.
models
Shared types for Polygon.io API responses.
news
Stock news endpoints with sentiment analysis.
snapshots
Stock snapshot endpoints: full market, single ticker, top movers.
technical_indicators
Stock technical indicator endpoints: SMA, EMA, MACD, RSI.
trades
Stock trade and quote endpoints: last trade, historical trades, last quote, historical quotes.
websocket
Polygon.io WebSocket streaming for real-time market data.

Structs§

AdditionalUnderlying
An additional underlying asset for a contract.
AnalystDetail
Analyst details.
AnalystInsight
Analyst insight.
AnalystRating
Analyst rating.
BullBear
Bull/bear summary.
Condition
Condition code.
ConsensusRating
Consensus rating.
ConversionLast
Currency conversion last price data.
CorporateEvent
Corporate event from Wall Street Horizon.
CorporateGuidance
Corporate guidance.
CryptoDailyOpenClose
Daily open/close response for a crypto pair.
CryptoLastTrade
Last trade data for a crypto pair.
CryptoLastTradeResponse
Response wrapper for crypto last trade.
CryptoOpenCloseTrade
A single trade within a crypto daily open/close response.
CurrencyConversion
Response for the currency conversion endpoint.
Dividend
Dividend event.
EarningsAnnouncement
Earnings announcement.
EconomicDataPoint
Economic data point.
EtfAnalytics
ETF analytics data.
EtfConstituent
ETF constituent/holding.
EtfFundFlow
ETF fund flow.
EtfProfileData
ETF profile.
EtfTaxonomy
ETF taxonomy.
Exchange
Exchange.
FilingEntry
SEC filing metadata.
FilingSection
SEC filing section content.
FilingSectionsResponse
Filing sections response.
FinancialRatios
Financial ratios.
FinancialResult
A financial statement row (balance sheet, income, or cash flow).
FirmDetail
Firm details.
FloatData
Float data.
ForexLastQuote
Last forex quote data.
ForexQuoteResponse
Response for the last forex quote endpoint.
FuturesContract
A futures contract from the reference endpoint.
FuturesProduct
A futures product from the reference endpoint.
FuturesSchedule
A futures schedule from the reference endpoint.
FuturesSession
Session data within a futures snapshot.
FuturesSnapshot
A single futures snapshot.
FuturesSnapshotResponse
Response wrapper for futures snapshots.
IndexSession
Session data within an index snapshot.
IndexSnapshot
A single index snapshot.
IndexSnapshotResponse
Response wrapper for index snapshots.
Insight
Sentiment insight.
Ipo
IPO event.
MarketHoliday
Market holiday.
MarketStatusResponse
Market status for exchanges.
MerchantAggregate
Merchant aggregate data (European consumer spending).
MerchantHierarchy
Merchant hierarchy entry (merchant-to-parent mapping).
NewsArticle
News article.
OptionsContract
An options contract from the Polygon reference API.
OptionsContractResponse
Response wrapper for a single options contract detail.
OptionsContractSnapshotResponse
Response wrapper for a single options contract snapshot.
OptionsGreeks
Greeks for an options contract snapshot.
OptionsSnapshot
A single options contract snapshot from the chain or individual lookup.
OptionsSnapshotDetails
Contract details within an options snapshot.
OptionsSnapshotQuote
Last quote data within an options snapshot.
OptionsSnapshotTrade
Last trade data within an options snapshot.
OptionsUnderlyingAsset
Underlying asset data within an options snapshot.
Publisher
Publisher information.
RelatedTicker
Related ticker.
RiskCategory
Risk category.
RiskFactor
Risk factor entry.
ShortInterest
Short interest data point.
ShortVolume
Short volume data point.
Split
Stock split event.
TickerDetails
Detailed ticker overview.
TickerDetailsResponse
Ticker details response wrapper.
TickerEvent
Ticker event.
TickerEventsResponse
Ticker events response.
TickerRef
Ticker reference entry.
TickerType
Ticker type.

Functions§

all_tickers
Fetch all tickers.
analyst_details
Fetch analyst details.
analyst_insights
Fetch analyst insights.
analyst_ratings
Fetch analyst ratings.
benzinga_earnings
Fetch earnings announcements.
bulls_bears
Fetch bull/bear summaries.
condition_codes
Fetch condition codes.
consensus_ratings
Fetch consensus ratings.
corporate_events
Fetch corporate events.
corporate_guidance
Fetch corporate guidance.
crypto_aggregates
Fetch aggregate bars (OHLCV) for a crypto ticker over a date range.
crypto_daily_open_close
Fetch daily open/close for a crypto pair on a specific date.
crypto_ema
Fetch EMA (Exponential Moving Average) for a crypto ticker.
crypto_grouped_daily
Fetch grouped daily bars for the entire crypto market on a given date.
crypto_last_trade
Fetch the most recent trade for a crypto pair.
crypto_macd
Fetch MACD for a crypto ticker.
crypto_previous_close
Fetch the previous day’s OHLCV bar for a crypto ticker.
crypto_rsi
Fetch RSI (Relative Strength Index) for a crypto ticker.
crypto_sma
Fetch SMA (Simple Moving Average) for a crypto ticker.
crypto_snapshot
Fetch snapshot for a single crypto ticker.
crypto_snapshots_all
Fetch snapshots for all crypto tickers.
crypto_top_movers
Fetch top gainers or losers for crypto.
crypto_trades
Fetch historical trades for a crypto ticker.
currency_conversion
Convert a currency amount from one currency to another.
etf_analytics
Fetch ETF analytics.
etf_constituents
Fetch ETF constituents/holdings.
etf_fund_flows
Fetch ETF fund flows.
etf_profiles
Fetch ETF profiles/exposure.
etf_taxonomies
Fetch ETF taxonomies.
exchanges
Fetch exchanges list.
filing_8k_text
Fetch 8-K filing text.
filing_10k_sections
Fetch 10-K filing section content.
firm_details
Fetch firm details.
forex_aggregates
Fetch aggregate bars (OHLCV) for a forex ticker over a date range.
forex_ema
Fetch EMA (Exponential Moving Average) for a forex ticker.
forex_grouped_daily
Fetch grouped daily bars for the entire forex market on a given date.
forex_last_quote
Fetch the last quote for a forex currency pair.
forex_macd
Fetch MACD for a forex ticker.
forex_previous_close
Fetch the previous day’s OHLCV bar for a forex ticker.
forex_quotes
Fetch historical quotes for a forex ticker.
forex_rsi
Fetch RSI (Relative Strength Index) for a forex ticker.
forex_sma
Fetch SMA (Simple Moving Average) for a forex ticker.
forex_snapshot
Fetch snapshot for a single forex ticker.
forex_snapshots_all
Fetch snapshots for all forex tickers.
forex_top_movers
Fetch top forex movers (gainers or losers).
futures_aggregates
Fetch aggregate bars (OHLCV) for a futures ticker over a date range.
futures_contracts
Fetch futures contracts reference data.
futures_products
Fetch futures products reference data.
futures_quotes
Fetch historical quotes for a futures ticker.
futures_schedules
Fetch futures schedules reference data.
futures_snapshot
Fetch snapshot for a futures ticker.
futures_trades
Fetch historical trades for a futures ticker.
index_aggregates
Fetch aggregate bars (OHLCV) for an index ticker over a date range.
index_daily_open_close
Fetch daily open/close for an index ticker on a specific date.
index_ema
Fetch EMA (Exponential Moving Average) for an index ticker.
index_macd
Fetch MACD for an index ticker.
index_previous_close
Fetch the previous day’s OHLCV bar for an index ticker.
index_rsi
Fetch RSI (Relative Strength Index) for an index ticker.
index_sma
Fetch SMA (Simple Moving Average) for an index ticker.
index_snapshot
Fetch snapshot for a single index ticker.
inflation
Fetch inflation data.
inflation_expectations
Fetch inflation expectations.
init
Initialize the global Polygon client with an API key.
init_with_timeout
Initialize the Polygon client with a custom timeout.
labor_market
Fetch labor market data (unemployment, participation, earnings, job openings).
market_holidays
Fetch upcoming market holidays.
market_status
Fetch current market status.
merchant_aggregates
Fetch merchant aggregate spending data.
merchant_hierarchy
Fetch merchant hierarchy (merchant-to-parent mappings).
options_aggregates
Fetch aggregate bars (OHLCV) for an options contract over a date range.
options_chain_snapshot
Fetch the options chain snapshot for an underlying ticker.
options_contract_details
Fetch details for a single options contract.
options_contract_snapshot
Fetch a snapshot for a single options contract.
options_contracts
Fetch a list of options contracts matching the given query parameters.
options_daily_open_close
Fetch daily open/close for an options contract on a specific date.
options_ema
Fetch EMA (Exponential Moving Average) for an options contract.
options_last_trade
Fetch the most recent trade for an options contract.
options_macd
Fetch MACD for an options contract.
options_previous_close
Fetch the previous day’s OHLCV bar for an options contract.
options_quotes
Fetch historical quotes for an options contract.
options_rsi
Fetch RSI (Relative Strength Index) for an options contract.
options_sma
Fetch SMA (Simple Moving Average) for an options contract.
options_trades
Fetch historical trades for an options contract.
related_tickers
Fetch related tickers.
risk_categories
Fetch risk factor categories.
risk_factors
Fetch risk factors from SEC filings.
sec_edgar_index
Fetch SEC EDGAR index (filing metadata).
stock_aggregates
Fetch aggregate bars (OHLCV) for a stock ticker over a date range.
stock_daily_open_close
Fetch daily open/close for a stock ticker on a specific date.
stock_dividends
Fetch historical dividends.
stock_ema
Fetch EMA (Exponential Moving Average) for a stock ticker.
stock_financials
Fetch stock financials (balance sheets, income statements, cash flow).
stock_float
Fetch float data for a stock ticker.
stock_grouped_daily
Fetch grouped daily bars for the entire stock market on a given date.
stock_ipos
Fetch IPO data.
stock_last_quote
Fetch the most recent NBBO quote for a stock ticker.
stock_last_trade
Fetch the most recent trade for a stock ticker.
stock_macd
Fetch MACD for a stock ticker.
stock_news
Fetch news articles, optionally filtered by ticker.
stock_previous_close
Fetch the previous day’s OHLCV bar for a stock ticker.
stock_quotes
Fetch historical NBBO quotes for a stock ticker.
stock_ratios
Fetch financial ratios for a stock ticker.
stock_rsi
Fetch RSI (Relative Strength Index) for a stock ticker.
stock_short_interest
Fetch short interest data for a stock ticker.
stock_short_volume
Fetch short volume data for a stock ticker.
stock_sma
Fetch SMA (Simple Moving Average) for a stock ticker.
stock_snapshot
Fetch snapshot for a single stock ticker.
stock_snapshots_all
Fetch snapshots for all US stock tickers.
stock_splits
Fetch historical stock splits.
stock_ticker_events
Fetch ticker events (name changes, mergers, etc.).
stock_top_movers
Fetch top gainers or losers snapshot.
stock_trades
Fetch historical trades for a stock ticker.
ticker_details
Fetch detailed ticker information.
ticker_types
Fetch ticker types.
treasury_yields
Fetch US Treasury yield data.