Querying Datasets with iex.js#

Use the iexjs library queryDataset method to search any Apperate dataset (Core or private) you have a token for.

Example: Searching a Dataset#

Once you’ve installed the iexjs package, instantiate a Client (passing in your API token and API version in place of TOKEN and VERSION below) and call queryDataset with the key (primary index), workspace, and dataset of the equity you want data for.

For example, if you want Apple cash flow records, pass in the Apple symbol AAPL for the key, CORE for the workspace, and CASH_FLOW for the dataset.

const {Client} = require("@apperate/iexjs")
const client = new Client({api_token: "TOKEN", version: "VERSION"});
client.platform.queryData({key: "AAPL", workspace: "CORE", id: "CASH_FLOW"}).then((res) => {
    console.log(res);
});

The CASH_FLOW dataset’s key property is symbol. Like all Core datasets, the CASH_FLOW dataset is in the CORE workspace.

Tip

You can reveal a dataset’s key, subkey, and date properties by expanding the dataset in the console’s Datasets sidebar.

You can fine-tune your search by specifying additional GET /data query parameters.

For example, you can limit results to a particular time range using the from and to GET /data query parameters.

client.platform.queryData({
    key: "AAPL", workspace: "CORE", id: "CASH_FLOW",
    from: "2019-01-01", to: "2019-07-01"}).then((res) => {
        console.log(res);
});

It’s that easy to query datasets from your JavaScript apps!

What’s Next?#

iex.js Core Data Methods provides a Core Data reference for current plans and legacy plans.

iex.js Apperate CRUD Methods lists methods for invoking Apperate CRUD operations on data, datasets, and more.