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§
- Additional
Underlying - An additional underlying asset for a contract.
- Analyst
Detail - Analyst details.
- Analyst
Insight - Analyst insight.
- Analyst
Rating - Analyst rating.
- Bull
Bear - Bull/bear summary.
- Condition
- Condition code.
- Consensus
Rating - Consensus rating.
- Conversion
Last - Currency conversion last price data.
- Corporate
Event - Corporate event from Wall Street Horizon.
- Corporate
Guidance - Corporate guidance.
- Crypto
Daily Open Close - Daily open/close response for a crypto pair.
- Crypto
Last Trade - Last trade data for a crypto pair.
- Crypto
Last Trade Response - Response wrapper for crypto last trade.
- Crypto
Open Close Trade - A single trade within a crypto daily open/close response.
- Currency
Conversion - Response for the currency conversion endpoint.
- Dividend
- Dividend event.
- Earnings
Announcement - Earnings announcement.
- Economic
Data Point - Economic data point.
- EtfAnalytics
- ETF analytics data.
- EtfConstituent
- ETF constituent/holding.
- EtfFund
Flow - ETF fund flow.
- EtfProfile
Data - ETF profile.
- EtfTaxonomy
- ETF taxonomy.
- Exchange
- Exchange.
- Filing
Entry - SEC filing metadata.
- Filing
Section - SEC filing section content.
- Filing
Sections Response - Filing sections response.
- Financial
Ratios - Financial ratios.
- Financial
Result - A financial statement row (balance sheet, income, or cash flow).
- Firm
Detail - Firm details.
- Float
Data - Float data.
- Forex
Last Quote - Last forex quote data.
- Forex
Quote Response - Response for the last forex quote endpoint.
- Futures
Contract - A futures contract from the reference endpoint.
- Futures
Product - A futures product from the reference endpoint.
- Futures
Schedule - A futures schedule from the reference endpoint.
- Futures
Session - Session data within a futures snapshot.
- Futures
Snapshot - A single futures snapshot.
- Futures
Snapshot Response - Response wrapper for futures snapshots.
- Index
Session - Session data within an index snapshot.
- Index
Snapshot - A single index snapshot.
- Index
Snapshot Response - Response wrapper for index snapshots.
- Insight
- Sentiment insight.
- Ipo
- IPO event.
- Market
Holiday - Market holiday.
- Market
Status Response - Market status for exchanges.
- Merchant
Aggregate - Merchant aggregate data (European consumer spending).
- Merchant
Hierarchy - Merchant hierarchy entry (merchant-to-parent mapping).
- News
Article - News article.
- Options
Contract - An options contract from the Polygon reference API.
- Options
Contract Response - Response wrapper for a single options contract detail.
- Options
Contract Snapshot Response - Response wrapper for a single options contract snapshot.
- Options
Greeks - Greeks for an options contract snapshot.
- Options
Snapshot - A single options contract snapshot from the chain or individual lookup.
- Options
Snapshot Details - Contract details within an options snapshot.
- Options
Snapshot Quote - Last quote data within an options snapshot.
- Options
Snapshot Trade - Last trade data within an options snapshot.
- Options
Underlying Asset - Underlying asset data within an options snapshot.
- Publisher
- Publisher information.
- Related
Ticker - Related ticker.
- Risk
Category - Risk category.
- Risk
Factor - Risk factor entry.
- Short
Interest - Short interest data point.
- Short
Volume - Short volume data point.
- Split
- Stock split event.
- Ticker
Details - Detailed ticker overview.
- Ticker
Details Response - Ticker details response wrapper.
- Ticker
Event - Ticker event.
- Ticker
Events Response - Ticker events response.
- Ticker
Ref - Ticker reference entry.
- Ticker
Type - 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.