Query Financial Time Series Data#

You can query IEX Cloud Data using the GET /data endpoint.

Here you’ll get familiar with the GET /data endpoint and use time series parameters to get records that match a time range.

Prerequisite

Free Trial or IEX Cloud account. Create one here.

Understanding the GET /data Endpoint#

IEX Cloud Data API URLs include a base URL, the API version, an endpoint, and any query parameters (API token is required).

URL Structure:

BASE_URL/VERSION/ENDPOINT?token=TOKEN

Here’s the standard GET /data endpoint format:

GET /data/core/:id/:key?/:subkey?

It has these path parameters:

Path Parameter

Description

id

(Required) Dataset ID

key

(Required) Primary index

subkey

(Optional) Secondary index

The endpoint is easy to understand and use. After /data/core/ and dataset ID path parameters, enter your primary index (key) value, and add any query parameters you want.

Important

key and subkey path parameters are restricted to primary and secondary indexes, respectively.

For example, this URL returns a dataset record for the key value AAPL:

https://api.iex.cloud/v1/data/core/quote/AAPL?token=TOKEN

Note

The GET /data endpoint returns at most one record unless you specify a date subkey, range, or a higher limit value.

Let’s explore filtering on a time range next.

Filtering on a Time Range#

All time series endpoint parameters apply to the GET /data/core/:id/:key?/:subkey? endpoint. The time series query parameters allow you to get records for the time frame you want.

For example, this query uses the from and to time series query parameters, to retrieve records for a specific set of days.

Request:

https://api.iex.cloud/v1/data/core/SOME_DATASET?token=TOKEN&from=2019-02-13&to=2019-02-20

Response:

[
    {
        "close": 43.0075,
        "date": "2019-02-20",
        "high": 43.33,
        "low": 42.7475,
        "open": 42.7975,
        "symbol": "AAPL",
        "volume": 104457448
    },
    {
        "close": 42.7325,
        "date": "2019-02-19",
        "high": 42.86,
        "low": 42.3725,
        "open": 42.4275,
        "symbol": "AAPL",
        "volume": 75891304
    },
    {
        "close": 42.605,
        "date": "2019-02-15",
        "high": 42.925,
        "low": 42.4375,
        "open": 42.8125,
        "symbol": "AAPL",
        "volume": 98507256
    },
    {
        "close": 42.7,
        "date": "2019-02-14",
        "high": 42.8154,
        "low": 42.345,
        "open": 42.4275,
        "symbol": "AAPL",
        "volume": 87342988
    },
    {
        "close": 42.545,
        "date": "2019-02-13",
        "high": 43.12,
        "low": 42.48,
        "open": 42.8475,
        "symbol": "AAPL",
        "volume": 89960932
    }
]

There are parameters that facilitate filtering on specific quarters and semesters, and the previous/current/future days, weeks, months, and years. For more details and examples, please see GET /data.

What’s Next#

If you want to get data from IEX Cloud’s other endpoints, please see Use IEX Cloud Financial Data.

Paginate with Chunks of Data using apperate.queryData() in JavaScript or using the GET /data REST endpoint directly. Pagination and handling large amounts of data has never been easier.