Data APIs¶
IEX Cloud data can be organized into three generic data APIs: time-series, data-tables, and data-points. Each API type is self describing and the docs can be accessed without an API token.
Data Points¶
Data points are available per symbol and return individual plain text values. Retrieving individual data points is useful for Excel and Google Sheet users, and applications where a single, lightweight value is needed. We also provide update times for some endpoints which allow you to call an endpoint only once it has new data.
Full access to the Data Points endpoints is available through the
get_data_points
function.
- iexfinance.data_apis.get_data_points(symbol, key=None, **kwargs)¶
Warning
This endpoint no longer appears in the IEX Cloud documentation and may have been removed.
DataFrame of datapoints for a symbol (if no additional parameters passed) or single data point for a given symbol and data point key
Data Weighting:
Free
for list, varies for others- symbol: str
Valid symbol
- key: str, optional
Datapoint key
Available Data Points For a Symbol¶
To obtain all available data points for a symbol, simply pass the symbol to
get_data_points
with no key:
In [1]: from iexfinance.data_apis import get_data_points
In [2]: get_data_points("AAPL", output_format='pandas').head()
Out[2]:
key ... lastUpdated
0 NEXTDIVIDENDDATE ... 2020-11-05T20:23:03+00:00
1 BETA ... 2021-06-02T09:37:30+00:00
2 ACCOUNTSPAYABLE ... 2021-06-02T15:05:15+00:00
3 CAPITALSURPLUS ... 2021-06-02T15:05:15+00:00
4 COMMONSTOCK ... 2021-06-02T15:05:15+00:00
[5 rows x 4 columns]
Individual Data Points For a Symbol¶
To obtain an individual data point for a single symbol, pass the symbol and the
data point ID to get_data_points
:
Apple Inc. (AAPL) latest price
In [3]: get_data_points("AAPL", "COMMONSTOCK")
Out[3]: 14947192327
Time Series¶
Time series is the most common type of data available, and consists of a collection of data points over a period of time. Time series data is indexed by a single date field, and can be retrieved by any portion of time.
Full access to the Time Series endpoints is available through the
get_time_series
function.
- iexfinance.data_apis.get_time_series(id_=None, key=None, subkey=None, **kwargs)¶
List of time series available (if no parameters passed) or time series data for given id, key, and subkey.
Reference: https://iexcloud.io/docs/api/#time-series
Data Weighting:
Free
for list, varies for others- id: str, optional
Time Series dataset ID (function returns list of all available datasets if argument not passed)
- key: str, optional
Key used to identify data within a dataset (e.g.
AAPL
)- subkey: str, optional
Key-based. Further refine data
All Available Time Series¶
To obtain a list of all available time series, simply call get_time_series
with no parameters:
In [4]: from iexfinance.data_apis import get_time_series
In [5]: get_time_series()
Out[5]:
XF ... FRSCUTEP_ISUER
inv_pk 8 ... 2080
id XF ... FRSCUTEP_ISUER
description r 2ctoPos txiinfi alae do,5sSet rarraph, ... stu iuaFcirslHtero
schema {'additionalProperties': True, 'properties': {... ... {'additionalProperties': True, 'properties': {...
weight 100110 ... 1011
created 2020-05-05T16:58:52.000Z ... 2021-05-25T14:22:26.000Z
updated 2020-05-05T16:58:52.000Z ... 2021-05-25T14:22:26.000Z
version 1 ... 1
weightKey XF ... ESPSECR_UFURIT
prepost NaN ... NaN
[10 rows x 95 columns]
Individual Time Series¶
Whereas calling get_time_series
with no parameters returns a full inventory
of time series endpoints, calling get_time_series
with an individual series
ID and (optional) keys and subkeys as parameters.
For example, to obtain the REPORTED_FINANCIALS
time series entry for Apple
Inc. (AAPL
):
In [6]: get_time_series("REPORTED_FINANCIALS", "AAPL").head()
Out[6]:
1970-01-01 00:27:21.322977241
AccountsPayableCurrent 63892823314
AccountsReceivableNetCurrent 27631785310
AccruedIncomeTaxesNoncurrent 28889299926
AccumulatedDepreciationDepletionAndAmortization... 70115891583
AccumulatedOtherComprehensiveIncomeLossNetOfTax 183256955
Or with a subkey:
In [7]: get_time_series("REPORTED_FINANCIALS", "AAPL", "10-Q").head()
Out[7]:
1970-01-01 00:28:06.934032881
AccountsPayableCurrent 66098635888
AccountsReceivableNetCurrent 28263855957
AccruedIncomeTaxesNoncurrent 29195135000
AccumulatedDepreciationDepletionAndAmortization... 67565256855
AccumulatedOtherComprehensiveIncomeLossNetOfTax 183896693
Any and all series-specific parameters (such as last
, to
, from
,
etc. should be passed as keyword arguments)
Examples¶
Last Apple Inc. Form 10-K
In [8]: get_time_series("REPORTED_FINANCIALS", "AAPL", "10-K", last=1).head()
Out[8]:
1970-01-01 00:27:28.214800856
AccountsPayableCurrent 42774095989
AccountsReceivableNetCurrent 16894191335
AccruedIncomeTaxesNoncurrent 29478733466
AccumulatedDepreciationDepletionAndAmortization... 69379220015
AccumulatedOtherComprehensiveIncomeLossNetOfTax -408405536