Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Python module to get stock data from IEX API 1.0

Project description


.. image::

.. image::

.. image::

.. image::

Python module to retrieve stock data from the
`Investors Exchange (IEX) <>`__
`Developer API <>`__
platform. iexfinance provides real-time financial data from the various IEX
endpoints, as well as historical time-series data.

This data includes stock quotes, fundamentals, actions, and information. In
addition, support for IEX market data and statistics is provided.

- `Stocks <>`__
- `Reference Data <>`__
- `IEX Market Data <>`__
- `IEX Stats <>`__


See `IEX Finance
Documentation <>`__


From PyPI with pip (latest stable release):

``$ pip3 install iexfinance``

From development repository (dev version):

.. code:: bash

$ git clone
$ cd iexfinance
$ python3 install

Usage Examples

Using iexfinance to access data from IEX is quite easy. The most commonly-used
endpoints are the `Stocks <>`__
endpoints, which allow access to various information regarding equities,
including quotes, historical prices, dividends, and much more.

All top-level functions (such as ``Stock`` and ``get_historical_data``), allow
for `Request Parameters
<>`__, which
include ``retry_count``, ``pause``, and ``session``. These parameters are
entirely optional. The first two deal with how unsuccessful requests are
handled, and the third allows for the passing of a cached ``requests-cache``
session (see `caching

Stock Endpoints

.. code:: python

from iexfinance import Stock
tsla = Stock('TSLA')

It's also possible to obtain historical data from the ``get_historical_data``
top-level function. This will return a daily time-series of the ticker
requested over the desired date range (``start`` and ``end`` passed as
``datetime.datetime`` objects).

Pandas DataFrame and JSON (dict) output formatting are selected with the
``output_format`` parameter.

**Historical Data**

.. code:: python

from iexfinance import get_historical_data
from datetime import datetime

start = datetime(2017, 2, 9)
end = datetime(2017, 5, 24)

df = get_historical_data("AAPL", start=start, end=end, output_format='pandas')

The resulting DataFrame will indexed by date, with a column for each OHLC

.. image:: /docs/source/images/dfdailyaapl.JPG

It's really simple to plot this data, using `matplotlib:

.. code:: python

import matplotlib.pyplot as plt



.. image:: /docs/source/images/plotdailyaapl.jpg

IEX Reference Data

Support for the `IEX Reference Data
<>`__ endpoints is
available through the top level functions ``get_symbols``,
``get_corporate_actions``, ``get_dividends``, ``get_next_day_ex_date``, and
``get_listed_symbol_dir``. As with all endpoints, request parameters such as
``retry_count`` and output format selection (through ``output_format``) can be
passed to the call.

.. code:: python

from iexfinance import get_available_symbols


IEX Market Data

The `IEX Market Data
<>`__ endpoints are
supported through various top-level functions, including ``get_market_tops``
and ``get_market_deep``.

.. code:: python

from iexfinance import get_market_tops


IEX Stats

The `IEX Stats
<>`__ endpoints are
supported through various top-level functions, including ``get_stats_intraday``
and ``get_stats_recent``. These endpoints provide IEX's trading statistics for
a given ticker.

.. code:: python

from iexfinance import get_stats_intraday



Email: ` <>`__

Twitter: `alynchfc <>`__


Copyright © 2018 Addison Lynch

See LICENSE for details

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
iexfinance-0.3.3.tar.gz (20.3 kB) Copy SHA256 hash SHA256 Source None Apr 21, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page