Reference APIs
Read this page to know everything you need to know about using the various References HTTP endpoints.
See Async Support for REST endpoints for asynchronous use cases.
Docs below assume you have already read getting started page and know how to create the client. If you do not know how to create the client, first see General guide for clients & functions and create client as below. As always you can have all 5 different clients together.
import polygon
reference_client = polygon.ReferenceClient('KEY') # for usual sync client
async_reference_client = polygon.ReferenceClient('KEY', True) # for an async client
here is how the client initializer looks like:
- polygon.reference_apis.reference_api.ReferenceClient(api_key: str, use_async: bool = False, connect_timeout: int = 10, read_timeout: int = 10, pool_timeout: int = 10, max_connections: int | None = None, max_keepalive: int | None = None, write_timeout: int = 10)
Initiates a Client to be used to access all REST References endpoints.
- Parameters:
api_key – Your API Key. Visit your dashboard to get yours.
use_async – Set it to
True
to get async client. Defaults to usual non-async client.connect_timeout – The connection timeout in seconds. Defaults to 10. basically the number of seconds to wait for a connection to be established. Raises a
ConnectTimeout
if unable to connect within specified time limit.read_timeout – The read timeout in seconds. Defaults to 10. basically the number of seconds to wait for date to be received. Raises a
ReadTimeout
if unable to connect within the specified time limit.pool_timeout – The pool timeout in seconds. Defaults to 10. Basically the number of seconds to wait while trying to get a connection from connection pool. Do NOT change if you’re unsure of what it implies
max_connections – Max number of connections in the pool. Defaults to NO LIMITS. Do NOT change if you’re unsure of application
max_keepalive – max number of allowable keep alive connections in the pool. Defaults to no limit. Do NOT change if you’re unsure of the applications.
write_timeout – The write timeout in seconds. Defaults to 10. basically the number of seconds to wait for data to be written/posted. Raises a
WriteTimeout
if unable to connect within the specified time limit.
Endpoints
To use any of the below method, simply call it on the client you created above. so if you named your client client
,
you’d call the methods as client.get_tickers
and so on. Async methods will need to be awaited, see Async Support for REST endpoints.
Get Tickers
This endpoint supports pagination. Passing all_pages=True
enables it. See Pagination Support for better info
- SyncReferenceClient.get_tickers(symbol: str = '', ticker_lt=None, ticker_lte=None, ticker_gt=None, ticker_gte=None, symbol_type='', market='', exchange: str = '', cusip: str | None = None, cik: str = '', date=None, search: str | None = None, active: bool = True, sort='ticker', order='asc', limit: int = 1000, all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Crypto, and Forex. Official Docs
- Parameters:
symbol – Specify a ticker symbol. Defaults to empty string which queries all tickers.
ticker_lt – Return results where this field is less than the value given
ticker_lte – Return results where this field is less than or equal to the value given
ticker_gt – Return results where this field is greater than the value given
ticker_gte – Return results where this field is greater than or equal to the value given
symbol_type – Specify the type of the tickers. See
polygon.enums.TickerType
for common choices. Find all supported types via the Ticker Types API Defaults to empty string which queries all types.market – Filter by market type. By default all markets are included. See
polygon.enums.TickerMarketType
for available choices.exchange – Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes at the ISO org website. Defaults to empty string which queries all exchanges.
cusip – Specify the
CUSIP
code of the asset you want to search for. Find more information about CUSIP codes on their website Defaults to empty string which queries all CUSIPscik – Specify the
CIK
of the asset you want to search for. Find more information about CIK codes at their website Defaults to empty string which queries all CIKs.date – Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. Could be
datetime
,date
or a stringYYYY-MM-DD
search – Search for terms within the ticker and/or company name. for e.g.
MS
will match matching symbolsactive – Specify if the tickers returned should be actively traded on the queried date. Default is True
sort – The field to sort the results on. Default is ticker. If the search query parameter is present, sort is ignored and results are ordered by relevance. See
polygon.enums.TickerSortType
for available choices.order – The order to sort the results on. Default is asc. See
polygon.enums.SortOrder
for available choices.limit – Limit the size of the response, default is 1000 which is also the max.
Pagination
is supported by the pagination function belowall_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary. This is ignored if pagination is set to True.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object. If pagination is set to True, will return a merged response of all pages for convenience.
Get Ticker Types
- SyncReferenceClient.get_ticker_types(asset_class=None, locale=None, raw_response: bool = False)
Get a mapping of ticker types to their descriptive names. Official Docs
- Parameters:
asset_class – Filter by asset class. see
polygon.enums.AssetClass
for choiceslocale – Filter by locale. See
polygon.enums.Locale
for choicesraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Ticker Details
- SyncReferenceClient.get_ticker_details(symbol: str, date=None, raw_response: bool = False)
Get a single ticker supported by Polygon.io. This response will have detailed information about the ticker and the company behind it. Official Docs
- Parameters:
symbol – The ticker symbol of the asset.
date – Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. Defaults to the most recent available date.
raw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Option Contract
- SyncReferenceClient.get_option_contract(ticker: str, as_of_date=None, raw_response: bool = False)
get Info about an option contract Official Docs
- Parameters:
ticker – An option ticker in standard format. The lib provides easy functions to build and work with option symbols
as_of_date – Specify a point in time for the contract. You can pass a
datetime
ordate
object or a string in formatYYYY-MM-DD
. Defaults to today’s dateraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Option Contracts
This endpoint supports pagination. Passing all_pages=True
enables it. See Pagination Support for better info
- SyncReferenceClient.get_option_contracts(underlying_ticker: str | None = None, ticker: str | None = None, contract_type=None, expiration_date=None, expiration_date_lt=None, expiration_date_lte=None, expiration_date_gt=None, expiration_date_gte=None, order='asc', sort='expiration_date', limit=1000, all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False, as_of_date=None)
List currently active options contracts Official Docs
- Parameters:
underlying_ticker – Query for contracts relating to an underlying stock ticker.
ticker – Query for a contract by option ticker.
contract_type – Query by the type of contract. see
polygon.enums.OptionsContractType
for choicesexpiration_date – Query by contract expiration date. either
datetime
,date
or stringYYYY-MM-DD
expiration_date_lt – expiration date less than given value
expiration_date_lte – expiration date less than equal to given value
expiration_date_gt – expiration_date greater than given value
expiration_date_gte – expiration_date greater than equal to given value
order – Order of results. See
polygon.enums.SortOrder
for choices.sort – Sort field for ordering. See
polygon.enums.OptionsContractsSortType
for choices. defaults to expiration_datelimit – Limit the size of the response, default is 1000.
Pagination
is supported by the pagination function belowall_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary. This is ignored if pagination is set to True.as_of_date – Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today’s date.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object. If pagination is set to True, will return a merged response of all pages for convenience.
Get Ticker News
This endpoint supports pagination. Passing all_pages=True
enables it. See Pagination Support for better info
- SyncReferenceClient.get_ticker_news(symbol: str | None = None, limit: int = 1000, order='desc', sort='published_utc', ticker_lt=None, ticker_lte=None, ticker_gt=None, ticker_gte=None, published_utc=None, published_utc_lt=None, published_utc_lte=None, published_utc_gt=None, published_utc_gte=None, all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source. Official Docs
- Parameters:
symbol – To get news mentioning the name given. Defaults to empty string which doesn’t filter tickers
limit – Limit the size of the response, default is 1000 which is also the max.
Pagination
is supported by the pagination function beloworder – Order the results. See
polygon.enums.SortOrder
for choices.sort – The field key to sort. See
polygon.enums.TickerNewsSort
for choices.ticker_lt – Return results where this field is less than the value.
ticker_lte – Return results where this field is less than or equal to the value.
ticker_gt – Return results where this field is greater than the value
ticker_gte – Return results where this field is greater than or equal to the value.
published_utc – A date string
YYYY-MM-DD
ordatetime
for published date time filters.published_utc_lt – Return results where this field is less than the value given
published_utc_lte – Return results where this field is less than or equal to the value given
published_utc_gt – Return results where this field is greater than the value given
published_utc_gte – Return results where this field is greater than or equal to the value given
all_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary. This is ignored if pagination is set to True.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object. If pagination is set to True, will return a merged response of all pages for convenience.
Get Stock dividends
This endpoint supports pagination. Passing all_pages=True
enables it. See Pagination Support for better info
- SyncReferenceClient.get_stock_dividends(ticker: str | None = None, ex_dividend_date=None, record_date=None, declaration_date=None, pay_date=None, frequency: int | None = None, limit: int = 1000, cash_amount=None, dividend_type=None, sort: str = 'pay_date', order: str = 'asc', ticker_lt=None, ticker_lte=None, ticker_gt=None, ticker_gte=None, ex_dividend_date_lt=None, ex_dividend_date_lte=None, ex_dividend_date_gt=None, ex_dividend_date_gte=None, record_date_lt=None, record_date_lte=None, record_date_gt=None, record_date_gte=None, declaration_date_lt=None, declaration_date_lte=None, declaration_date_gt=None, declaration_date_gte=None, pay_date_lt=None, pay_date_lte=None, pay_date_gt=None, pay_date_gte=None, cash_amount_lt=None, cash_amount_lte=None, cash_amount_gt=None, cash_amount_gte=None, all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
Get a list of historical cash dividends, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount. Official Docs
- Parameters:
ticker – Return the dividends that contain this ticker.
ex_dividend_date – Query by ex-dividend date. could be a date, datetime object or a string
YYYY-MM-DD
record_date – Query by record date. could be a date, datetime object or a string
YYYY-MM-DD
declaration_date – Query by declaration date. could be a date, datetime object or a string
YYYY-MM-DD
pay_date – Query by pay date. could be a date, datetime object or a string
YYYY-MM-DD
frequency – Query by the number of times per year the dividend is paid out. No default value applied. see
polygon.enums.PayoutFrequency
for choiceslimit – Limit the size of the response, default is 1000 which is also the max.
Pagination
is supported by the pagination function belowcash_amount – Query by the cash amount of the dividend.
dividend_type – Query by the type of dividend. See
polygon.enums.DividendType
for choicessort – sort key used for ordering. See
polygon.enums.DividendSort
for choices.order – orders of results. defaults to asc. see
polygon.enums.SortOrder
for choicesticker_lt – filter where ticker is less than given value (alphabetically)
ticker_lte – filter where ticker is less than or equal to given value (alphabetically)
ticker_gt – filter where ticker is greater than given value (alphabetically)
ticker_gte – filter where ticker is greater than or equal to given value (alphabetically)
ex_dividend_date_lt – filter where ex-div date is less than given date
ex_dividend_date_lte – filter where ex-div date is less than or equal to given date
ex_dividend_date_gt – filter where ex-div date is greater than given date
ex_dividend_date_gte – filter where ex-div date is greater than or equal to given date
record_date_lt – filter where record date is less than given date
record_date_lte – filter where record date is less than or equal to given date
record_date_gt – filter where record date is greater than given date
record_date_gte – filter where record date is greater than or equal to given date
declaration_date_lt – filter where declaration date is less than given date
declaration_date_lte – filter where declaration date is less than or equal to given date
declaration_date_gt – filter where declaration date is greater than given date
declaration_date_gte – filter where declaration date is greater than or equal to given date
pay_date_lt – filter where pay date is less than given date
pay_date_lte – filter where pay date is less than or equal to given date
pay_date_gt – filter where pay date is greater than given date
pay_date_gte – filter where pay date is greater than or equal to given date
cash_amount_lt – filter where cash amt is less than given value
cash_amount_lte – filter where cash amt is less than or equal to given value
cash_amount_gt – filter where cash amt is greater than given value
cash_amount_gte – filter where cash amt is greater than or equal to given value
all_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary. This is ignored if pagination is set to True.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object. If pagination is set to True, will return a merged response of all pages for convenience.
Get Stock financials vX
- SyncReferenceClient.get_stock_financials_vx(ticker: str | None = None, cik: str | None = None, company_name: str | None = None, company_name_search: str | None = None, sic: str | None = None, filing_date=None, filing_date_lt=None, filing_date_lte=None, filing_date_gt=None, filing_date_gte=None, period_of_report_date=None, period_of_report_date_lt=None, period_of_report_date_lte=None, period_of_report_date_gt=None, period_of_report_date_gte=None, time_frame=None, include_sources: bool = False, order='asc', limit: int = 50, sort='filing_date', all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
Get historical financial data for a stock ticker. The financials data is extracted from XBRL from company SEC filings using this methodology Official Docs
This API is experimental and will replace
get_stock_financials()
in future.- Parameters:
ticker – Filter query by company ticker.
cik – filter the Query by
central index key (CIK)
Numbercompany_name – filter the query by company name
company_name_search – partial match text search for company names
sic – Query by
standard industrial classification (SIC)
filing_date – Query by the date when the filing with financials data was filed.
datetime/date
or stringYYYY-MM-DD
filing_date_lt – filter for filing date less than given value
filing_date_lte – filter for filing date less than equal to given value
filing_date_gt – filter for filing date greater than given value
filing_date_gte – filter for filing date greater than equal to given value
period_of_report_date – query by The period of report for the filing with financials data.
datetime/date
or string in format:YYY-MM-DD
.period_of_report_date_lt – filter for period of report date less than given value
period_of_report_date_lte – filter for period of report date less than equal to given value
period_of_report_date_gt – filter for period of report date greater than given value
period_of_report_date_gte – filter for period of report date greater than equal to given value
time_frame – Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4. See
polygon.enums.StockFinancialsTimeframe
for choices.include_sources – whether to include the xpath and formula attributes for each financial data point. See the xpath and formula response attributes for more info.
False
by defaultorder – Order results based on the sort field. ‘asc’ by default. See
polygon.enums.SortOrder
for choices.limit – number of max results to obtain. defaults to 50.
sort – Sort field key used for ordering. ‘filing_date’ default. see
polygon.enums.StockFinancialsSortKey
for choices.all_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Stock Splits
This endpoint supports pagination. Passing all_pages=True
enables it. See Pagination Support for better info
- SyncReferenceClient.get_stock_splits(ticker: str | None = None, execution_date=None, reverse_split: bool | None = None, order: str = 'asc', sort: str = 'execution_date', limit: int = 1000, ticker_lt=None, ticker_lte=None, ticker_gt=None, ticker_gte=None, execution_date_lt=None, execution_date_lte=None, execution_date_gt=None, execution_date_gte=None, all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
Get a list of historical stock splits, including the ticker symbol, the execution date, and the factors of the split ratio. Official Docs
- Parameters:
ticker – Return the stock splits that contain this ticker. defaults to no ticker filter returning all.
execution_date – query by execution date. could be a date, datetime object or a string
YYYY-MM-DD
reverse_split – Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used.
order – Order results based on the sort field. defaults to ascending. See
polygon.enums.SortOrder
for choicessort – Sort field used for ordering. Defaults to ‘execution_date’. See
polygon.enums.SplitsSortKey
for choices.limit – Limit the size of the response, default is 1000 which is also the max.
Pagination
is supported by the pagination function belowticker_lt – filter where ticker name is less than given value (alphabetically)
ticker_lte – filter where ticker name is less than or equal to given value (alphabetically)
ticker_gt – filter where ticker name is greater than given value (alphabetically)
ticker_gte – filter where ticker name is greater than or equal to given value (alphabetically)
execution_date_lt – filter where execution date is less than given value
execution_date_lte – filter where execution date is less than or equal to given value
execution_date_gt – filter where execution date is greater than given value
execution_date_gte – filter where execution date is greater than or equal to given value
all_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary. This is ignored if pagination is set to True.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object. If pagination is set to True, will return a merged response of all pages for convenience.
Get Market Holidays
- SyncReferenceClient.get_market_holidays(raw_response: bool = False)
Get upcoming market holidays and their open/close times. Official Docs
- Parameters:
raw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Market Status
- SyncReferenceClient.get_market_status(raw_response: bool = False)
Get the current trading status of the exchanges and overall financial markets. Official Docs
- Parameters:
raw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Conditions
- SyncReferenceClient.get_conditions(asset_class=None, data_type=None, condition_id=None, sip=None, order=None, limit: int = 50, sort='name', all_pages: bool = False, max_pages: int | None = None, merge_all_pages: bool = True, verbose: bool = False, raw_page_responses: bool = False, raw_response: bool = False)
List all conditions that Polygon.io uses. Official Docs
- Parameters:
asset_class – Filter for conditions within a given asset class. See
polygon.enums.AssetClass
for choices. Defaults to all assets.data_type – Filter by data type. See
polygon.enums.ConditionsDataType
for choices. defaults to all.condition_id – Filter for conditions with a given ID
sip – Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned.
order – Order results. See
polygon.enums.SortOrder
for choices.limit – limit the number of results. defaults to 50.
sort – Sort field used for ordering. Defaults to ‘name’. See
polygon.enums.ConditionsSortKey
for choices.all_pages – Whether to paginate through next/previous pages internally. Defaults to False. If set to True, it will try to paginate through all pages and merge all pages internally for you.
max_pages – how many pages to fetch. Defaults to None which fetches all available pages. Change to an integer to fetch at most that many pages. This param is only considered if
all_pages
is set to Truemerge_all_pages – If this is True, returns a single merged response having all the data. If False, returns a list of all pages received. The list can be either a list of response objects or decoded data itself, controlled by parameter
raw_page_responses
. This argument is Only considered ifall_pages
is set to True. Default: Trueverbose – Set to True to print status messages during the pagination process. Defaults to False.
raw_page_responses – If this is true, the list of pages will be a list of corresponding Response objects. Else, it will be a list of actual data for pages. This parameter is only considered if
merge_all_pages
is set to False. Default: Falseraw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object
Get Exchanges
- SyncReferenceClient.get_exchanges(asset_class=None, locale=None, raw_response: bool = False)
List all exchanges that Polygon.io knows about. Official Docs
- Parameters:
asset_class – filter by asset class. See
polygon.enums.AssetClass
for choices.locale – Filter by locale name. See
polygon.enums.Locale
raw_response – whether to return the
Response
Object. Useful for when you need to say check the status code or inspect the headers. Defaults to False which returns the json decoded dictionary.
- Returns:
A JSON decoded Dictionary by default. Make
raw_response=True
to get underlying response object