
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@exodus/price-api
Advanced tools
Util to fetch, validate and cache prices from server
yarn add @exodus/price-api
Module contains following useful utils:
fetchHistoricalPricesBased on provided arguments prepares params for request to exodus pricing server. Depending on runtime cache and client long-term cache decides how much data needs to be fetched. Validates data and prepares result to defined data structure.
prices cache example: [1502496000000, {close: 44}], [1502582400000, {close: 12}] ]
| Name | Type | Description | Optional | Returns |
|---|---|---|---|---|
| api | Function | Function to make request to pricing server | Promise | |
| assetTickers | Array | Array of asset tickers to fetch | ||
| fiatTicker | String | fiat currency supported by Exodus, as well as BTC | ||
| granularity | String | Granularity of the historical data, values must be day or hour | ||
| getCacheFromStorage | Function | accepts tickerSymbol and returns array historical prices | prices cache | |
| hourlyLimit | Number | limits historical hourly prices to fetch. default=168 | true | |
| timestamp | Number | milliseconds since Unix Epoch to fetch price exact on this date | true | |
| getCurrentTime | Function | returns milliseconds since Unix Epoch | true | milliseconds |
| ignoreInvalidSymbols | Bool | ignore error when fetch prices for unsupported assets. Empty Map will be returned for this asset | true | |
| ignoreCache | Bool | refetch the entire price history, ignoring existent cached values | true | |
| runtimeCache | Map | storage for runtime cache | true | |
| getRuntimeCacheKey | Function | get key to access runtime cache | true |
Object with Maps with prices Maps by asset ticker. prices Map keyed by timestamp in milliseconds. historicalPricesMap includes prices from cache fetchedPricesMap includes only assets fetched from server. If asset had cache but new prices fetched from server this Map includes combined data
{
historicalPricesMap: new Map([
['ZRX', new Map([ [1502496000000, {close: 44}], [1502582400000, {close: 12}] ])],
['BTC', new Map([ [1502496000000, {close: 10000}], [1502582400000, {close: 50000}] ])],
]),
fetchedPricesMap: new Map([
['ZRX', new Map([ [1502496000000, {close: 44}], [1502582400000, {close: 12}] ])],
['BTC', new Map([ [1502496000000, {close: 10000}], [1502582400000, {close: 50000}] ])],
])
}
fetchPricesIntervalSetup interval to fetch prices. Daily prices updated on UTC day start, hourly every UTC and local hour start.
| Name | Type | Description | Optional |
|---|---|---|---|
| func | Function | Function to make fetch prices | |
| granularity | Array | Granularity of the historical data, values must be day or hour | |
| getJitter | Function | Function that returns jitter (ms) to create delay in [0, jitter] range | true |
| delay | Number | delay in milliseconds | true |
| getCurrentTime | Function | returns milliseconds since Unix Epoch | true |
FAQs
Util to fetch, validate and cache prices from server
We found that @exodus/price-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 105 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.