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)¶ DataFrame of datapoints for a symbol (if no additional parameters passed) or single data point for a given symbol and data point key
Reference: https://iexcloud.io/docs/api/#data-apis
Data Weighting:
Free
for list, varies for others- Parameters
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 ... 2020-12-12T04:09:25+00:00
2 ACCOUNTSPAYABLE ... 2020-12-10T17:10:00+00:00
3 CAPITALSURPLUS ... 2020-12-10T17:10:00+00:00
4 COMMONSTOCK ... 2020-12-10T17:10:00+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]: 656915903
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- Parameters
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]:
FX ... FSNAIINCLA
inv_pk 8 ... 2047
id FX ... FSNAIINCLA
description iPeps,xtre,t so5ltifh oc Sar a 2nra daori ... lincFinsaa
schema {'additionalProperties': True, 'properties': {... ... {'additionalProperties': False, 'properties': ...
weight 104189 ... 5078
created 2020-05-05T16:58:52.000Z ... 2020-12-11T15:14:48.000Z
updated 2020-05-05T16:58:52.000Z ... 2020-12-11T15:14:48.000Z
version 1 ... 1
weightKey XF ... FAAILNCNSI
prepost NaN ... NaN
[10 rows x 98 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:43.780986578
AccountsPayableCurrent 33832880962
AccountsReceivableNetCurrent 16353442442
AccruedIncomeTaxesNoncurrent 28804693044
AccumulatedDepreciationDepletionAndAmortization... 63616540858
AccumulatedOtherComprehensiveIncomeLossNetOfTax -2840411729
Or with a subkey:
In [7]: get_time_series("REPORTED_FINANCIALS", "AAPL", "10-Q").head()
Out[7]:
1970-01-01 00:26:44.268260764
AccountsPayableCurrent 33671479254
AccountsReceivableNetCurrent 16054438035
AccruedIncomeTaxesNoncurrent 29558075637
AccumulatedDepreciationDepletionAndAmortization... 63887192174
AccumulatedOtherComprehensiveIncomeLossNetOfTax -2866310462
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:09.391937427
AccountsPayableCurrent 46467673701
AccountsReceivableNetCurrent 23137214528
AccruedIncomeTaxesNoncurrent 30436834848
AccumulatedDepreciationDepletionAndAmortization... 60460721337
AccumulatedOtherComprehensiveIncomeLossNetOfTax -609437775