iex.js JavaScript Library#

iex.js (or simply iexjs) is a client library for getting data from Apperate and operating on Apperate resources, such as data, datasets, data sources, and more. The easy-to-use JavaScript methods wrap calls to IEX Cloud endpoints, so you can tap into Core Data, permissioned datasets, and Apperate resource CRUD operations.

Installation#

Use npm to install iexjs.

npm install --save iexjs

Note

iexjs can also run in the browser via native fetch and eventsource, or from node via cross-fetch and eventsource.

Examples#

The iexjs Client object stores your API token (API key) and IEX Cloud API version (e.g., v1) for convenience.

Tip

The iexjs client automatically picks up tokens from the environment variable IEX_TOKEN.

Here are some examples.

Get a real-time stock quote:

const {Client} = require("@apperate/iexjs")
const client = new Client({api_token: "TOKEN", version: "VERSION"});
client.quote({symbol: "AAPL"}).then((res) => {
    console.log(res);
});

See also

iex.js Core Data Methods has information on all the methods.

Get Apple’s latest cash flow details:

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

The client’s apperate object (shown above) has wrapper methods to Apperate APIs, including the Data API. The queryData method retrieves data from a dataset via the dataset id. You can retrieve data from a CORE dataset or any workspace dataset you have access to.

See also

Querying Datasets with iex.js provides details on searching datasets.

Open Source Project#

The iex.js package is an open source project available at https://www.npmjs.com/package/@apperate/iexjs.

What’s Next#

Querying Datasets with iex.js demonstrates getting data from private permissioned datasets (e.g., your datasets).

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

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